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

public class AgentXSession<A extends org.snmp4j.smi.Address> extends Object implements Serializable
The AgentXSession class represents an AgentX session.
See Also:
  • Constructor Details

    • AgentXSession

      public AgentXSession(int sessionID)
      Creates a new AgentXSession from a session ID.
      Parameters:
      sessionID - a unique session ID.
  • Method Details

    • getByteOrder

      public ByteOrder getByteOrder()
      Gets the byte order of this session.
      Returns:
      the byte order.
    • getPeer

      public AgentXPeer<A> getPeer()
      Gets the AgentXPeer 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

      public void setByteOrder(ByteOrder byteOrder)
      Sets the byte order (must not be modified while session is opened!).
      Parameters:
      byteOrder - a byte order.
    • setPeer

      public void setPeer(AgentXPeer<A> peer)
      Sets the AgentXPeer.
      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

      public AgentXTarget<A> createAgentXTarget()
      Creates a new AgentXTarget based on this session.
      Returns:
      a new AgentXTarget to the session peer.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object