The RepositoryService interface defines methods used to
retrieve information from the persistent layer of the repository as well
as the methods that modify its persistent state.
The implementation of this interface is intended to hold only the state of
the persistent layer, no session-related state should be held. Consequently,
each method that alters persistent state always includes all the information
necessary to fully specify and authorize a change.

This method performs an immediate persistent copy of the node identified by
srcNodeId and that node's subtree to a position as child of the node
identified by destParentNodeId and assigns the newly copied node the name
destName.
The SessionInfo object provides user and workspace identification
as well as eventual lock tokens required to execute the copy.
If srcWorkspaceName differs from the workspace name present with
the SessionInfo, the copy is corresponds to a copy across workspaces.
The source and destination of the copy operation are specified by
NodeIds. The Name holds the new name. Taken together,
this information is sufficient to completely specify and authorize the copy
operations.

The RepositoryService in addition allows to create and submit Batch
objects, that cover lists of operations that have to be applied to the
persistent layer at once.

getNodeDefinition

Returns the QNodeDefinition for the Node
identified by the given id. This method should only be used if the
caller is not able to unambiguously determine the applicable definition
from the parent node type definition or if no parent exists (i.e. for
the root).

Parameters:

sessionInfo -

nodeId -

Returns:

The node definition applicable to the Node identified
by the given id.

getPropertyDefinition

Returns the QPropertyDefinition for the Property
identified by the given id. This method should only be used if the
caller is not able to unambiguously determine the applicable definition
from the parent node type definition.

Parameters:

sessionInfo -

propertyId -

Returns:

The property definition applicable for the Property
identified by the given id.

getItemInfos

Method used to 'batch-read' from the persistent storage. It returns the
ItemInfo for the given ItemId as the first
element in the Iterator. In addition the iterator may contain
arbitrary ItemInfos.

Parameters:

sessionInfo -

itemId -

Returns:

An Iterator of ItemInfos containing
at least a single element: the ItemInfo that represents
the Item identified by the given ItemId. If the Iterator
contains multiple elements, the first is expected to represent the Item
identified by the given ItemId.

getReferences

Returns the Ids of the properties that are referencing
the node identified by the given nodeId. If
weakReferences is true the ids of
WEAKREFERENCE properties are
returned, otherwise the property must be of type REFERENCE.

Parameters:

sessionInfo -

nodeId -

propertyName - name filter of referring properties to be returned;
if null then all references are returned.

createBatch

Indicates the start of a set of operations that cause modifications
on the underlying persistence layer. All modification called on the
Batch must be executed at once or non must be executed upon
calling submit(Batch).

Parameters:

sessionInfo -

itemId - Id of the Item that is a common ancestor of all
Items affected upon batch execution. This Item
might itself be modified within the scope of the Batch.

Returns:

A Batch indicating the start of a set of transient modifications
that will be execute at once upon submit(Batch).

Imports the data present in the given InputStream into the
persistent layer. Note, that the implementation is responsible for
validating the data presented and for the integrity of the repository
upon completion.

Clone the subtree identified by the given srcNodeId
in workspace named srcWorkspaceName to the destination
in the workspace specified by the given SessionInfo. The
destination is composed by the given parent id and the new name
as indicated by destName.

Note, that srcWorkspaceName may be the same as the one
specified within the SessionInfo. In this case the copy
corresponds to a copy within a single workspace.

Clone the subtree identified by the given srcNodeId
in workspace named srcWorkspaceName to the destination
in the workspace specified by the given SessionInfo. The
destination is composed by the given parent id and the new name
as indicated by destName.

Restores the node identified by nodeId to the state defined
by the version with the specified versionId.

Parameters:

sessionInfo -

nodeId -

versionId -

removeExisting - boolean flag indicating how to deal with an
identifier collision that may occur if a node exists outside the subtree
to be restored with the same identified as a node that would be
introduces by the restore. If the removeExisting is
true the restored node takes precedence and the
existing node is removed. Otherwise the restore fails.

