org.snmp4j.agent.cfg
Class EngineBootsCounterFile

java.lang.Object
  extended by org.snmp4j.agent.cfg.EngineBootsCounterFile
All Implemented Interfaces:
EngineBootsProvider

public class EngineBootsCounterFile
extends java.lang.Object
implements EngineBootsProvider

The EngineBootsCounterFile is a EngineBootsProvider that stores the boot counter in a file.

Version:
1.2
Author:
Frank Fock

Constructor Summary
EngineBootsCounterFile(java.io.File bootCounterFile)
          Creates the boot counter by using the specified file.
 
Method Summary
 int getEngineBoots()
          Returns current engine boot counter value.
protected  int getLastEngineBoots()
          Reads the engine boots counter from the corresponding input stream (file).
protected  void setEngineBoots(int engineBoots)
           
 int updateEngineBoots()
          Returns the current engine boot counter value incremented by one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EngineBootsCounterFile

public EngineBootsCounterFile(java.io.File bootCounterFile)
Creates the boot counter by using the specified file.

Parameters:
bootCounterFile - a file (does not have to exists yet but must be writable).
Method Detail

updateEngineBoots

public int updateEngineBoots()
Returns the current engine boot counter value incremented by one.

Specified by:
updateEngineBoots in interface EngineBootsProvider
Returns:
the last engine boots counter incremented by one.

getLastEngineBoots

protected int getLastEngineBoots()
Reads the engine boots counter from the corresponding input stream (file).

Returns:
the boots counter value read or zero if it could not be read.

setEngineBoots

protected void setEngineBoots(int engineBoots)

getEngineBoots

public int getEngineBoots()
Description copied from interface: EngineBootsProvider
Returns current engine boot counter value.

Specified by:
getEngineBoots in interface EngineBootsProvider
Returns:
the last engine boots counter.

Copyright 2005-2010 Frank Fock (SNMP4J.org)

Copyright © 2011 SNMP4J.org. All Rights Reserved.