Class UsmTimeEntry
java.lang.Object
org.snmp4j.security.UsmTimeEntry
- All Implemented Interfaces:
Serializable
The
UsmTimeEntry class represents time synchronization
information associated with an engine ID.- Version:
- 1.0
- Author:
- Frank Fock
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUsmTimeEntry(OctetString engineID, int engineBoots, int engineTime) Creates a time entry with engine ID, engine boots and time. -
Method Summary
Modifier and TypeMethodDescriptionintintGets the time when a message has been received last from the associated SNMP engine.intbooleanIndicates whether this time entry has already been used to check the time window of an authenticated message, that is, whether the associated SNMP engine has proven its existence.voidsetAuthenticated(boolean authenticated) Marks this time entry as synchronized by an authenticated message.voidsetEngineBoots(int engineBoots) voidsetEngineTime(int engineTime) Sets the engine time which also sets the last received engine time to the supplied value.voidsetLatestReceivedTime(int latestReceivedTime) Sets the time when a message has been received last from the associated SNMP engine.voidsetTimeDiff(int timeDiff) toString()
-
Constructor Details
-
UsmTimeEntry
Creates a time entry with engine ID, engine boots and time.- Parameters:
engineID- the engine ID for which time synchronization information is created.engineBoots- the number of engine boots of the engine.engineTime- the time in seconds elapsed since the last reboot of the engine.
-
-
Method Details
-
getEngineID
-
getEngineBoots
public int getEngineBoots() -
setEngineBoots
public void setEngineBoots(int engineBoots) -
getTimeDiff
public int getTimeDiff() -
setTimeDiff
public void setTimeDiff(int timeDiff) -
getLatestReceivedTime
public int getLatestReceivedTime()Gets the time when a message has been received last from the associated SNMP engine.- Returns:
- the engine time in seconds.
-
setLatestReceivedTime
public void setLatestReceivedTime(int latestReceivedTime) Sets the time when a message has been received last from the associated SNMP engine.- Parameters:
latestReceivedTime- the engine time in seconds.
-
setEngineTime
public void setEngineTime(int engineTime) Sets the engine time which also sets the last received engine time to the supplied value.- Parameters:
engineTime- the time in seconds elapsed since the last reboot of the engine.
-
isAuthenticated
public boolean isAuthenticated()Indicates whether this time entry has already been used to check the time window of an authenticated message, that is, whether the associated SNMP engine has proven its existence. Entries that have only been created by engine discovery are placeholders thatUsmTimeTable.checkEngineID(OctetString, boolean, int, int)may evict when the limit of discovered entries is reached.- Returns:
trueif an authenticated message of the associated engine has been processed.- Since:
- 3.13.0
-
setAuthenticated
public void setAuthenticated(boolean authenticated) Marks this time entry as synchronized by an authenticated message. This must only be set by code that has verified the authentication digest of a received message.- Parameters:
authenticated-trueif an authenticated message of the associated engine has been processed.- Since:
- 3.13.0
-
toString
-