com.sap.netweaver.bc.rf.common.context

Class AccessContext

java.lang.Object
  extended by com.sap.netweaver.bc.rf.common.context.AccessContext
All Implemented Interfaces:
IAccessContext, Serializable

public class AccessContext
extends Object
implements IAccessContext, Serializable

Class implementing the access context information the system needs to know, when working on resources.

See Also:
Serialized Form

Field Summary
protected  long allowedStaleDataTimespan
          Time the repository data may not be older than.
protected  String clientId
          Current client identity operating on the resouce.
static long DEFAULT_ALLOWED_STALE_DATA_TIMESPAN
           
protected  Locale locale
          Locale of current user operating on the resouce.
protected  Map properties
          Client defined property map.
 Object transformedResourceContext
          Used for an optimization in ContextTransformer class.
protected  com.sap.security.api.IUser user
          Current user operating on the resouce.
protected  Map variantContext
           
 
Fields inherited from interface com.sap.netweaver.bc.rf.common.context.IAccessContext
TRANSPORT_EXPORT, TRANSPORT_IMPORT
 
Constructor Summary
AccessContext(String clientId, com.sap.security.api.IUser user, Locale locale, long allowedStaleDataTimespan)
          Construct instance just with the current user and a locale to be used.
AccessContext(String clientId, com.sap.security.api.IUser user, Locale locale, Map properties, long allowedStaleDataTimespan)
          Construct instance with the current user, a locale to be used and client defined properties.
AccessContext(String clientId, com.sap.security.api.IUser user, Locale locale, Map properties, Map variantContext, long allowedStaleDataTimespan)
          Construct instance with the current user, a locale to be used and client defined properties.
AccessContext(String clientId, com.sap.security.api.IUser user, Locale locale, Map properties, Map variantContext, long allowedStaleDataTimespan, String tuccID)
          Construct instance with the current user, a locale to be used and client defined properties.
AccessContext(String clientId, com.sap.security.api.IUser user, long allowedStaleDataTimespan)
          Construct instance just with the current user.
AccessContext(String clientId, com.sap.security.api.IUser user, Map properties, long allowedStaleDataTimespan)
          Construct instance just with the current user and client defined properties.
 
Method Summary
 IAccessContext cloneContext()
          Clone access context.
 long getAllowedStaleDataTimespan()
          Get time the repository data may not be older than.
 Map getClientDefinedProperties()
          Returns a map containing all client defined properties
 Object getClientDefinedProperty(String name)
          Get a client defined property from the context.
 String getClientId()
          Get id of the current client operating on the resouce.
 Locale getLocale()
          Get locale of the current user.
 String getTuccId()
          Returns the TUCC transaction identifier - can be null.
 com.sap.security.api.IUser getUser()
          Get current user operating on the resouce.
 Map getVariantContext()
          Returns a map of context properties used for variant handling - may be null.
 void setAllowedStaleDataTimespan(long allowedStaleDataTimespan)
          Set time the repository data may not be older than.
 void setClientDefinedProperty(String name, Object value)
          Set a client defined property in the context.
 void setClientId(String clientId)
          Set id of the current client operating on the resouce.
 void setLocale(Locale locale)
          Set locale of the current user.
 void setUser(com.sap.security.api.IUser user)
          Set current user operating on the resouce.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ALLOWED_STALE_DATA_TIMESPAN

public static long DEFAULT_ALLOWED_STALE_DATA_TIMESPAN

clientId

protected transient String clientId
Current client identity operating on the resouce.


user

protected transient com.sap.security.api.IUser user
Current user operating on the resouce.


locale

protected Locale locale
Locale of current user operating on the resouce.


allowedStaleDataTimespan

protected long allowedStaleDataTimespan
Time the repository data may not be older than.


properties

protected Map properties
Client defined property map.


variantContext

protected Map variantContext

transformedResourceContext

public Object transformedResourceContext
Used for an optimization in ContextTransformer class.

Constructor Detail

AccessContext

public AccessContext(String clientId,
                     com.sap.security.api.IUser user,
                     long allowedStaleDataTimespan)
Construct instance just with the current user.

Parameters:
clientId - id of the current client operating on the resouce
user - current user operating on the resouce
allowedStaleDataTimespan - time the repository data may not be older than

AccessContext

public AccessContext(String clientId,
                     com.sap.security.api.IUser user,
                     Map properties,
                     long allowedStaleDataTimespan)
Construct instance just with the current user and client defined properties. In case of no user, the anoymous user will be created.

Parameters:
clientId - id of the current client operating on the resouce
user - current user operating on the resouce
allowedStaleDataTimespan - time the repository data may not be older than
properties - initial client defined properties to be used or null for no client defined properties

AccessContext

public AccessContext(String clientId,
                     com.sap.security.api.IUser user,
                     Locale locale,
                     long allowedStaleDataTimespan)
Construct instance just with the current user and a locale to be used. In case of no user, the anoymous user will be created.

