Package org.apache.jackrabbit.spi2davex
Class RepositoryServiceImpl
- java.lang.Object
-
- org.apache.jackrabbit.spi2dav.RepositoryServiceImpl
-
- org.apache.jackrabbit.spi2davex.RepositoryServiceImpl
-
- All Implemented Interfaces:
RepositoryService
,DavConstants
public class RepositoryServiceImpl extends RepositoryServiceImpl
RepositoryServiceImpl
...
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.spi2dav.RepositoryServiceImpl
MAX_CONNECTIONS_DEFAULT
-
Fields inherited from interface org.apache.jackrabbit.webdav.DavConstants
creationDateFormat, DEPTH_0, DEPTH_1, DEPTH_INFINITY, DEPTH_INFINITY_S, HEADER_AUTHORIZATION, HEADER_CONTENT_LANGUAGE, HEADER_CONTENT_LENGTH, HEADER_CONTENT_TYPE, HEADER_DAV, HEADER_DEPTH, HEADER_DESTINATION, HEADER_ETAG, HEADER_IF, HEADER_LAST_MODIFIED, HEADER_LOCK_TOKEN, HEADER_OVERWRITE, HEADER_TIMEOUT, INFINITE_TIMEOUT, modificationDateFormat, NAMESPACE, OPAQUE_LOCK_TOKEN_PREFIX, PROPERTY_CREATIONDATE, PROPERTY_DISPLAYNAME, PROPERTY_GETCONTENTLANGUAGE, PROPERTY_GETCONTENTLENGTH, PROPERTY_GETCONTENTTYPE, PROPERTY_GETETAG, PROPERTY_GETLASTMODIFIED, PROPERTY_LOCKDISCOVERY, PROPERTY_RESOURCETYPE, PROPERTY_SOURCE, PROPERTY_SUPPORTEDLOCK, PROPFIND_ALL_PROP, PROPFIND_ALL_PROP_INCLUDE, PROPFIND_BY_PROPERTY, PROPFIND_PROPERTY_NAMES, TIMEOUT_INFINITE, UNDEFINED_TIME, UNDEFINED_TIMEOUT, XML_ACTIVELOCK, XML_ALLPROP, XML_COLLECTION, XML_DEPTH, XML_DST, XML_EXCLUSIVE, XML_HREF, XML_INCLUDE, XML_KEEPALIVE, XML_LINK, XML_LOCKENTRY, XML_LOCKINFO, XML_LOCKROOT, XML_LOCKSCOPE, XML_LOCKTOKEN, XML_LOCKTYPE, XML_MULTISTATUS, XML_OMIT, XML_OWNER, XML_PROP, XML_PROPERTYBEHAVIOR, XML_PROPERTYUPDATE, XML_PROPFIND, XML_PROPNAME, XML_PROPSTAT, XML_REMOVE, XML_RESPONSE, XML_RESPONSEDESCRIPTION, XML_SET, XML_SHARED, XML_SOURCE, XML_STATUS, XML_TIMEOUT, XML_WRITE
-
-
Constructor Summary
Constructors Constructor Description RepositoryServiceImpl(String jcrServerURI, String defaultWorkspaceName, BatchReadConfig batchReadConfig, int itemInfoCacheSize, ConnectionOptions connectionOptions)
Creates a new instance of this repository service.RepositoryServiceImpl(String jcrServerURI, BatchReadConfig batchReadConfig)
Same asRepositoryServiceImpl(String, String, BatchReadConfig, int, ConnectionOptions)
usingnull
workspace name,ItemInfoCacheImpl.DEFAULT_CACHE_SIZE
as size for the item cache,RepositoryServiceImpl.MAX_CONNECTIONS_DEFAULT
for the maximum number of connections on the client andConnectionOptions.DEFAULT
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clone(SessionInfo sessionInfo, String srcWorkspaceName, NodeId srcNodeId, NodeId destParentNodeId, Name destName, boolean removeExisting)
Clone the subtree identified by the givensrcNodeId
in workspace namedsrcWorkspaceName
to the destination in the workspace specified by the givenSessionInfo
.void
copy(SessionInfo sessionInfo, String srcWorkspaceName, NodeId srcNodeId, NodeId destParentNodeId, Name destName)
Clone the subtree identified by the givensrcNodeId
in workspace namedsrcWorkspaceName
to the destination in the workspace specified by the givenSessionInfo
.Batch
createBatch(SessionInfo sessionInfo, ItemId itemId)
Indicates the start of a set of operations that cause modifications on the underlying persistence layer.Tree
createTree(SessionInfo sessionInfo, Batch batch, Name nodeName, Name primaryTypeName, String uniqueId)
Creates a newTree
that can be populated and later on be applied to the specifiedBatch
by calling#setTree
.void
dispose(SessionInfo sessionInfo)
Indicates to theRepositoryService
, that the given SessionInfo will not be used any more.Iterator<? extends ItemInfo>
getItemInfos(SessionInfo sessionInfo, ItemId itemId)
Method used to 'batch-read' from the persistent storage.PropertyInfo
getPropertyInfo(SessionInfo sessionInfo, PropertyId propertyId)
Returns thePropertyInfo
for theProperty
identified by the given id.SessionInfo
obtain(Credentials credentials, String workspaceName)
If the specifiedworkspaceName
the default workspace name is used for backwards compatibility with jackrabbit-jcr-server < 1.5.0SessionInfo
obtain(SessionInfo sessionInfo, String workspaceName)
If the specifiedworkspaceName
the default workspace name is used for backwards compatibility with jackrabbit-jcr-server < 1.5.0void
submit(Batch batch)
Completes the givenBatch
or discard all the previous modifications.-
Methods inherited from class org.apache.jackrabbit.spi2dav.RepositoryServiceImpl
addVersionLabel, checkin, checkout, checkout, checkpoint, checkpoint, checkQueryStatement, clearItemUriCache, computeRepositoryUri, createActivity, createConfiguration, createEventFilter, createSubscription, createWorkspace, deleteWorkspace, dispose, executeQuery, executeRequest, getChildInfos, getClient, getContext, getEvents, getEvents, getIdFactory, getItemInfoCache, getItemUri, getItemUri, getLockInfo, getNameFactory, getNamePathResolver, getNamespacePrefix, getNamespaceURI, getNodeDefinition, getNodeInfo, getPathFactory, getPrivilegeDefinitions, getPrivilegeNames, getPropertyDefinition, getQNodeTypeDefinitions, getQNodeTypeDefinitions, getQValueFactory, getReferences, getRegisteredNamespaces, getRepositoryDescriptors, getSupportedPrivileges, getSupportedQueryLanguages, getWorkspaceNames, impersonate, importXml, initMethod, initMethod, isGranted, lock, lock, merge, merge, mergeActivity, move, refreshLock, registerNamespace, registerNodeTypes, removeActivity, removeVersion, removeVersionLabel, resolveMergeConflict, restore, restore, unlock, unregisterNamespace, unregisterNodeTypes, update, updateEventFilters
-
-
-
-
Constructor Detail
-
RepositoryServiceImpl
public RepositoryServiceImpl(String jcrServerURI, BatchReadConfig batchReadConfig) throws RepositoryException
Same asRepositoryServiceImpl(String, String, BatchReadConfig, int, ConnectionOptions)
usingnull
workspace name,ItemInfoCacheImpl.DEFAULT_CACHE_SIZE
as size for the item cache,RepositoryServiceImpl.MAX_CONNECTIONS_DEFAULT
for the maximum number of connections on the client andConnectionOptions.DEFAULT
.- Parameters:
jcrServerURI
- The server uri.batchReadConfig
- The batch read configuration.- Throws:
RepositoryException
- If an exception occurs.
-
RepositoryServiceImpl
public RepositoryServiceImpl(String jcrServerURI, String defaultWorkspaceName, BatchReadConfig batchReadConfig, int itemInfoCacheSize, ConnectionOptions connectionOptions) throws RepositoryException
Creates a new instance of this repository service.- Parameters:
jcrServerURI
- The server uri.defaultWorkspaceName
- The default workspace name.batchReadConfig
- The batch read configuration.itemInfoCacheSize
- The size of the item info cache.connectionOptions
- advanced connection options.- Throws:
RepositoryException
- If an exception occurs.
-
-
Method Detail
-
obtain
public SessionInfo obtain(Credentials credentials, String workspaceName) throws RepositoryException
If the specifiedworkspaceName
the default workspace name is used for backwards compatibility with jackrabbit-jcr-server < 1.5.0- Specified by:
obtain
in interfaceRepositoryService
- Overrides:
obtain
in classRepositoryServiceImpl
- Parameters:
credentials
- the credentials of the user.workspaceName
- the name of the workspace theSessionInfo
should be built for. If the specified workspaceName isnull
the implementation should select a default workspace.- Returns:
- a
SessionInfo
if authentication was successful. - Throws:
LoginException
- if authentication of the user fails.NoSuchWorkspaceException
- if the specifiedworkspaceName
is not recognized.RepositoryException
- if an error occurs.- See Also:
RepositoryService.obtain(Credentials, String)
-
obtain
public SessionInfo obtain(SessionInfo sessionInfo, String workspaceName) throws RepositoryException
If the specifiedworkspaceName
the default workspace name is used for backwards compatibility with jackrabbit-jcr-server < 1.5.0- Specified by:
obtain
in interfaceRepositoryService
- Overrides:
obtain
in classRepositoryServiceImpl
- Parameters:
sessionInfo
- for another workspaceworkspaceName
- the name of the workspace the newSessionInfo
should be built for. If the specified workspaceName isnull
the implementation should select a default workspace.- Returns:
- a
SessionInfo
if authentication was successful. - Throws:
LoginException
- if authentication of the user fails.NoSuchWorkspaceException
- if the specifiedworkspaceName
is not recognized.RepositoryException
- if an error occurs.- See Also:
RepositoryService.obtain(SessionInfo, String)
-
dispose
public void dispose(SessionInfo sessionInfo) throws RepositoryException
Description copied from interface:RepositoryService
Indicates to theRepositoryService
, that the given SessionInfo will not be used any more.- Specified by:
dispose
in interfaceRepositoryService
- Overrides:
dispose
in classRepositoryServiceImpl
- Throws:
RepositoryException
- See Also:
RepositoryService.dispose(SessionInfo)
-
getItemInfos
public Iterator<? extends ItemInfo> getItemInfos(SessionInfo sessionInfo, ItemId itemId) throws RepositoryException
Description copied from interface:RepositoryService
Method used to 'batch-read' from the persistent storage. It returns theItemInfo
for the givenItemId
as the first element in theIterator
. In addition the iterator may contain arbitraryItemInfo
s.- Specified by:
getItemInfos
in interfaceRepositoryService
- Overrides:
getItemInfos
in classRepositoryServiceImpl
- Returns:
- An
Iterator
ofItemInfo
s containing at least a single element: theItemInfo
that represents the Item identified by the givenItemId
. If the Iterator contains multiple elements, the first is expected to represent the Item identified by the givenItemId
. - Throws:
ItemNotFoundException
RepositoryException
- See Also:
RepositoryService.getItemInfos(SessionInfo, ItemId)
-
getPropertyInfo
public PropertyInfo getPropertyInfo(SessionInfo sessionInfo, PropertyId propertyId) throws RepositoryException
Description copied from interface:RepositoryService
Returns thePropertyInfo
for theProperty
identified by the given id.- Specified by:
getPropertyInfo
in interfaceRepositoryService
- Overrides:
getPropertyInfo
in classRepositoryServiceImpl
- Returns:
- The
PropertyInfo
for theProperty
identified by the given id. - Throws:
ItemNotFoundException
RepositoryException
- See Also:
RepositoryService.getPropertyInfo(SessionInfo, PropertyId)
-
createBatch
public Batch createBatch(SessionInfo sessionInfo, ItemId itemId) throws RepositoryException
Description copied from interface:RepositoryService
Indicates the start of a set of operations that cause modifications on the underlying persistence layer. All modification called on theBatch
must be executed at once or non must be executed upon callingRepositoryService.submit(Batch)
.- Specified by:
createBatch
in interfaceRepositoryService
- Overrides:
createBatch
in classRepositoryServiceImpl
itemId
- Id of the Item that is a common ancestor of allItem
s affected upon batch execution. ThisItem
might itself be modified within the scope of theBatch
.- Returns:
- A Batch indicating the start of a set of transient modifications
that will be execute at once upon
RepositoryService.submit(Batch)
. - Throws:
RepositoryException
- See Also:
Item.save()
,Session.save()
,Batch
-
submit
public void submit(Batch batch) throws RepositoryException
Description copied from interface:RepositoryService
Completes the givenBatch
or discard all the previous modifications. SeeRepositoryService.createBatch(SessionInfo,ItemId)
for additional information regarding batch creation.- Specified by:
submit
in interfaceRepositoryService
- Overrides:
submit
in classRepositoryServiceImpl
- Throws:
PathNotFoundException
ItemNotFoundException
NoSuchNodeTypeException
ValueFormatException
VersionException
LockException
ConstraintViolationException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryException
- See Also:
Batch
-
createTree
public Tree createTree(SessionInfo sessionInfo, Batch batch, Name nodeName, Name primaryTypeName, String uniqueId) throws RepositoryException
Description copied from interface:RepositoryService
Creates a newTree
that can be populated and later on be applied to the specifiedBatch
by calling#setTree
.- Specified by:
createTree
in interfaceRepositoryService
- Overrides:
createTree
in classRepositoryServiceImpl
- Returns:
- a new
Tree
instance. - Throws:
RepositoryException
-
copy
public void copy(SessionInfo sessionInfo, String srcWorkspaceName, NodeId srcNodeId, NodeId destParentNodeId, Name destName) throws RepositoryException
Description copied from interface:RepositoryService
Clone the subtree identified by the givensrcNodeId
in workspace namedsrcWorkspaceName
to the destination in the workspace specified by the givenSessionInfo
. The destination is composed by the given parent id and the new name as indicated bydestName
.Note, that
srcWorkspaceName
may be the same as the one specified within theSessionInfo
. In this case the copy corresponds to a copy within a single workspace.- Specified by:
copy
in interfaceRepositoryService
- Overrides:
copy
in classRepositoryServiceImpl
- Throws:
NoSuchWorkspaceException
ConstraintViolationException
VersionException
AccessDeniedException
PathNotFoundException
ItemExistsException
LockException
UnsupportedRepositoryOperationException
RepositoryException
- See Also:
Workspace.copy(String, String)
,Workspace.copy(String, String, String)
-
clone
public void clone(SessionInfo sessionInfo, String srcWorkspaceName, NodeId srcNodeId, NodeId destParentNodeId, Name destName, boolean removeExisting) throws RepositoryException
Description copied from interface:RepositoryService
Clone the subtree identified by the givensrcNodeId
in workspace namedsrcWorkspaceName
to the destination in the workspace specified by the givenSessionInfo
. The destination is composed by the given parent id and the new name as indicated bydestName
.- Specified by:
clone
in interfaceRepositoryService
- Overrides:
clone
in classRepositoryServiceImpl
- Throws:
NoSuchWorkspaceException
ConstraintViolationException
VersionException
AccessDeniedException
PathNotFoundException
ItemExistsException
LockException
UnsupportedRepositoryOperationException
RepositoryException
- See Also:
Workspace.clone(String, String, String, boolean)
-
-