SAP NetWeaver '04

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

[contained in: com.sap.netweaver.bc.rf.par - bc.rf.common_api.jar]
java.lang.Object
  |
  +--com.sap.netweaver.bc.rf.common.context.AccessContext
All Implemented Interfaces:
IAccessContext, java.io.Serializable

public class AccessContext
extends java.lang.Object
implements IAccessContext, java.io.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  java.lang.String clientId
          Current client identity operating on the resouce.
static long DEFAULT_ALLOWED_STALE_DATA_TIMESPAN
           
protected  java.util.Locale locale
          Locale of current user operating on the resouce.
protected  java.util.Map properties
          Client defined property map.
protected  com.sap.netweaver.bc.rf.common.context.IUser user
          Current user operating on the resouce.
 
Constructor Summary
AccessContext(java.lang.String clientId, com.sap.netweaver.bc.rf.common.context.IUser user, java.util.Locale locale, long allowedStaleDataTimespan)
          Construct instance just with the current user and a locale to be used.
AccessContext(java.lang.String clientId, com.sap.netweaver.bc.rf.common.context.IUser user, java.util.Locale locale, java.util.Map properties, long allowedStaleDataTimespan)
          Construct instance with the current user, a locale to be used and client defined properties.
AccessContext(java.lang.String clientId, com.sap.netweaver.bc.rf.common.context.IUser user, long allowedStaleDataTimespan)
          Construct instance just with the current user.
AccessContext(java.lang.String clientId, com.sap.netweaver.bc.rf.common.context.IUser user, java.util.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.
 java.lang.Object getClientDefinedProperty(java.lang.String name)
          Get a client defined property from the context.
 java.lang.String getClientId()
          Get id of the current client operating on the resouce.
 java.util.Locale getLocale()
          Get locale of the current user.
 com.sap.netweaver.bc.rf.common.context.IUser getUser()
          Get current user operating on the resouce.
 void setAllowedStaleDataTimespan(long allowedStaleDataTimespan)
          Set time the repository data may not be older than.
 void setClientDefinedProperty(java.lang.String name, java.lang.Object value)
          Set a client defined property in the context.
 void setClientId(java.lang.String clientId)
          Set id of the current client operating on the resouce.
 void setLocale(java.util.Locale locale)
          Set locale of the current user.
 void setUser(com.sap.netweaver.bc.rf.common.context.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 java.lang.String clientId
Current client identity operating on the resouce.

user

protected transient com.sap.netweaver.bc.rf.common.context.IUser user
Current user operating on the resouce.

locale

protected java.util.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 java.util.Map properties
Client defined property map.
Constructor Detail

AccessContext

public AccessContext(java.lang.String clientId,
                     com.sap.netweaver.bc.rf.common.context.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(java.lang.String clientId,
                     com.sap.netweaver.bc.rf.common.context.IUser user,
                     java.util.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(java.lang.String clientId,
                     com.sap.netweaver.bc.rf.common.context.IUser user,
                     java.util.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(java.lang.String clientId,
                     com.sap.netweaver.bc.rf.common.context.IUser user,
                     java.util.Locale locale,
                     java.util.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 java.lang.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(java.lang.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

getUser

public com.sap.netweaver.bc.rf.common.context.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.netweaver.bc.rf.common.context.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 java.util.Locale getLocale()
Get locale of the current user.
Specified by:
getLocale in interface IAccessContext
Returns:
locale of the current user

setLocale

public void setLocale(java.util.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

getClientDefinedProperty

public java.lang.Object getClientDefinedProperty(java.lang.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(java.lang.String name,
                                     java.lang.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

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.