Package org.snmp4j.agent.agentx
Class AgentXSession<A extends org.snmp4j.smi.Address>
java.lang.Object
org.snmp4j.agent.agentx.AgentXSession<A>
- Type Parameters:
A
- the address type of the associated AgentX connection.
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AgentXMasterSession
The
AgentXSession
class represents an AgentX session.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Reset the consecutive timeout counter to zero.Creates a newAgentXTarget
based on this session.boolean
Gets the byte order of this session.int
Gets the number of consecutive timeouts.getPeer()
Gets theAgentXPeer
associated with this session.int
Gets the session ID.byte
Gets the session timeout in seconds.int
hashCode()
void
Increase the consecutive timeout counter by one.boolean
isClosed()
Checks if the session is closed.void
setByteOrder
(ByteOrder byteOrder) Sets the byte order (must not be modified while session is opened!).void
setClosed
(boolean closed) Sets this session to closed.void
setPeer
(AgentXPeer<A> peer) Sets theAgentXPeer
.void
setSessionID
(int sessionID) Sets the session ID.void
setTimeout
(byte timeout) Sets the session timeout.toString()
-
Constructor Details
-
AgentXSession
public AgentXSession(int sessionID) Creates a newAgentXSession
from a session ID.- Parameters:
sessionID
- a unique session ID.
-
-
Method Details
-
getByteOrder
Gets the byte order of this session.- Returns:
- the byte order.
-
getPeer
Gets theAgentXPeer
associated with this session.- Returns:
- an
AgentXPeer
.
-
getSessionID
public int getSessionID()Gets the session ID.- Returns:
- the session ID.
-
getTimeout
public byte getTimeout()Gets the session timeout in seconds.- Returns:
- the timeout in sec.
-
clearConsecutiveTimeouts
public void clearConsecutiveTimeouts()Reset the consecutive timeout counter to zero. -
incConsecutiveTimeouts
public void incConsecutiveTimeouts()Increase the consecutive timeout counter by one. -
getConsecutiveTimeouts
public int getConsecutiveTimeouts()Gets the number of consecutive timeouts.- Returns:
- the timeouts count.
-
isClosed
public boolean isClosed()Checks if the session is closed.- Returns:
true
if the session is closed.
-
setByteOrder
Sets the byte order (must not be modified while session is opened!).- Parameters:
byteOrder
- a byte order.
-
setPeer
Sets theAgentXPeer
.- Parameters:
peer
- the AgentX peer associated with this session.
-
setSessionID
public void setSessionID(int sessionID) Sets the session ID.- Parameters:
sessionID
- a session ID.
-
setTimeout
public void setTimeout(byte timeout) Sets the session timeout.- Parameters:
timeout
- a session timeout in seconds.
-
setClosed
public void setClosed(boolean closed) Sets this session to closed.- Parameters:
closed
-true
if the session should be marked as closed.
-
createAgentXTarget
Creates a newAgentXTarget
based on this session.- Returns:
- a new
AgentXTarget
to the session peer.
-
equals
-
hashCode
public int hashCode() -
toString
-