- java.lang.Object
-
- org.snmp4j.security.UsmTimeTable
-
- All Implemented Interfaces:
java.io.Serializable
public class UsmTimeTable extends java.lang.Object implements java.io.Serializable
TheUsmTimeTable
class is a singleton that stores USM user information as part of the Local Configuration Datastore (LCD).- Version:
- 1.2
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private long
lastLocalTimeChange
private UsmTimeEntry
localTime
private static LogAdapter
logger
private static long
serialVersionUID
private java.util.Hashtable<Variable,UsmTimeEntry>
table
(package private) static long
TIME_PRECISION
static int
USM_MAX_TIME_DIFFERENCE_HUNDREDS
-
Constructor Summary
Constructors Constructor Description UsmTimeTable(OctetString localEngineID, int engineBoots)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEntry(UsmTimeEntry entry)
int
checkEngineID(OctetString engineID, boolean discoveryAllowed, int engineBoots, int engineTime)
int
checkTime(UsmTimeEntry entry)
int
getEngineBoots()
The number of times that the SNMP engine has (re-)initialized itself since snmpEngineID was last configured.int
getEngineTime()
Returns the number of seconds since the value of the engineBoots object last changed.UsmTimeEntry
getEntry(OctetString engineID)
UsmTimeEntry
getLocalTime()
UsmTimeEntry
getTime(OctetString engineID)
void
removeEntry(OctetString engineID)
Removes the specified engine ID from the time cache.void
reset()
void
setEngineBoots(int engineBoots)
Sets the number of engine boots.void
setLocalTime(UsmTimeEntry localTime)
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
logger
private static final LogAdapter logger
-
TIME_PRECISION
static final long TIME_PRECISION
- See Also:
- Constant Field Values
-
USM_MAX_TIME_DIFFERENCE_HUNDREDS
public static final int USM_MAX_TIME_DIFFERENCE_HUNDREDS
- See Also:
- Constant Field Values
-
table
private java.util.Hashtable<Variable,UsmTimeEntry> table
-
lastLocalTimeChange
private long lastLocalTimeChange
-
localTime
private UsmTimeEntry localTime
-
-
Constructor Detail
-
UsmTimeTable
public UsmTimeTable(OctetString localEngineID, int engineBoots)
-
-
Method Detail
-
addEntry
public void addEntry(UsmTimeEntry entry)
-
getEntry
public UsmTimeEntry getEntry(OctetString engineID)
-
getLocalTime
public UsmTimeEntry getLocalTime()
-
setLocalTime
public void setLocalTime(UsmTimeEntry localTime)
-
setEngineBoots
public void setEngineBoots(int engineBoots)
Sets the number of engine boots.- Parameters:
engineBoots
- the number of engine boots.- Since:
- 1.2
-
getEngineTime
public int getEngineTime()
Returns the number of seconds since the value of the engineBoots object last changed. When incrementing this object's value would cause it to exceed its maximum, engineBoots is incremented as if a re-initialization had occurred, and this object's value consequently reverts to zero.- Returns:
- a positive integer value denoting the number of seconds since the engineBoots value has been changed.
- Since:
- 1.2
-
getEngineBoots
public int getEngineBoots()
The number of times that the SNMP engine has (re-)initialized itself since snmpEngineID was last configured.- Returns:
- the number of SNMP engine reboots.
-
getTime
public UsmTimeEntry getTime(OctetString engineID)
-
removeEntry
public void removeEntry(OctetString engineID)
Removes the specified engine ID from the time cache.- Parameters:
engineID
- the engine ID of the remote SNMP engine to remove from this time cache.
-
checkEngineID
public int checkEngineID(OctetString engineID, boolean discoveryAllowed, int engineBoots, int engineTime)
-
checkTime
public int checkTime(UsmTimeEntry entry)
-
reset
public void reset()
-
-