public class EngineBootsCounterFile extends Object implements EngineBootsProvider, EngineIdProvider
EngineBootsCounterFile
is a EngineBootsProvider
that stores the boot counter amd the engine ID of an agent in a file.Constructor and Description |
---|
EngineBootsCounterFile(File bootCounterFile)
Creates the boot counter by using the specified file.
|
Modifier and Type | Method and Description |
---|---|
File |
getBootCounterFile() |
int |
getEngineBoots()
Returns current engine boot counter value.
|
org.snmp4j.smi.OctetString |
getEngineId(org.snmp4j.smi.OctetString defaultEngineID)
Gets the engine ID for the SNMP entity associated with this
EngineIdProvider . |
protected int |
getLastEngineBoots()
Reads the engine boots counter from the corresponding input stream (file).
|
void |
resetEngineId(org.snmp4j.smi.OctetString engineId)
Sets the persistently stored engine ID to a new value.
|
protected void |
setEngineBoots(int engineBoots) |
int |
updateEngineBoots()
Returns the current engine boot counter value incremented by one.
|
public EngineBootsCounterFile(File bootCounterFile)
bootCounterFile
- a file (does not have to exists yet but must be writable).public int updateEngineBoots()
updateEngineBoots
in interface EngineBootsProvider
protected int getLastEngineBoots()
protected void setEngineBoots(int engineBoots)
public int getEngineBoots()
EngineBootsProvider
getEngineBoots
in interface EngineBootsProvider
public File getBootCounterFile()
public org.snmp4j.smi.OctetString getEngineId(org.snmp4j.smi.OctetString defaultEngineID)
EngineIdProvider
EngineIdProvider
.getEngineId
in interface EngineIdProvider
defaultEngineID
- the engine ID for this entity, if there is no persistently saved engine ID yet.defaultEngineID
which is then
persistently stored.public void resetEngineId(org.snmp4j.smi.OctetString engineId)
EngineIdProvider
resetEngineId
in interface EngineIdProvider
engineId
- the new engine ID for this SNMP entity.Copyright © 2020 SNMP4J.org. All rights reserved.