com.force.sdk.oauth.context.store
Class SecurityContextSessionStore

java.lang.Object
  extended by com.force.sdk.oauth.context.store.SecurityContextSessionStore
All Implemented Interfaces:
SecurityContextStorageService

public class SecurityContextSessionStore
extends Object
implements SecurityContextStorageService

Handles the storage of a SecurityContext via server side session.

Author:
John Simone

Field Summary
static String SECURITY_CONTEXT_SESSION_KEY
          The key used to store the SecurityContext in the session.
 
Constructor Summary
SecurityContextSessionStore()
           
 
Method Summary
 void clearSecurityContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This does nothing when server side sessions are being used for SecurityContext storage.
 SecretKeySpec getSecureKey()
          Retrieves the secret key if one is used in this security context store.
 SecurityContext retreiveSecurityContext(javax.servlet.http.HttpServletRequest request)
          Retrieve the security context from the session.
 void storeSecurityContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, SecurityContext securityContext)
          Store the security context to the session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SECURITY_CONTEXT_SESSION_KEY

public static final String SECURITY_CONTEXT_SESSION_KEY
The key used to store the SecurityContext in the session.

See Also:
Constant Field Values
Constructor Detail

SecurityContextSessionStore

public SecurityContextSessionStore()
Method Detail

storeSecurityContext

public void storeSecurityContext(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response,
                                 SecurityContext securityContext)
                          throws ContextStoreException
Store the security context to the session. Store the security context. The means of storage will vary by implementation.

Specified by:
storeSecurityContext in interface SecurityContextStorageService
Parameters:
request - HttpServletRequest
response - HttpServletResponse
securityContext - SecurityContext
Throws:
ContextStoreException - ContextStoreException

retreiveSecurityContext

public SecurityContext retreiveSecurityContext(javax.servlet.http.HttpServletRequest request)
                                        throws ContextStoreException
Retrieve the security context from the session. Retrieve the security context. The means of storage will vary by implementation.

Specified by:
retreiveSecurityContext in interface SecurityContextStorageService
Parameters:
request - HttpServletRequest
Returns:
the stored SecurityContext
Throws:
ContextStoreException - ContextStoreException

clearSecurityContext

public void clearSecurityContext(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response)
This does nothing when server side sessions are being used for SecurityContext storage. Clears the security context from storage. This won't be relevant for all storage types.

Specified by:
clearSecurityContext in interface SecurityContextStorageService
Parameters:
request - HttpServletRequest
response - HttpServletResponse

getSecureKey

public SecretKeySpec getSecureKey()
Description copied from interface: SecurityContextStorageService
Retrieves the secret key if one is used in this security context store.

Specified by:
getSecureKey in interface SecurityContextStorageService
Returns:
SecretKeySpec


Copyright © 2011. All Rights Reserved.