com.force.sdk.oauth.context
Class ForceSecurityContextHolder

java.lang.Object
  extended by com.force.sdk.oauth.context.ForceSecurityContextHolder

public final class ForceSecurityContextHolder
extends Object

Provides a mechanism to access the SecurityContext for the authenticated user. Security conexts are stored in thread local variables and managed by the ForceThreadLocalStore.

Author:
Fiaz Hossain

Method Summary
static SecurityContext get()
          Get the security context that is stored in the thread local store.
static SecurityContext get(boolean createIfNeeded)
          Get the security context that is stored in the thread local store.
static void release()
          release the current security context from the thread local store.
static void set(SecurityContext sc)
          Set the security context to the thread local store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static SecurityContext get()
Get the security context that is stored in the thread local store. Do not create one if it doesn't exist.

Returns:
the current security context

get

public static SecurityContext get(boolean createIfNeeded)
Get the security context that is stored in the thread local store.

Parameters:
createIfNeeded - Create the security context if there currently isn't one
Returns:
the current security context

set

public static void set(SecurityContext sc)
Set the security context to the thread local store.

Parameters:
sc - SecurityContext

release

public static void release()
release the current security context from the thread local store.



Copyright © 2011. All Rights Reserved.