Parameters:
clientId - id of the current client operating on the resouce
user - current user operating on the resouce
locale - locale to be associated or null to use user resp. default locale
allowedStaleDataTimespan - time the repository data may not be older than

AccessContext

public AccessContext(String clientId,
                     com.sap.security.api.IUser user,
                     Locale locale,
                     Map properties,
                     Map variantContext,
                     long allowedStaleDataTimespan)
Construct instance with the current user, a locale to be used and client defined properties. In case of no user, the anoymous user will be created.

Parameters:
clientId - id of the current client operating on the resouce
user - current user operating on the resouce
locale - locale to be associated or null to use user resp. default locale
properties - initial client defined properties to be used or null for no client defined properties
variantContext - A map with context properties used for variant handling.
allowedStaleDataTimespan - time the repository data may not be older than

AccessContext

public AccessContext(String clientId,
                     com.sap.security.api.IUser user,
                     Locale locale,
                     Map properties,
                     Map variantContext,
                     long allowedStaleDataTimespan,
                     String tuccID)
Construct instance with the current user, a locale to be used and client defined properties. In case of no user, the anoymous user will be created.

Parameters:
clientId - id of the current client operating on the resouce
user - current user operating on the resouce
locale - locale to be associated or null to use user resp. default locale
properties - initial client defined properties to be used or null for no client defined properties
variantContext - A map with context properties used for variant handling.
allowedStaleDataTimespan - time the repository data may not be older than

AccessContext

public AccessContext(String clientId,
                     com.sap.security.api.IUser user,
                     Locale locale,
                     Map properties,
                     long allowedStaleDataTimespan)
Construct instance with the current user, a locale to be used and client defined properties. In case of no user, the anoymous user will be created.

Parameters:
clientId - id of the current client operating on the resouce
user - current user operating on the resouce
locale - locale to be associated or null to use user resp. default locale
properties - initial client defined properties to be used or null for no client defined properties
allowedStaleDataTimespan - time the repository data may not be older than
Method Detail

getClientId

public String getClientId()
Get id of the current client operating on the resouce.

Specified by:
getClientId in interface IAccessContext
Returns:
id of the current client operating on the resouce

setClientId

public void setClientId(String clientId)
Set id of the current client operating on the resouce.

Specified by:
setClientId in interface IAccessContext
Parameters:
clientId - id of the current client operating on the resouce

getClientDefinedProperties

public Map getClientDefinedProperties()
Returns a map containing all client defined properties

Specified by:
getClientDefinedProperties in interface IAccessContext

getUser

public com.sap.security.api.IUser getUser()
Get current user operating on the resouce.

Specified by:
getUser in interface IAccessContext
Returns:
current user operating on the resouce

setUser

public void setUser(com.sap.security.api.IUser user)
Set current user operating on the resouce.

Specified by:
setUser in interface IAccessContext
Parameters:
user - current user operating on the resouce

getLocale

public Locale getLocale()
Get locale of the current user.

Specified by:
getLocale in interface IAccessContext
Returns:
locale of the current user

setLocale

public void setLocale(Locale locale)
Set locale of the current user.

Specified by:
setLocale in interface IAccessContext
Parameters:
locale - locale of the current user

getAllowedStaleDataTimespan

public long getAllowedStaleDataTimespan()
Get time the repository data may not be older than.

Specified by:
getAllowedStaleDataTimespan in interface IAccessContext
Returns:
time the repository data may not be older than

setAllowedStaleDataTimespan

public void setAllowedStaleDataTimespan(long allowedStaleDataTimespan)
Set time the repository data may not be older than.

Specified by:
setAllowedStaleDataTimespan in interface IAccessContext
Parameters:
allowedStaleDataTimespan - time the repository data may not be older than

getTuccId

public String getTuccId()
Description copied from interface: IAccessContext
Returns the TUCC transaction identifier - can be null.

Specified by:
getTuccId in interface IAccessContext
Returns:
the TUCC transaction identifier - can be null.

getClientDefinedProperty

public Object getClientDefinedProperty(String name)
Get a client defined property from the context.

Specified by:
getClientDefinedProperty in interface IAccessContext
Parameters:
name - name of the client defined property
Returns:
value of the client defined property

setClientDefinedProperty

public void setClientDefinedProperty(String name,
                                     Object value)
                              throws RepositoryException
Set a client defined property in the context.

Specified by:
setClientDefinedProperty in interface IAccessContext
Parameters:
name - name of the client defined property
value - value of the client defined property
Throws:
RepositoryException - Exception raised in failure situation

cloneContext

public IAccessContext cloneContext()
Clone access context.

Specified by:
cloneContext in interface IAccessContext
Returns:
cloned access context

getVariantContext

public Map getVariantContext()
Description copied from interface: IAccessContext
Returns a map of context properties used for variant handling - may be null.

Specified by:
getVariantContext in interface IAccessContext
Returns:
a map of context properties used for variant handling - may be null.
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM


Copyright 2012 SAP AG Complete Copyright Notice