Class SessionManager
java.lang.Object
org.metricshub.ipmi.core.connection.SessionManager
Manages multiple
Sessions.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SessionestablishSession(IpmiConnector connector, String remoteHost, int remotePort, String user, String password, CipherSuiteSelectionHandler cipherSuiteSelectionHandler) static intThe session ID generated by theSessionManager.getSessionForCriteria(InetAddress remoteAddress, int remotePort, String user) Returns session already bound to given connection handle fulfilling given criteria.registerSession(int sessionId, ConnectionHandle connectionHandle) voidunregisterSession(ConnectionHandle connectionHandle) Unregisters session for given connection handle.
-
Constructor Details
-
SessionManager
public SessionManager()
-
-
Method Details
-
generateSessionId
public static int generateSessionId()The session ID generated by theSessionManager. Auto-incremented. -
establishSession
public static Session establishSession(IpmiConnector connector, String remoteHost, int remotePort, String user, String password, CipherSuiteSelectionHandler cipherSuiteSelectionHandler) throws SessionException - Throws:
SessionException
-
registerSession
Either returns theSessionregistered for given connection, or creates new IPMISessionand registers it for the given connection handle, if no session was found for the connection.- Parameters:
connectionHandle- handle of the connection, for which this session should be registered.- Returns:
- newly created session object or session already registered for the connection
-
unregisterSession
Unregisters session for given connection handle.- Parameters:
connectionHandle- handle of the connection, for which the session should be unregistered.
-
getSessionForCriteria
Returns session already bound to given connection handle fulfilling given criteria.- Parameters:
remoteAddress- IP addres of the managed systemremotePort- UDP port of the managed systemuser- IPMI user for whom the connection is established- Returns:
- session object fulfilling given criteria, or null if no session was registered for such connection.
-