Class SessionService

java.lang.Object
edu.ucsb.nceas.metacat.shared.BaseService
edu.ucsb.nceas.metacat.service.SessionService

public class SessionService extends BaseService
  • Method Details

    • getInstance

      public static SessionService getInstance()
      Get the single instance of SessionService.
      Returns:
      the single instance of SessionService
    • refreshable

      public boolean refreshable()
      Specified by:
      refreshable in class BaseService
    • doRefresh

      public void doRefresh() throws ServiceException
      Specified by:
      doRefresh in class BaseService
      Throws:
      ServiceException
    • stop

      public void stop() throws ServiceException
      Specified by:
      stop in class BaseService
      Throws:
      ServiceException
    • registerSession

      public void registerSession(String sessionId, String userName, String[] groupNames, String password, String name) throws ServiceException
      Register a session in the session hash table. This uses the parameters passed in to create a SessionData object.
      Parameters:
      sessionId - the ID of the session to register
      userName - the user name of the session
      groupNames - the group names for the session
      password - the password for the session
      Throws:
      ServiceException
    • registerSession

      public void registerSession(SessionData sessionData) throws ServiceException
      Register a session in the session hash table.
      Parameters:
      sessionData - the session data object to add to the session hash
      Throws:
      ServiceException
    • unRegisterSession

      public void unRegisterSession(String sessionId)
      Unregister a session from the session hash table.
      Parameters:
      sessionId - the id of the session to remove.
    • unRegisterAllSessions

      public void unRegisterAllSessions()
      Unregister all sessions from the session hash table except the public session.
      Parameters:
      sessionId - the id of the session to remove.
    • isSessionRegistered

      public boolean isSessionRegistered(String sessionId)
      Check if a session is registered in the session hash table.
      Parameters:
      sessionId - the id of the session to look for.
    • validateSession

      public void validateSession(Writer out, javax.servlet.http.HttpServletResponse response, String sessionId) throws IOException
      Check if a session is registered in the session hash table. Write results in XML format to output.
      Parameters:
      out - the output stream to write to.
      sessionId - the id of the session to look for.
      Throws:
      IOException
    • validateSession

      public boolean validateSession(String sessionId)
      Check if a session is registered in the session hash table. Return true if the session is valid and false otherwise.
      Parameters:
      sessionId - the id of the session to look for.
    • getRegisteredSession

      public SessionData getRegisteredSession(String sessionId)
      Get a registered session from the session hash table. TODO MCD need to time sessions out
      Parameters:
      sessionId - the id of the session to retrieve.
    • getPublicSession

      public SessionData getPublicSession()
      Get the public session from the session hash table.
    • touchSession

      public void touchSession(String sessionId)
      Keep a session active by updating its last accessed time.
      Parameters:
      sessionId - the id of the session to update.