Restore multiple versions at once. The versions to be restored are
identified by the given array of NodeIds.

Parameters:

sessionInfo -

versionIds -

removeExisting - boolean flag indicating how to deal with an
identifier collision that may occur if a node exists outside the subtrees
to be restored with the same identified as any node that would be
introduces by the restore. If the removeExisting is
true the node to be restored takes precedence and the
existing node is removed. Otherwise the restore fails.

Resolve an existing merge conflict present with the node identified by
the given NodeId.

Parameters:

sessionInfo -

nodeId -

mergeFailedIds - The NodeIds remaining in the jcr:mergeFailed
REFERENCE property. The version id(s) to be resolved were removed from the
array and added to the predecessor ids in case of Node.doneMerge(Version).
In case of a Node.cancelMerge(Version) the version id only gets
removed from the list.

predecessorIds - The complete set of predecessor id including those
that have been added in order to resolve a merge conflict.

versionHistoryId - NodeId identifying the version
history the version identified by versionId belongs to.

versionId - NodeId identifying the version the
label belongs to.

label - The label to be added.

moveLabel - If the label is already assigned to a version within
the same version history this parameter has the following effect: If true
the label already present gets moved to be now be a label of the version
indicated by versionId. If false this method
fails and the label remains with the original version.

executeQuery

Execute the given query statement with the specified query language. The
additional namespaces parameter provides a mapping of prefix
to namespace uri in order to be able to properly resolve prefix:localname
patterns present within the query statement.

Parameters:

sessionInfo - the session info that wants to execute the query.

statement - the query statement to be execute.

language - the query language used to parse the query
statement.

namespaces - the locally re-mapped namespace which may be used in
the query statement.

limit - The maximum result size or -1 is no
maximum is set.

offset - The offset in the total result set or -1
is no offset is set.

createSubscription

Creates a new Subscription for events with an initial set of
EventFilters. The returned subscription must provide events from
the time when the subscription was created. If an empty array of filters
is passed no events will be available through the created subscription
unless the filters are later updated by calling
updateEventFilters(Subscription, EventFilter[]).

updateEventFilters

Updates events filters on the subscription. When this method returns all
events that go through the passed subscription and have been generated
after this method call must be filtered using the passed
filters.

Note on thread-safety: it is permissible to call this methods
while another thread is blocked in calling getEvents(Subscription, long) using the same
subscription instance as a parameter.

Parameters:

subscription - the subscription where the event filters are
applied.

filters - the filters that are applied to the events as they
occurred on the repository. An event is included in an
event bundle if it is accepted by at least one of the supplied
filters. If an empty array is passed none of the potential
events are include in an event bundle. This allows a
client to skip or ignore events for a certain period of
time.

getEvents

Returns events from the EventJournal after a given point in
time. The returned event bundle may only contain events up to a given
time. In order to retrieve more events a client must call this method
again with the timestamp from the last event bundle. An empty bundle
indicates that there are no more events.

getQNodeTypeDefinitions

Retrieve QNodeTypeDefinitions for the given names. The
implementation is free to return additional definitions which will (probably)
be needed by the caller due to node type inheritance. The caller must be
able to deal with any kind of additional QNodeTypeDefinitions
present in the Iterator irrespective whether they have been
loaded before or not.

Registers the node types with the specified QNodeTypeDefinitions.
If allowUpdate is true this method may also be
used to reregister existing node types with a modified definition, otherwise
this method will fail with NodeTypeExistsException if any of
the specified definition has the name of an already registered node type.

createWorkspace

Create a new workspace with the specified name. If
srcWorkspaceName isn't null the content of
that workspace is 'cloned' to the new workspace as inital content,
otherwise an empty workspace will be created.

Parameters:

sessionInfo -

name - The name of the new workspace.

srcWorkspaceName - The name of the workspace from which the initial
content of the new workspace will be 'cloned'.