public abstract class AbstractContext extends Object implements Context, Serializable
Modifier and Type | Field and Description |
---|---|
protected Locale |
locale
The locale for this context.
|
APPLICATION_SCOPE, ATTRIBUTE_COMMENT, ATTRIBUTE_EXCEPTION, ATTRIBUTE_MESSAGE, ATTRIBUTE_PATH, ATTRIBUTE_RECURSIVE, ATTRIBUTE_REPOSITORY, ATTRIBUTE_UUID, ATTRIBUTE_VERSION, ATTRIBUTE_VERSION_MAP, LOCAL_SCOPE, SESSION_SCOPE
Constructor and Description |
---|
AbstractContext() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object arg0) |
boolean |
containsValue(Object value)
This implementation is very slow!
|
Set<Map.Entry<String,Object>> |
entrySet() |
Object |
get(Object key) |
AccessManager |
getAccessManager(String workspace)
Get a an
AccessManager for logical entities. |
Object |
getAttribute(String name)
Get the attribute value.
|
Object |
getAttribute(String name,
int scope)
Get attribute value.
|
Map<String,Object> |
getAttributes()
Merge the scopes maps.
|
Map<String,Object> |
getAttributes(int scope)
Get a map of a attributes set in the scope.
|
AttributeStrategy |
getAttributeStrategy() |
HierarchyManager |
getHierarchyManager(String workspaceName)
Get hierarchy manager initialized for this user.
|
javax.jcr.Session |
getJCRSession(String workspaceName) |
Locale |
getLocale()
If not yet set try to get the locale of the user.
|
Messages |
getMessages()
TODO: This duplicates methods from MessagesManager : remove either.
|
Messages |
getMessages(String basename)
TODO: This duplicates methods from MessagesManager : remove either.
|
QueryManager |
getQueryManager(String workspaceName)
Get QueryManager created for this user on the specified repository.
|
JCRSessionStrategy |
getRepositoryStrategy() |
Subject |
getSubject() |
User |
getUser()
If this is not a UserContext this method will very likely return the system user.
|
boolean |
isEmpty() |
Set<String> |
keySet() |
Object |
put(Object key,
Object value) |
void |
putAll(Map map) |
void |
release()
Release any resource used by this Context (e.g.
|
Object |
remove(Object key) |
void |
removeAttribute(String name,
int scope)
Remove an attribute.
|
void |
setAttribute(String name,
Object value,
int scope)
Set attribute value, scope of the attribute is defined.
|
void |
setAttributeStrategy(AttributeStrategy strategy) |
void |
setLocale(Locale locale) |
void |
setRepositoryStrategy(JCRSessionStrategy strategy) |
int |
size() |
Collection<Object> |
values() |
protected Locale locale
public User getUser()
Context
public Subject getSubject()
public AttributeStrategy getAttributeStrategy()
public void setAttributeStrategy(AttributeStrategy strategy)
public JCRSessionStrategy getRepositoryStrategy()
public void setRepositoryStrategy(JCRSessionStrategy strategy)
public Object getAttribute(String name, int scope)
Context
name
- to which value is associated toscope
- the scope (request, session, application)public Map<String,Object> getAttributes(int scope)
Context
public void removeAttribute(String name, int scope)
Context
public void setAttribute(String name, Object value, int scope)
Context
name
- is used as a keyscope
- , highest level of scope from which this attribute is visiblepublic AccessManager getAccessManager(String workspace)
Context
AccessManager
for logical entities. The accesses to the repository are handled by the repository itself.public javax.jcr.Session getJCRSession(String workspaceName) throws javax.jcr.LoginException, javax.jcr.RepositoryException
javax.jcr.LoginException
javax.jcr.RepositoryException
public Object getAttribute(String name)
name
- to which value is associated topublic Locale getLocale()
Context.getLocale()
public void setLocale(Locale locale)
public Messages getMessages()
public Messages getMessages(String basename)
basename
- name of the bundle
TODO: This duplicates methods from MessagesManager : remove eitherpublic HierarchyManager getHierarchyManager(String workspaceName)
Context
public QueryManager getQueryManager(String workspaceName)
Context
public boolean containsValue(Object value)
containsValue
in interface Map
public Collection<Object> values()
public boolean containsKey(Object arg0)
containsKey
in interface Map
public void release()
Copyright © 2003–2014 Magnolia International Ltd.. All rights reserved.