public class WorkspaceManager extends Object implements UpdatableItemStateManager, NamespaceStorage, AccessManager
WorkspaceManager...ADD_NODE_ACTION, READ, READ_ACTION, REMOVE, REMOVE_ACTION, SET_PROPERTY_ACTION| Constructor and Description |
|---|
WorkspaceManager(RepositoryConfig config,
SessionInfo sessionInfo,
boolean observationSupported) |
| Modifier and Type | Method and Description |
|---|---|
void |
addEventListener(InternalEventListener listener)
Sets the
InternalEventListener that gets notifications about
local and external changes. |
void |
addLockToken(String lt)
This method succeeds if the lock tokens could be added to the
SessionInfo. |
boolean |
canAccess(String workspaceName)
Determines whether the subject of the current context is granted access
to the given workspace.
|
boolean |
canRead(ItemState itemState)
Returns true if the existing item with the given
ItemId can
be read. |
boolean |
canRemove(ItemState itemState)
Returns true if the existing item state can be removed.
|
String[] |
checkQueryStatement(String statement,
String language,
Map<String,String> namespaces)
Checks if the query statement is valid.
|
EventFilter |
createEventFilter(int eventTypes,
Path path,
boolean isDeep,
String[] uuids,
Name[] nodeTypes,
boolean noLocal)
Creates an event filter based on the parameters available in
ObservationManager.addEventListener(javax.jcr.observation.EventListener, int, java.lang.String, boolean, java.lang.String[], java.lang.String[], boolean). |
void |
dispose()
Dispose this
WorkspaceManager |
void |
execute(ChangeLog changes)
Creates a new batch from the given
ChangeLog and executes it. |
void |
execute(Operation operation)
Creates a new batch from the single workspace operation and executes it.
|
QueryInfo |
executeQuery(String statement,
String language,
Map<String,String> namespaces,
long limit,
long offset,
Map<String,QValue> boundValues) |
AccessControlProvider |
getAccessControlProvider()
Locates and instantiates an AccessControlProvider implementation.
|
EffectiveNodeTypeProvider |
getEffectiveNodeTypeProvider() |
EventBundle |
getEvents(EventFilter filter,
long after)
Returns the events from the journal that occurred after a given date.
|
HierarchyManager |
getHierarchyManager() |
IdFactory |
getIdFactory() |
ItemDefinitionProvider |
getItemDefinitionProvider() |
ItemStateFactory |
getItemStateFactory() |
LockInfo |
getLockInfo(NodeId nodeId) |
String[] |
getLockTokens()
Returns the lock tokens present with the
SessionInfo. |
NameFactory |
getNameFactory() |
NamespaceRegistryImpl |
getNamespaceRegistryImpl() |
NodeTypeRegistry |
getNodeTypeRegistry() |
PathFactory |
getPathFactory() |
String |
getPrefix(String uri) |
Map<String,String> |
getRegisteredNamespaces() |
String[] |
getSupportedQueryLanguages() |
String |
getURI(String prefix) |
String[] |
getWorkspaceNames() |
boolean |
isGranted(ItemState itemState,
String[] actions)
Determines whether the specified
permissions are granted
on the item with the specified path. |
boolean |
isGranted(NodeState parentState,
Path relPath,
String[] actions)
Determines whether the specified
permissions are granted
on the item with the specified path. |
void |
registerNamespace(String prefix,
String uri) |
void |
removeEventListener(InternalEventListener listener) |
void |
removeLockToken(String lt)
Tries to remove the given token from the
SessionInfo. |
void |
setUserData(String userData) |
void |
unregisterNamespace(String uri) |
void |
updateEventFilters()
Updates the event filters on the subscription.
|
public WorkspaceManager(RepositoryConfig config, SessionInfo sessionInfo, boolean observationSupported) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic NamespaceRegistryImpl getNamespaceRegistryImpl()
public NodeTypeRegistry getNodeTypeRegistry()
public ItemDefinitionProvider getItemDefinitionProvider()
public EffectiveNodeTypeProvider getEffectiveNodeTypeProvider()
public HierarchyManager getHierarchyManager()
public String[] getWorkspaceNames() throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic IdFactory getIdFactory()
public NameFactory getNameFactory()
public PathFactory getPathFactory()
public ItemStateFactory getItemStateFactory()
public AccessControlProvider getAccessControlProvider() throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic LockInfo getLockInfo(NodeId nodeId) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic String[] getLockTokens() throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
SessionInfo.SessionInfo.javax.jcr.UnsupportedRepositoryOperationException - If not supported.javax.jcr.RepositoryException - If another error occurs.SessionInfo.getLockTokens()public void addLockToken(String lt) throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.lock.LockException, javax.jcr.RepositoryException
SessionInfo.lt - The lock token to be added.javax.jcr.UnsupportedRepositoryOperationException - If not supported.javax.jcr.lock.LockException - If a lock related exception occurs.javax.jcr.RepositoryException - If another exception occurs.SessionInfo.addLockToken(String)public void removeLockToken(String lt) throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.lock.LockException, javax.jcr.RepositoryException
SessionInfo.lt - The lock token to be removed.javax.jcr.UnsupportedRepositoryOperationException - If not supported.javax.jcr.lock.LockException - If a lock related exception occurs, e.g if the
session info does not contain the specified lock token.javax.jcr.RepositoryException - If another exception occurs.SessionInfo.removeLockToken(String)public String[] getSupportedQueryLanguages() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException - If an error occurs.public String[] checkQueryStatement(String statement, String language, Map<String,String> namespaces) throws javax.jcr.query.InvalidQueryException, javax.jcr.RepositoryException
statement - the query statement.language - the query language.namespaces - the locally remapped namespaces which might be used in
the query statement.javax.jcr.query.InvalidQueryException - if the query statement is invalid.javax.jcr.RepositoryException - if an error occurs while checking the query
statement.public QueryInfo executeQuery(String statement, String language, Map<String,String> namespaces, long limit, long offset, Map<String,QValue> boundValues) throws javax.jcr.RepositoryException
statement - the query statement.language - the query language.namespaces - the locally remapped namespaces which might be used in
the query statement.limit - The result size limit as specified by Query.setLimit(long).offset - The result offset as specified by Query.setOffset(long)boundValues - The bound values as specified by Query.bindValue(String, javax.jcr.Value)RepositoryService.executeQuery(org.apache.jackrabbit.spi.SessionInfo, String, String, java.util.Map, long, long, java.util.Map).javax.jcr.RepositoryException - If an error occurs.public void addEventListener(InternalEventListener listener) throws javax.jcr.RepositoryException
InternalEventListener that gets notifications about
local and external changes.listener - the new listener.javax.jcr.RepositoryException - if the listener cannot be registered.public void updateEventFilters()
throws javax.jcr.RepositoryException
javax.jcr.RepositoryException - If an error occurs.public void removeEventListener(InternalEventListener listener) throws javax.jcr.RepositoryException
listener - The listener to be removed.javax.jcr.RepositoryException - If an error occurs.public EventFilter createEventFilter(int eventTypes, Path path, boolean isDeep, String[] uuids, Name[] nodeTypes, boolean noLocal) throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
ObservationManager.addEventListener(javax.jcr.observation.EventListener, int, java.lang.String, boolean, java.lang.String[], java.lang.String[], boolean).eventTypes - A combination of one or more event type constants
encoded as a bitmask.path - an absolute path.isDeep - a boolean.uuids - array of UUIDs.nodeTypes - array of node type names.noLocal - a boolean.javax.jcr.UnsupportedRepositoryOperationException - if this implementation does not support observation.javax.jcr.RepositoryExceptionpublic EventBundle getEvents(EventFilter filter, long after) throws javax.jcr.RepositoryException, javax.jcr.UnsupportedRepositoryOperationException
filter - the event filter to apply.after - a date in milliseconds.javax.jcr.RepositoryException - if an error occurs.javax.jcr.UnsupportedRepositoryOperationException - if the implementation does not support
journaled observation.public void setUserData(String userData) throws javax.jcr.RepositoryException
userData - The user data used for the event processing.javax.jcr.RepositoryException - If an error occurs.public void execute(Operation operation) throws javax.jcr.RepositoryException
execute in interface UpdatableItemStateManagerjavax.jcr.RepositoryExceptionUpdatableItemStateManager.execute(Operation)public void execute(ChangeLog changes) throws javax.jcr.RepositoryException
ChangeLog and executes it.execute in interface UpdatableItemStateManagerchanges - The set of transient changes to be executed.javax.jcr.RepositoryExceptionpublic void dispose()
WorkspaceManagerdispose in interface UpdatableItemStateManagerpublic boolean isGranted(NodeState parentState, Path relPath, String[] actions) throws javax.jcr.ItemNotFoundException, javax.jcr.RepositoryException
AccessManagerpermissions are granted
on the item with the specified path.isGranted in interface AccessManagerparentState - The node state of the next existing ancestor.relPath - The relative path pointing to the non-existing target item.actions - An array of actions that need to be checked.true if the actions are granted; otherwise falsejavax.jcr.ItemNotFoundException - if the target item does not existjavax.jcr.RepositoryException - if another error occursAccessManager.isGranted(NodeState, Path, String[])public boolean isGranted(ItemState itemState, String[] actions) throws javax.jcr.ItemNotFoundException, javax.jcr.RepositoryException
AccessManagerpermissions are granted
on the item with the specified path.isGranted in interface AccessManageractions - An array of actions that need to be checked.true if the actions are granted; otherwise falsejavax.jcr.ItemNotFoundException - if the target item does not existjavax.jcr.RepositoryException - if another error occursAccessManager.isGranted(ItemState, String[])public boolean canRead(ItemState itemState) throws javax.jcr.ItemNotFoundException, javax.jcr.RepositoryException
AccessManagerItemId can
be read.canRead in interface AccessManagerjavax.jcr.ItemNotFoundExceptionjavax.jcr.RepositoryExceptionAccessManager.canRead(ItemState)public boolean canRemove(ItemState itemState) throws javax.jcr.ItemNotFoundException, javax.jcr.RepositoryException
AccessManagercanRemove in interface AccessManagerjavax.jcr.ItemNotFoundExceptionjavax.jcr.RepositoryExceptionAccessManager.canRemove(ItemState)public boolean canAccess(String workspaceName) throws javax.jcr.NoSuchWorkspaceException, javax.jcr.RepositoryException
AccessManagercanAccess in interface AccessManagerworkspaceName - name of workspacetrue if the subject of the current context is
granted access to the given workspace; otherwise false.javax.jcr.NoSuchWorkspaceException - if a workspace with the given name does not exist.javax.jcr.RepositoryException - if another error occursAccessManager.canAccess(String)public Map<String,String> getRegisteredNamespaces() throws javax.jcr.RepositoryException
getRegisteredNamespaces in interface NamespaceStoragejavax.jcr.RepositoryExceptionpublic String getPrefix(String uri) throws javax.jcr.NamespaceException, javax.jcr.RepositoryException
getPrefix in interface NamespaceStoragejavax.jcr.NamespaceExceptionjavax.jcr.RepositoryExceptionpublic String getURI(String prefix) throws javax.jcr.NamespaceException, javax.jcr.RepositoryException
getURI in interface NamespaceStoragejavax.jcr.NamespaceExceptionjavax.jcr.RepositoryExceptionpublic void registerNamespace(String prefix, String uri) throws javax.jcr.NamespaceException, javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
registerNamespace in interface NamespaceStoragejavax.jcr.NamespaceExceptionjavax.jcr.UnsupportedRepositoryOperationExceptionjavax.jcr.AccessDeniedExceptionjavax.jcr.RepositoryExceptionpublic void unregisterNamespace(String uri) throws javax.jcr.NamespaceException, javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
unregisterNamespace in interface NamespaceStoragejavax.jcr.NamespaceExceptionjavax.jcr.UnsupportedRepositoryOperationExceptionjavax.jcr.AccessDeniedExceptionjavax.jcr.RepositoryExceptionCopyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.