- java.lang.Object
-
- org.snmp4j.agent.cfg.EngineBootsCounterFile
-
- All Implemented Interfaces:
EngineBootsProvider
public class EngineBootsCounterFile extends java.lang.Object implements EngineBootsProvider
TheEngineBootsCounterFile
is aEngineBootsProvider
that stores the boot counter in a file.- Version:
- 1.2
- Author:
- Frank Fock
-
-
Constructor Summary
Constructors Constructor Description EngineBootsCounterFile(java.io.File bootCounterFile)
Creates the boot counter by using the specified file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.File
getBootCounterFile()
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.
-
-
-
Method Detail
-
updateEngineBoots
public int updateEngineBoots()
Returns the current engine boot counter value incremented by one.- Specified by:
updateEngineBoots
in interfaceEngineBootsProvider
- 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 interfaceEngineBootsProvider
- Returns:
- the last engine boots counter.
-
getBootCounterFile
public java.io.File getBootCounterFile()
-
-