public interface Context extends Context
Modifier and Type | Field and Description |
---|---|
static int |
APPLICATION_SCOPE
Attribute visibility scope, its visible to all sessions of this application.
|
static String |
ATTRIBUTE_COMMENT |
static String |
ATTRIBUTE_EXCEPTION |
static String |
ATTRIBUTE_MESSAGE |
static String |
ATTRIBUTE_PATH |
static String |
ATTRIBUTE_RECURSIVE |
static String |
ATTRIBUTE_REPOSITORY |
static String |
ATTRIBUTE_REQUESTOR
Deprecated.
since 5.4.4, use
ATTRIBUTE_USERNAME . |
static String |
ATTRIBUTE_USERNAME
User name attribute.
|
static String |
ATTRIBUTE_UUID |
static String |
ATTRIBUTE_VERSION |
static String |
ATTRIBUTE_VERSION_MAP |
static int |
LOCAL_SCOPE
Attribute visibility scope.
|
static int |
SESSION_SCOPE
Attribute visibility scope Shared by all requests from this session.
|
Modifier and Type | Method and Description |
---|---|
AccessManager |
getAccessManager(String name)
Get a an
AccessManager for logical entities. |
<T> T |
getAttribute(String name)
Get attribute value without passing a scope. the scopes are searched from bottom up (request, session,
application)
|
<T> T |
getAttribute(String name,
int scope)
Get attribute value.
|
Map<String,Object> |
getAttributes()
Get an over all map.
|
Map<String,Object> |
getAttributes(int scope)
Get a map of a attributes set in the scope.
|
javax.jcr.Session |
getJCRSession(String workspaceName) |
Locale |
getLocale()
Get the current locale.
|
Messages |
getMessages()
Get the default messages.
|
Messages |
getMessages(String basename)
Get the messages of the named bundle.
|
Subject |
getSubject() |
User |
getUser()
If this is not a UserContext this method will very likely return the system user.
|
void |
release()
Release any resource used by this Context (e.g. jcr sessions).
|
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 |
setLocale(Locale locale) |
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
static final int LOCAL_SCOPE
static final int SESSION_SCOPE
static final int APPLICATION_SCOPE
static final String ATTRIBUTE_REPOSITORY
static final String ATTRIBUTE_PATH
static final String ATTRIBUTE_VERSION
static final String ATTRIBUTE_VERSION_MAP
static final String ATTRIBUTE_UUID
static final String ATTRIBUTE_RECURSIVE
static final String ATTRIBUTE_COMMENT
static final String ATTRIBUTE_MESSAGE
static final String ATTRIBUTE_EXCEPTION
@Deprecated static final String ATTRIBUTE_REQUESTOR
ATTRIBUTE_USERNAME
.static final String ATTRIBUTE_USERNAME
Command
.User getUser()
Subject getSubject()
void setLocale(Locale locale)
Locale getLocale()
javax.jcr.Session getJCRSession(String workspaceName) throws javax.jcr.LoginException, javax.jcr.RepositoryException
javax.jcr.LoginException
javax.jcr.RepositoryException
AccessManager getAccessManager(String name)
AccessManager
for logical entities. The accesses to the repository are handled by the repository itself.void setAttribute(String name, Object value, int scope)
name
- is used as a keyscope
- , highest level of scope from which this attribute is visible<T> T getAttribute(String name, int scope)
name
- to which value is associated toscope
- the scope (request, session, application)<T> T getAttribute(String name)
name
- to which value is associated toMap<String,Object> getAttributes(int scope)
void removeAttribute(String name, int scope)
Messages getMessages()
Messages getMessages(String basename)
basename
- name of the bundle
TODO: This duplicates methods from MessagesManager : remove eithervoid release()
Copyright © 2003–2018 Magnolia International Ltd.. All rights reserved.