Package edu.ucsb.nceas.metacat.service
Class SessionService
java.lang.Object
edu.ucsb.nceas.metacat.shared.BaseService
edu.ucsb.nceas.metacat.service.SessionService
-
Field Summary
Fields inherited from class edu.ucsb.nceas.metacat.shared.BaseService
_serviceName
-
Method Summary
Modifier and TypeMethodDescriptionvoid
static SessionService
Get the single instance of SessionService.Get the public session from the session hash table.getRegisteredSession
(String sessionId) Get a registered session from the session hash table.boolean
isSessionRegistered
(String sessionId) Check if a session is registered in the session hash table.boolean
void
registerSession
(SessionData sessionData) Register a session in the session hash table.void
registerSession
(String sessionId, String userName, String[] groupNames, String password, String name) Register a session in the session hash table.void
stop()
void
touchSession
(String sessionId) Keep a session active by updating its last accessed time.void
Unregister all sessions from the session hash table except the public session.void
unRegisterSession
(String sessionId) Unregister a session from the session hash table.void
validateSession
(Writer out, javax.servlet.http.HttpServletResponse response, String sessionId) Check if a session is registered in the session hash table.boolean
validateSession
(String sessionId) Check if a session is registered in the session hash table.Methods inherited from class edu.ucsb.nceas.metacat.shared.BaseService
refresh
-
Method Details
-
getInstance
Get the single instance of SessionService.- Returns:
- the single instance of SessionService
-
refreshable
public boolean refreshable()- Specified by:
refreshable
in classBaseService
-
doRefresh
- Specified by:
doRefresh
in classBaseService
- Throws:
ServiceException
-
stop
- Specified by:
stop
in classBaseService
- 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 registeruserName
- the user name of the sessiongroupNames
- the group names for the sessionpassword
- the password for the session- Throws:
ServiceException
-
registerSession
Register a session in the session hash table.- Parameters:
sessionData
- the session data object to add to the session hash- Throws:
ServiceException
-
unRegisterSession
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
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
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
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
Get the public session from the session hash table. -
touchSession
Keep a session active by updating its last accessed time.- Parameters:
sessionId
- the id of the session to update.
-