Class ContextHolder
- java.lang.Object
-
- org.forgerock.openam.radius.server.spi.handlers.amhandler.ContextHolder
-
public class ContextHolder extends Object
Holds server side info for an authentication conversation in progress for a user via a radius client.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classContextHolder.AuthPhaseIndicates what phase of authentication we are in.
-
Constructor Summary
Constructors Constructor Description ContextHolder(String key)Constructs a ContextHolder with its unique key.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthContextgetAuthContext()get the auth context.ContextHolder.AuthPhasegetAuthPhase()get the auth phase of the context holder.StringgetCacheKey()get the cache key of this context holder.Callback[]getCallbacks()Gets the array of callback objects for the chain.PagePropertiesCallbackgetCallbackSetProps()get the callback set properties.intgetChainModuleIndex()Get the chain module index.intgetIdxOfCallbackSetInModule()gets the index of the callback set in the module.intgetIdxOfCurrentCallback()Get the index of the current callback.LonggetMillisExpiryForCurrentCallbacks()get the number of milliseconds before the current callback expires.LonggetMillisExpiryPoint()gets the point at which the current context holder expires.StringgetModuleName()Gets the name of the module.StringgetUniversalId()Obtain the universal ID from the SSO token held by the auth context.voidincrementChainModuleIndex()Increments the chain module index to indicate that the next module in the chain is currently being processed.voidincrementIdxOfCallbackSetInModule()Increments the index of the callback set in the module.voidincrementIdxOfCurrentCallback()Increment the current callback index.voidsetAuthContext(AuthContext authContext)set the auth context.voidsetAuthPhase(ContextHolder.AuthPhase authPhase)Set the auth phase of the context holder.voidsetCallbacks(Callback[] callbacks)Sets the array ofCallbackobjects for the chain.voidsetCallbackSetProps(PagePropertiesCallback callbackSetProps)Sets the callback properties for the module currently being processed.voidsetIdxOfCallbackSetInModule(int idxOfCallbackSetInModule)Set the index of the callback set in the module.voidsetIdxOfCurrentCallback(int idxOfCurrentCallback)set the current callback index.voidsetMillisExpiryForCurrentCallbacks(Long millisExpiryForCurrentCallbacks)Sets the period in milliseconds until the current callback expire.voidsetMillisExpiryPoint(Long millisExpiryPoint)Sets the point at which the current context holder expires.voidsetModuleName(String moduleName)Sets the name of the module currently being processed.
-
-
-
Constructor Detail
-
ContextHolder
public ContextHolder(String key)
Constructs a ContextHolder with its unique key.- Parameters:
key- the unique cache key for the context holder
-
-
Method Detail
-
getCallbackSetProps
public PagePropertiesCallback getCallbackSetProps()
get the callback set properties.- Returns:
- the callback properties for the current module.
-
setCallbackSetProps
public void setCallbackSetProps(PagePropertiesCallback callbackSetProps)
Sets the callback properties for the module currently being processed.- Parameters:
callbackSetProps- - aPagePropertiesCallbackreference.
-
getModuleName
public String getModuleName()
Gets the name of the module.- Returns:
- the name of the module currently being processed, or null if no module is being processed.
-
setModuleName
public void setModuleName(String moduleName)
Sets the name of the module currently being processed.- Parameters:
moduleName- - a non null string containing the name of the module.
-
incrementChainModuleIndex
public void incrementChainModuleIndex()
Increments the chain module index to indicate that the next module in the chain is currently being processed.
-
getChainModuleIndex
public int getChainModuleIndex()
Get the chain module index.- Returns:
- The zero based index of the current module in the chain for whom we are gathering values from the user. -1 indicates that there is no module set. This is so that we can centralize updating this info set without regard to whether we are handling the first set or following sets.
-
getCallbacks
public Callback[] getCallbacks()
Gets the array of callback objects for the chain.- Returns:
- an array of
Callbackobjects.
-
setCallbacks
public void setCallbacks(Callback[] callbacks)
Sets the array ofCallbackobjects for the chain.- Parameters:
callbacks- an array ofCallbackobjects.
-
getIdxOfCurrentCallback
public int getIdxOfCurrentCallback()
Get the index of the current callback.- Returns:
- the index of the current callback.
-
setIdxOfCurrentCallback
public void setIdxOfCurrentCallback(int idxOfCurrentCallback)
set the current callback index.- Parameters:
idxOfCurrentCallback- The index of the current callback.
-
incrementIdxOfCurrentCallback
public void incrementIdxOfCurrentCallback()
Increment the current callback index.
-
getIdxOfCallbackSetInModule
public int getIdxOfCallbackSetInModule()
gets the index of the callback set in the module.- Returns:
- the index of the callback set in the module.
-
setIdxOfCallbackSetInModule
public void setIdxOfCallbackSetInModule(int idxOfCallbackSetInModule)
Set the index of the callback set in the module.- Parameters:
idxOfCallbackSetInModule- the index of the callback set in the module.
-
incrementIdxOfCallbackSetInModule
public void incrementIdxOfCallbackSetInModule()
Increments the index of the callback set in the module.
-
getAuthContext
public AuthContext getAuthContext()
get the auth context.- Returns:
- a
AuthContextobject.
-
setAuthContext
public void setAuthContext(AuthContext authContext)
set the auth context.- Parameters:
authContext- aAuthContextobject
-
getMillisExpiryForCurrentCallbacks
public Long getMillisExpiryForCurrentCallbacks()
get the number of milliseconds before the current callback expires.- Returns:
- a
Longrepresenting the number of milliseconds until the current callback expires.
-
setMillisExpiryForCurrentCallbacks
public void setMillisExpiryForCurrentCallbacks(Long millisExpiryForCurrentCallbacks)
Sets the period in milliseconds until the current callback expire.- Parameters:
millisExpiryForCurrentCallbacks- aLongrepresenting the number of milliseconds until the current callback expires.
-
getMillisExpiryPoint
public Long getMillisExpiryPoint()
gets the point at which the current context holder expires.- Returns:
- the difference, measured in milliseconds, between the context holder's expiry time and midnight, January 1, 1970
-
setMillisExpiryPoint
public void setMillisExpiryPoint(Long millisExpiryPoint)
Sets the point at which the current context holder expires.- Parameters:
millisExpiryPoint- the difference, measured in milliseconds, between the context holder's expiry time and midnight, January 1, 1970
-
getCacheKey
public String getCacheKey()
get the cache key of this context holder.- Returns:
- a
Stringobject containing the key for the context holder.
-
getAuthPhase
public ContextHolder.AuthPhase getAuthPhase()
get the auth phase of the context holder.- Returns:
- an
AuthPhaseobject.
-
setAuthPhase
public void setAuthPhase(ContextHolder.AuthPhase authPhase)
Set the auth phase of the context holder.- Parameters:
authPhase- anAuthPhaseobject.
-
getUniversalId
public String getUniversalId()
Obtain the universal ID from the SSO token held by the auth context. If there is no SSO token available or there is no universal id available then null will be returned.- Returns:
- the universalId, or null if none is available.
-
-