- java.lang.Object
-
- org.snmp4j.agent.cfg.EngineBootsCounterFile
-
- All Implemented Interfaces:
EngineBootsProvider
public class EngineBootsCounterFile extends java.lang.Object implements EngineBootsProvider
TheEngineBootsCounterFileis aEngineBootsProviderthat 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.FilegetBootCounterFile()intgetEngineBoots()Returns current engine boot counter value.protected intgetLastEngineBoots()Reads the engine boots counter from the corresponding input stream (file).protected voidsetEngineBoots(int engineBoots)intupdateEngineBoots()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:
updateEngineBootsin 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:EngineBootsProviderReturns current engine boot counter value.- Specified by:
getEngineBootsin interfaceEngineBootsProvider- Returns:
- the last engine boots counter.
-
getBootCounterFile
public java.io.File getBootCounterFile()
-
-