|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.jcr2spi.state.ItemStateValidator
public class ItemStateValidator
Utility class for validating an item state against constraints specified by its definition.
Constructor Summary | |
---|---|
ItemStateValidator(ManagerProvider mgrProvider,
PathFactory pathFactory)
Creates a new ItemStateValidator instance. |
Method Summary | |
---|---|
void |
checkAddNode(NodeState parentState,
Name nodeName,
Name nodeTypeName,
int options)
Checks if adding a child node called nodeName of node type
nodeTypeName to the given parent node is allowed in the
current context. |
void |
checkAddProperty(NodeState parentState,
Name propertyName,
QPropertyDefinition definition,
int options)
|
void |
checkIsWritable(NodeState parentState,
int options)
|
void |
checkRemoveItem(ItemState targetState,
int options)
Checks if removing the given target state is allowed in the current context. |
void |
checkSetProperty(PropertyState propState,
int options)
|
void |
validate(NodeState nodeState)
Checks whether the given node state satisfies the constraints specified by its primary and mixin node types. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int CHECK_ACCESS
checkAddNode(org.apache.jackrabbit.jcr2spi.state.NodeState, org.apache.jackrabbit.spi.Name, org.apache.jackrabbit.spi.Name, int)
and
checkRemoveItem(org.apache.jackrabbit.jcr2spi.state.ItemState, int)
methods:
check access rights
public static final int CHECK_LOCK
checkAddNode(org.apache.jackrabbit.jcr2spi.state.NodeState, org.apache.jackrabbit.spi.Name, org.apache.jackrabbit.spi.Name, int)
and
checkRemoveItem(org.apache.jackrabbit.jcr2spi.state.ItemState, int)
methods:
check lock status
public static final int CHECK_VERSIONING
checkAddNode(org.apache.jackrabbit.jcr2spi.state.NodeState, org.apache.jackrabbit.spi.Name, org.apache.jackrabbit.spi.Name, int)
and
checkRemoveItem(org.apache.jackrabbit.jcr2spi.state.ItemState, int)
methods:
check checked-out status
public static final int CHECK_CONSTRAINTS
checkAddNode(org.apache.jackrabbit.jcr2spi.state.NodeState, org.apache.jackrabbit.spi.Name, org.apache.jackrabbit.spi.Name, int)
and
checkRemoveItem(org.apache.jackrabbit.jcr2spi.state.ItemState, int)
methods:
check constraints defined in node type
public static final int CHECK_COLLISION
checkRemoveItem(org.apache.jackrabbit.jcr2spi.state.ItemState, int)
method:
check that target node is not being referenced
public static final int CHECK_NONE
public static final int CHECK_ALL
Constructor Detail |
---|
public ItemStateValidator(ManagerProvider mgrProvider, PathFactory pathFactory)
ItemStateValidator
instance.
mgrProvider
- manager providerMethod Detail |
---|
public void validate(NodeState nodeState) throws ConstraintViolationException, RepositoryException
nodeState
- state of node to be validated
ConstraintViolationException
- if any of the validations fail
RepositoryException
- if another error occurspublic void checkIsWritable(NodeState parentState, int options) throws VersionException, LockException, ItemNotFoundException, ItemExistsException, PathNotFoundException, RepositoryException
parentState
- options
-
VersionException
LockException
ItemNotFoundException
ItemExistsException
PathNotFoundException
RepositoryException
public void checkSetProperty(PropertyState propState, int options) throws ConstraintViolationException, AccessDeniedException, VersionException, LockException, ItemNotFoundException, ItemExistsException, PathNotFoundException, RepositoryException
propState
- options
- bit-wise OR'ed flags specifying the checks that should be
performed; any combination of the following constants:
CHECK_ACCESS
: make sure current session is
granted read access on parent node and can add a child node with the
given name.CHECK_LOCK
: make sure there's no foreign lock
on parent nodeCHECK_VERSIONING
: make sure parent node is
checked-outCHECK_CONSTRAINTS
: make sure no node type
constraints would be violatedCHECK_COLLISION
: check for collision with
existing properties or nodesConstraintViolationException
AccessDeniedException
VersionException
LockException
ItemNotFoundException
ItemExistsException
PathNotFoundException
RepositoryException
public void checkAddProperty(NodeState parentState, Name propertyName, QPropertyDefinition definition, int options) throws ConstraintViolationException, AccessDeniedException, VersionException, LockException, ItemNotFoundException, ItemExistsException, PathNotFoundException, RepositoryException
parentState
- propertyName
- options
- bit-wise OR'ed flags specifying the checks that should be
performed; any combination of the following constants:
CHECK_ACCESS
: make sure current session is
granted read access on parent node and can add a child node with the
given name.CHECK_LOCK
: make sure there's no foreign lock
on parent nodeCHECK_VERSIONING
: make sure parent node is
checked-outCHECK_CONSTRAINTS
: make sure no node type
constraints would be violatedCHECK_COLLISION
: check for collision with
existing properties or nodesConstraintViolationException
AccessDeniedException
VersionException
LockException
ItemNotFoundException
ItemExistsException
PathNotFoundException
RepositoryException
public void checkAddNode(NodeState parentState, Name nodeName, Name nodeTypeName, int options) throws ConstraintViolationException, AccessDeniedException, VersionException, LockException, ItemNotFoundException, ItemExistsException, RepositoryException
nodeName
of node type
nodeTypeName
to the given parent node is allowed in the
current context.
parentState
- nodeName
- nodeTypeName
- options
- bit-wise OR'ed flags specifying the checks that should be
performed; any combination of the following constants:
CHECK_ACCESS
: make sure current session is
granted read access on parent node and can add a child node with the
given name.CHECK_LOCK
: make sure there's no foreign lock
on parent nodeCHECK_VERSIONING
: make sure parent node is
checked-outCHECK_CONSTRAINTS
: make sure no node type
constraints would be violatedCHECK_COLLISION
: check for collision with
existing properties or nodesConstraintViolationException
AccessDeniedException
VersionException
LockException
ItemNotFoundException
ItemExistsException
RepositoryException
public void checkRemoveItem(ItemState targetState, int options) throws ConstraintViolationException, AccessDeniedException, VersionException, LockException, ItemNotFoundException, ReferentialIntegrityException, RepositoryException
targetState
- options
- bit-wise OR'ed flags specifying the checks that should be
performed; any combination of the following constants:
CHECK_ACCESS
: make sure
current session is granted read access on parent
and remove privilege on target nodeCHECK_LOCK
: make sure
there's no foreign lock on parent nodeCHECK_VERSIONING
: make sure
parent node is checked-outCHECK_CONSTRAINTS
:
make sure no node type constraints would be violatedConstraintViolationException
AccessDeniedException
VersionException
LockException
ItemNotFoundException
ReferentialIntegrityException
RepositoryException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |