public abstract class ExternalizableSecurityCheck extends java.lang.Object implements SecurityCheck
inactivityTimeoutSec
Implementation of ExternalizableSecurityCheck.getExpiresAt()
via state management mechanism that includes
ExternalizableSecurityCheck.initStateDurations(Map)
, ExternalizableSecurityCheck.setState(String)
, and ExternalizableSecurityCheck.getState()
Empty implementation of the ExternalizableSecurityCheck.logout()
method
Modifier and Type | Field and Description |
---|---|
protected AuthorizationContext |
authorizationContext |
protected ExternalizableSecurityCheckConfig |
config |
protected RegistrationContext |
registrationContext |
protected static java.lang.String |
STATE_EXPIRED
Predefined state name that means the security check is expired and its state will not be preserved.
|
Constructor and Description |
---|
ExternalizableSecurityCheck() |
Modifier and Type | Method and Description |
---|---|
SecurityCheckConfiguration |
createConfiguration(java.util.Properties properties)
Create configuration object and populate fields from the given properties.
|
protected ExternalizableSecurityCheckConfig |
getConfiguration() |
long |
getExpiresAt()
Calculates the expiration for the current state set via
ExternalizableSecurityCheck.setState(String) based on state durations
returned by ExternalizableSecurityCheck.initStateDurations(Map) If the current state is ExternalizableSecurityCheck.STATE_EXPIRED , this method returns 0 |
int |
getInactivityTimeoutSec()
Get the security check inactivity timeout, usually the configured value.
|
protected java.lang.String |
getName() |
java.lang.String |
getState()
Get the current state set via method
ExternalizableSecurityCheck.setState(String) |
protected abstract void |
initStateDurations(java.util.Map durations)
Put the state names supported by this security check and their durations in seconds into the input map.
Implementations may use ExternalizableSecurityCheck.getConfiguration() method to access configured values. |
void |
logout()
Called upon explicit logout from this security check.
|
void |
readExternal(java.io.ObjectInput in) |
void |
setContext(java.lang.String name,
SecurityCheckConfiguration config,
AuthorizationContext authorizationContext,
RegistrationContext registrationContext)
Initialize the security check with the context and configuration properties.
|
protected void |
setState(java.lang.String name)
Set the given state and mark the time.
If the state is already set to the given value, no change is done. |
void |
writeExternal(java.io.ObjectOutput out) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
authorize, introspect
protected static final java.lang.String STATE_EXPIRED
protected transient ExternalizableSecurityCheckConfig config
protected transient AuthorizationContext authorizationContext
protected transient RegistrationContext registrationContext
public SecurityCheckConfiguration createConfiguration(java.util.Properties properties)
SecurityCheck
createConfiguration
in interface SecurityCheck
properties
- the merged properties to read and validatepublic long getExpiresAt()
ExternalizableSecurityCheck.setState(String)
based on state durations
returned by ExternalizableSecurityCheck.initStateDurations(Map)
ExternalizableSecurityCheck.STATE_EXPIRED
, this method returns 0getExpiresAt
in interface SecurityCheck
public int getInactivityTimeoutSec()
SecurityCheck
getInactivityTimeoutSec
in interface SecurityCheck
public void setContext(java.lang.String name, SecurityCheckConfiguration config, AuthorizationContext authorizationContext, RegistrationContext registrationContext)
SecurityCheck
setContext
in interface SecurityCheck
name
- name of the security checkconfig
- security check configuration created by SecurityCheck.createConfiguration(Properties)
authorizationContext
- provides access to the transient state of the calling clientregistrationContext
- provides access to the persistent state of the calling clientpublic void logout()
SecurityCheck
logout
in interface SecurityCheck
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
protected ExternalizableSecurityCheckConfig getConfiguration()
protected java.lang.String getName()
protected void setState(java.lang.String name)
name
- the name of the state, must be one of those defined by ExternalizableSecurityCheck.initStateDurations(Map)
, or ExternalizableSecurityCheck.STATE_EXPIRED
ExternalizableSecurityCheck.getExpiresAt()
public java.lang.String getState()
ExternalizableSecurityCheck.setState(String)
protected abstract void initStateDurations(java.util.Map durations)
ExternalizableSecurityCheck.getConfiguration()
method to access configured values.
The state ExternalizableSecurityCheck.STATE_EXPIRED
is predefined, and should not be put into the map.durations
- map with the state names as keys and their durations in seconds as values
© Copyright IBM Corp. 2006, 2015. All Rights Reserved.