AgentX++  2.0.5
Public Member Functions | Protected Attributes | List of all members
AgentXSessions Class Reference

#include <agentx_session.h>

Inheritance diagram for AgentXSessions:

Public Member Functions

 AgentXSessions ()
 
virtual ~AgentXSessions ()
 
virtual bool get_session (u_int, AgentXSession &)
 Get the session with a given id.
 
virtual AgentXSessionget_session (u_int)
 Get the session with a given id.
 
virtual AgentXSessionremove (u_int)
 Remove a session.
 
virtual u_int make_new_session (bool, u_char, const Oidx &, const NS_SNMP OctetStr &, const AgentXPeer &)
 Make a new session.
 
ListCursor< AgentXSessionget_sessions ()
 Return a ListCursor located at the first session.
 
void clear ()
 Clear all sessions.
 
virtual void remove (const AgentXPeer &)
 Remove all sessions associated with a given peer.
 
List< AgentXSession > * remove_sessions_of_peer (const AgentXPeer &)
 Return a list of all sessions associated with a given peer and remove these sessions.
 
List< AgentXSession > * get_sessions_of_peer (const AgentXPeer &)
 Return a list of all sessions associated with a given peer.
 

Protected Attributes

u_int lastSessionID
 
List< AgentXSessionsessions
 

Constructor & Destructor Documentation

AgentXSessions::AgentXSessions ( )
virtual AgentXSessions::~AgentXSessions ( )
virtual

Member Function Documentation

void AgentXSessions::clear ( )
inline

Clear all sessions.

virtual bool AgentXSessions::get_session ( u_int  ,
AgentXSession  
)
virtual

Get the session with a given id.

(SYNCHRONIZED)

Parameters
sessionIDa session id.
sessioncontains the session attributes of the requested session if TRUE is returned and is unchanged if FALSE is returned.
Returns
TRUE if such a session could be found, FALSE otherwise.
virtual AgentXSession* AgentXSessions::get_session ( u_int  )
virtual

Get the session with a given id.

(NOT SYNCHRONIZED)

Parameters
sessionIDa session id.
Returns
a pointer to the requested session or 0 if such an id does not exist.
ListCursor<AgentXSession> AgentXSessions::get_sessions ( )
inline

Return a ListCursor located at the first session.

Returns
a ListCursor instance.
List<AgentXSession>* AgentXSessions::get_sessions_of_peer ( const AgentXPeer )

Return a list of all sessions associated with a given peer.

NOTE: Befor calling the destructor of the returned list call its clear() method!

(NOT SYNCHRONIZED)

Parameters
peera AgentXPeer.
Returns
a pointer to a List instance.
virtual u_int AgentXSessions::make_new_session ( bool  ,
u_char  ,
const Oidx &  ,
const NS_SNMP OctetStr &  ,
const AgentXPeer  
)
virtual

Make a new session.

Parameters
byteOrderthe byte order used for the new session (TRUE==networkByteOrder).
timeoutthe timeout of used by the new session.
idan object id.
descran OctetStr instance.
peerthe AgentX subagent initiating this session.
Returns
the session id of the new session.
virtual AgentXSession* AgentXSessions::remove ( u_int  )
virtual

Remove a session.

(SYNCHRONIZED)

Parameters
sessionIDthe session id of the session to remove.
Returns
the pointer of the session if it could be removed successfully or 0 if not.
virtual void AgentXSessions::remove ( const AgentXPeer )
virtual

Remove all sessions associated with a given peer.

(SYNCHRONIZED)

Parameters
peera AgentXPeer.
List<AgentXSession>* AgentXSessions::remove_sessions_of_peer ( const AgentXPeer )

Return a list of all sessions associated with a given peer and remove these sessions.

(SYNCHRONIZED)

Parameters
peera AgentXPeer.
Returns
a pointer to a List instance which must be deleted (including the contained sessions) by the receiver.
Since
1.3.2

Member Data Documentation

u_int AgentXSessions::lastSessionID
protected
List<AgentXSession> AgentXSessions::sessions
protected

The documentation for this class was generated from the following file: