|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jackrabbit.core.virtual.AbstractVISProvider
public abstract class AbstractVISProvider
This Class implements a virtual item state provider, in order to expose the versions to the version storage.
Field Summary | |
---|---|
protected NodeTypeRegistry |
ntReg
the node type registry |
protected NodeId |
rootNodeId
the root node id |
Constructor Summary | |
---|---|
AbstractVISProvider(NodeTypeRegistry ntReg,
NodeId rootNodeId)
Creates an abstract virtual item state provider |
Method Summary | |
---|---|
void |
addListener(ItemStateListener listener)
Add an ItemStateListener |
protected NodeState |
cache(NodeState state)
adds the node state to the cache |
VirtualNodeState |
createNodeState(VirtualNodeState parent,
Name name,
NodeId id,
Name nodeTypeName)
Creates a new virtual node state |
VirtualPropertyState |
createPropertyState(VirtualNodeState parent,
Name name,
int type,
boolean multiValued)
Creats a new virtual property state |
protected abstract VirtualNodeState |
createRootNodeState()
Creates the root node state. |
protected void |
evict(NodeId id)
removes the node state from the cache |
protected NodeDef |
getApplicableChildNodeDef(NodeState parent,
Name nodeName,
Name nodeTypeName)
Retrieves the node definition for the given contraints. |
protected PropDef |
getApplicablePropertyDef(NodeState parent,
Name propertyName,
int type,
boolean multiValued)
retrieves the property definition for the given contraints |
protected EffectiveNodeType |
getEffectiveNodeType(NodeState parent)
Returns the effective (i.e. merged and resolved) node type representation of this node's primary and mixin node types. |
ItemState |
getItemState(ItemId id)
Return an item state, given its item id. |
NodeReferences |
getNodeReferences(NodeReferencesId id)
Return a node references object, given its target id |
protected NodeTypeRegistry |
getNodeTypeRegistry()
returns the node type manager |
NodeState |
getRootState()
Returns the root state |
NodeId |
getVirtualRootId()
Returns the id of the root node of the virtual tree. |
boolean |
hasItemState(ItemId id)
Return a flag indicating whether an item state for a given item id exists. |
boolean |
hasNodeReferences(NodeReferencesId id)
Return a flag indicating whether a node references object for a given target id exists. |
protected abstract VirtualNodeState |
internalGetNodeState(NodeId id)
Retrieves the node state with the given node id |
protected VirtualPropertyState |
internalGetPropertyState(PropertyId id)
Retrieces the property state for the given id |
protected abstract boolean |
internalHasNodeState(NodeId id)
Checks if this provide has the node state of the given node id |
protected boolean |
internalHasPropertyState(PropertyId id)
Checks if this provider has the property state of the given id. |
void |
invalidateItem(ItemId id,
boolean recursive)
invalidates the item |
boolean |
isVirtualRoot(ItemId id)
Checks if the id refers to the root of a virtual tree. |
void |
removeListener(ItemStateListener listener)
Remove an ItemStateListener |
void |
stateCreated(ItemState created)
Called when an ItemState has successfully
been created (i.e. its underlying persistent state was created). |
void |
stateDestroyed(ItemState destroyed)
Called when an ItemState has successfully been
removed (i.e. its underlying persistent state has been destroyed). |
void |
stateDiscarded(ItemState discarded)
Called when an ItemState has been discarded (i.e. it has
been rendered 'invalid'). |
void |
stateModified(ItemState modified)
Called when an ItemState has successfully
been modified (i.e. its underlying persistent state has changed). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.jackrabbit.core.virtual.VirtualItemStateProvider |
---|
setNodeReferences |
Field Detail |
---|
protected final NodeId rootNodeId
protected final NodeTypeRegistry ntReg
Constructor Detail |
---|
public AbstractVISProvider(NodeTypeRegistry ntReg, NodeId rootNodeId)
ntReg
- rootNodeId
- Method Detail |
---|
protected abstract VirtualNodeState createRootNodeState() throws RepositoryException
RepositoryException
public boolean hasItemState(ItemId id)
hasItemState
in interface ItemStateManager
id
- item id
true
if an item state exists,
otherwise false
public ItemState getItemState(ItemId id) throws NoSuchItemStateException, ItemStateException
getItemState
in interface ItemStateManager
id
- item id
NoSuchItemStateException
- if the item does not exist
ItemStateException
- if an error occurspublic NodeReferences getNodeReferences(NodeReferencesId id) throws NoSuchItemStateException, ItemStateException
getNodeReferences
in interface ItemStateManager
id
- target id
NoSuchItemStateException
- if the item does not exist
ItemStateException
- if an error occurspublic boolean hasNodeReferences(NodeReferencesId id)
hasNodeReferences
in interface ItemStateManager
id
- target id
true
if a node reference object exists for the given
id, otherwise false
.public boolean isVirtualRoot(ItemId id)
isVirtualRoot
in interface VirtualItemStateProvider
true
if it is the rootpublic NodeId getVirtualRootId()
getVirtualRootId
in interface VirtualItemStateProvider
public NodeState getRootState() throws ItemStateException
ItemStateException
protected abstract boolean internalHasNodeState(NodeId id)
id
-
true
if it has the node stateprotected abstract VirtualNodeState internalGetNodeState(NodeId id) throws NoSuchItemStateException, ItemStateException
id
-
NoSuchItemStateException
ItemStateException
protected boolean internalHasPropertyState(PropertyId id)
id
-
true
if it has the property stateprotected VirtualPropertyState internalGetPropertyState(PropertyId id) throws NoSuchItemStateException, ItemStateException
id
-
NoSuchItemStateException
ItemStateException
public VirtualPropertyState createPropertyState(VirtualNodeState parent, Name name, int type, boolean multiValued) throws RepositoryException
createPropertyState
in interface VirtualItemStateProvider
RepositoryException
public VirtualNodeState createNodeState(VirtualNodeState parent, Name name, NodeId id, Name nodeTypeName) throws RepositoryException
createNodeState
in interface VirtualItemStateProvider
RepositoryException
public void addListener(ItemStateListener listener)
ItemStateListener
addListener
in interface VirtualItemStateProvider
listener
- the new listener to be informed on modificationspublic void removeListener(ItemStateListener listener)
ItemStateListener
removeListener
in interface VirtualItemStateProvider
listener
- an existing listenerprotected NodeTypeRegistry getNodeTypeRegistry()
protected NodeState cache(NodeState state)
state
- protected void evict(NodeId id)
id
- public void invalidateItem(ItemId id, boolean recursive)
id
- protected PropDef getApplicablePropertyDef(NodeState parent, Name propertyName, int type, boolean multiValued) throws RepositoryException
propertyName
- type
- multiValued
-
RepositoryException
protected NodeDef getApplicableChildNodeDef(NodeState parent, Name nodeName, Name nodeTypeName) throws RepositoryException
nodeName
- nodeTypeName
-
RepositoryException
protected EffectiveNodeType getEffectiveNodeType(NodeState parent) throws RepositoryException
RepositoryException
public void stateCreated(ItemState created)
ItemState
has successfully
been created (i.e. its underlying persistent state was created).
stateCreated
in interface ItemStateListener
created
- the ItemState
that has been 'created'public void stateModified(ItemState modified)
ItemState
has successfully
been modified (i.e. its underlying persistent state has changed).
stateModified
in interface ItemStateListener
modified
- the ItemState
that has been 'modified'public void stateDestroyed(ItemState destroyed)
ItemState
has successfully been
removed (i.e. its underlying persistent state has been destroyed).
stateDestroyed
in interface ItemStateListener
destroyed
- the ItemState
that has been 'destroyed'public void stateDiscarded(ItemState discarded)
ItemState
has been discarded (i.e. it has
been rendered 'invalid').
stateDiscarded
in interface ItemStateListener
discarded
- the ItemState
that has been discardedItemState.discard()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |