org.springframework.extensions.surf
Class ModelPersistenceContext

java.lang.Object
  extended by org.springframework.extensions.surf.ModelPersistenceContext

public final class ModelPersistenceContext
extends Object

Describes the context within which a persister should execute. The object principally stores the user id which may eventually be used by our store implementations to check for user rights against the accessed object. The object also describes the web framework's currently bound repository store id and web application id (to support Alfresco web projects). The object may also eventually store role and rights information regarding who they are in the end application.

Author:
muzquiano

Field Summary
static String REPO_STOREID
           
static String REPO_WEBAPPID
           
 
Constructor Summary
ModelPersistenceContext(String userId)
          Instantiates a new persister context.
 
Method Summary
 String getStoreId()
          Gets the store id.
 String getUserId()
          Gets the user id.
 Object getValue(String key)
          Returns the stored value with the given key
 String getWebappId()
          Gets the webapp id.
 Set<String> keys()
          Returns the set of keys
 void putValue(String key, Object value)
          Stores a value with the given key
 void setStoreId(String storeId)
          Sets the store id.
 void setWebappId(String webappId)
          Sets the webapp id.
 String toString()
           
 Collection<Object> values()
          Returns the collection of values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REPO_STOREID

public static String REPO_STOREID

REPO_WEBAPPID

public static String REPO_WEBAPPID
Constructor Detail

ModelPersistenceContext

public ModelPersistenceContext(String userId)
Instantiates a new persister context.

Parameters:
userId - the user id
Method Detail

getUserId

public String getUserId()
Gets the user id.

Returns:
the user id

getValue

public Object getValue(String key)
Returns the stored value with the given key

Parameters:
key - the key
Returns:
the value

putValue

public void putValue(String key,
                     Object value)
Stores a value with the given key

Parameters:
key - the key
value - the value

keys

public Set<String> keys()
Returns the set of keys

Returns:
the set

values

public Collection<Object> values()
Returns the collection of values

Returns:
the collection

setStoreId

public void setStoreId(String storeId)
Sets the store id.

Parameters:
storeId - the new store id

getStoreId

public String getStoreId()
Gets the store id.

Returns:
the store id

setWebappId

public void setWebappId(String webappId)
Sets the webapp id.

Parameters:
webappId - the new webapp id

getWebappId

public String getWebappId()
Gets the webapp id.

Returns:
the webapp id

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009 SpringSource, Inc. All Rights Reserved.