Class SessionManager

java.lang.Object
org.metricshub.ipmi.core.connection.SessionManager

public class SessionManager extends Object
Manages multiple Sessions.
  • Constructor Details

    • SessionManager

      public SessionManager()
  • Method Details

    • generateSessionId

      public static int generateSessionId()
      The session ID generated by the SessionManager. Auto-incremented.
    • establishSession

      public static Session establishSession(IpmiConnector connector, String remoteHost, int remotePort, String user, String password, CipherSuiteSelectionHandler cipherSuiteSelectionHandler) throws SessionException
      Throws:
      SessionException
    • registerSession

      public Session registerSession(int sessionId, ConnectionHandle connectionHandle)
      Either returns the Session registered for given connection, or creates new IPMI Session and 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

      public void unregisterSession(ConnectionHandle connectionHandle)
      Unregisters session for given connection handle.
      Parameters:
      connectionHandle - handle of the connection, for which the session should be unregistered.
    • getSessionForCriteria

      public Session getSessionForCriteria(InetAddress remoteAddress, int remotePort, String user)
      Returns session already bound to given connection handle fulfilling given criteria.
      Parameters:
      remoteAddress - IP addres of the managed system
      remotePort - UDP port of the managed system
      user - IPMI user for whom the connection is established
      Returns:
      session object fulfilling given criteria, or null if no session was registered for such connection.