public class ItemStateValidator extends Object
Modifier and Type | Field and Description |
---|---|
static int |
CHECK_ACCESS
|
static int |
CHECK_ALL |
static int |
CHECK_COLLISION
option for
method: |
static int |
CHECK_CONSTRAINTS
|
static int |
CHECK_LOCK
|
static int |
CHECK_NONE |
static int |
CHECK_VERSIONING
|
Constructor and Description |
---|
ItemStateValidator(ManagerProvider mgrProvider,
PathFactory pathFactory)
Creates a new
ItemStateValidator instance. |
Modifier and Type | Method and Description |
---|---|
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.
|
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
public ItemStateValidator(ManagerProvider mgrProvider, PathFactory pathFactory)
ItemStateValidator
instance.mgrProvider
- manager providerpublic void validate(NodeState nodeState) throws ConstraintViolationException, RepositoryException
nodeState
- state of node to be validatedConstraintViolationException
- if any of the validations failRepositoryException
- 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
Copyright © 2004–2024 The Apache Software Foundation. All rights reserved.