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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidReset the consecutive timeout counter to zero.Creates a newAgentXTargetbased on this session.booleanGets the byte order of this session.intGets the number of consecutive timeouts.getPeer()Gets theAgentXPeerassociated with this session.intGets the session ID.byteGets the session timeout in seconds.inthashCode()voidIncrease the consecutive timeout counter by one.booleanisClosed()Checks if the session is closed.voidsetByteOrder(ByteOrder byteOrder) Sets the byte order (must not be modified while session is opened!).voidsetClosed(boolean closed) Sets this session to closed.voidsetPeer(AgentXPeer<A> peer) Sets theAgentXPeer.voidsetSessionID(int sessionID) Sets the session ID.voidsetTimeout(byte timeout) Sets the session timeout.toString()
-
Constructor Details
-
AgentXSession
public AgentXSession(int sessionID) Creates a newAgentXSessionfrom 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 theAgentXPeerassociated 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:
trueif 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-trueif the session should be marked as closed.
-
createAgentXTarget
Creates a newAgentXTargetbased on this session.- Returns:
- a new
AgentXTargetto the session peer.
-
equals
-
hashCode
public int hashCode() -
toString
-