com.force.sdk.oauth.context.store
Interface SecurityContextStorageService

All Known Implementing Classes:
SecurityContextCookieStore, SecurityContextSessionStore

public interface SecurityContextStorageService

Defines the interface for storing, retrieving, and clearing a SecurityContext to/from a storage service. Implementors of this interface will represent different methods of handling the storage of a SecurityContext.

Author:
John Simone

Method Summary
 void clearSecurityContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Clears the security context from storage.
 SecretKeySpec getSecureKey()
          Retrieves the secret key if one is used in this security context store.
 boolean isContextStored(javax.servlet.http.HttpServletRequest request)
          Detects whether or not there is a security context stored via this storage method.
 SecurityContext retreiveSecurityContext(javax.servlet.http.HttpServletRequest request)
          Retrieves the security context.
 void storeSecurityContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, SecurityContext securityContext)
          Stores the security context.
 

Method Detail

storeSecurityContext

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

Parameters:
request - HttpServletRequest
response - HttpServletResponse
securityContext - SecurityContext
Throws:
ContextStoreException - ContextStoreException

retreiveSecurityContext

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

Parameters:
request - HttpServletRequest
Returns:
the stored SecurityContext
Throws:
ContextStoreException - ContextStoreException

clearSecurityContext

void clearSecurityContext(javax.servlet.http.HttpServletRequest request,
                          javax.servlet.http.HttpServletResponse response)
Clears the security context from storage. This won't be relevant for all storage types.

Parameters:
request - HttpServletRequest
response - HttpServletResponse

getSecureKey

SecretKeySpec getSecureKey()
                           throws ForceEncryptionException
Retrieves the secret key if one is used in this security context store.

Returns:
SecretKeySpec
Throws:
ForceEncryptionException - ForceEncryptionException

isContextStored

boolean isContextStored(javax.servlet.http.HttpServletRequest request)
Detects whether or not there is a security context stored via this storage method.

Parameters:
request - HttpServletRequest
Returns:
whether or not the security context is stored using this storage method


Copyright © 2012. All Rights Reserved.