org.apache.jackrabbit.core.version
Class VersionItemStateProvider

java.lang.Object
  extended byorg.apache.jackrabbit.core.version.VersionItemStateProvider
All Implemented Interfaces:
ItemStateListener, ItemStateManager, VirtualItemStateProvider

public class VersionItemStateProvider
extends Object
implements VirtualItemStateProvider

This Class implements a virtual item state provider.


Constructor Summary
VersionItemStateProvider(VersionManagerImpl vMgr, SharedItemStateManager stateMgr)
          Creates a bew vesuion manager
 
Method Summary
 VirtualNodeState createNodeState(VirtualNodeState parent, QName name, String uuid, QName nodeTypeName)
          Creates a new virtual node state
 VirtualPropertyState createPropertyState(VirtualNodeState parent, QName name, int type, boolean multiValued)
          Creats a new virtual property state
 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
 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.
 boolean isVirtualRoot(ItemId id)
          Checks if the id refers to the root of a virtual tree.
 boolean setNodeReferences(NodeReferences refs)
          Informs this provider that the node references to one of its states has changed.
 void stateCreated(ItemState created)
          Called when an ItemState has successfully been created (i.e.
 void stateDestroyed(ItemState destroyed)
          Called when an ItemState has successfully been removed (i.e.
 void stateDiscarded(ItemState discarded)
          Called when an ItemState has been discarded (i.e.
 void stateModified(ItemState modified)
          Called when an ItemState has successfully been modified (i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VersionItemStateProvider

public VersionItemStateProvider(VersionManagerImpl vMgr,
                                SharedItemStateManager stateMgr)
Creates a bew vesuion manager

Method Detail

isVirtualRoot

public boolean isVirtualRoot(ItemId id)
Description copied from interface: VirtualItemStateProvider
Checks if the id refers to the root of a virtual tree.

Specified by:
isVirtualRoot in interface VirtualItemStateProvider
Parameters:
id -
Returns:

getVirtualRootId

public NodeId getVirtualRootId()
Description copied from interface: VirtualItemStateProvider
Returns the id of the root node of the virtual tree.

Specified by:
getVirtualRootId in interface VirtualItemStateProvider
Returns:

createPropertyState

public VirtualPropertyState createPropertyState(VirtualNodeState parent,
                                                QName name,
                                                int type,
                                                boolean multiValued)
                                         throws RepositoryException
Description copied from interface: VirtualItemStateProvider
Creats a new virtual property state

Specified by:
createPropertyState in interface VirtualItemStateProvider
Parameters:
parent -
name -
type -
multiValued -
Returns:
Throws:
RepositoryException

createNodeState

public VirtualNodeState createNodeState(VirtualNodeState parent,
                                        QName name,
                                        String uuid,
                                        QName nodeTypeName)
                                 throws RepositoryException
Description copied from interface: VirtualItemStateProvider
Creates a new virtual node state

Specified by:
createNodeState in interface VirtualItemStateProvider
Parameters:
parent -
name -
uuid -
nodeTypeName -
Returns:
Throws:
RepositoryException

getItemState

public ItemState getItemState(ItemId id)
                       throws NoSuchItemStateException,
                              ItemStateException
Description copied from interface: ItemStateManager
Return an item state, given its item id.

Specified by:
getItemState in interface ItemStateManager
Parameters:
id - item id
Returns:
item state
Throws:
NoSuchItemStateException - if the item does not exist
ItemStateException - if an error occurs

setNodeReferences

public boolean setNodeReferences(NodeReferences refs)
Description copied from interface: VirtualItemStateProvider
Informs this provider that the node references to one of its states has changed.

Specified by:
setNodeReferences in interface VirtualItemStateProvider
Parameters:
refs -
Returns:
true if the reference target is one of its items.

hasItemState

public boolean hasItemState(ItemId id)
Description copied from interface: ItemStateManager
Return a flag indicating whether an item state for a given item id exists.

Specified by:
hasItemState in interface ItemStateManager
Parameters:
id - item id
Returns:
true if an item state exists, otherwise false

getNodeReferences

public NodeReferences getNodeReferences(NodeReferencesId id)
                                 throws NoSuchItemStateException,
                                        ItemStateException
Description copied from interface: ItemStateManager
Return a node references object, given its target id

Specified by:
getNodeReferences in interface ItemStateManager
Parameters:
id - target id
Returns:
node references object
Throws:
NoSuchItemStateException - if the item does not exist
ItemStateException - if an error occurs

hasNodeReferences

public boolean hasNodeReferences(NodeReferencesId id)
Description copied from interface: ItemStateManager
Return a flag indicating whether a node references object for a given target id exists.

Specified by:
hasNodeReferences in interface ItemStateManager
Parameters:
id - target id
Returns:
true if an item state exists, otherwise false

stateCreated

public void stateCreated(ItemState created)
Description copied from interface: ItemStateListener
Called when an ItemState has successfully been created (i.e. its underlying persistent state was created).

Specified by:
stateCreated in interface ItemStateListener
Parameters:
created - the ItemState that has been 'created'

stateModified

public void stateModified(ItemState modified)
Description copied from interface: ItemStateListener
Called when an ItemState has successfully been modified (i.e. its underlying persistent state has changed).

Specified by:
stateModified in interface ItemStateListener
Parameters:
modified - the ItemState that has been 'modified'

stateDestroyed

public void stateDestroyed(ItemState destroyed)
Description copied from interface: ItemStateListener
Called when an ItemState has successfully been removed (i.e. its underlying persistent state has been destroyed).

Specified by:
stateDestroyed in interface ItemStateListener
Parameters:
destroyed - the ItemState that has been 'destroyed'

stateDiscarded

public void stateDiscarded(ItemState discarded)
Description copied from interface: ItemStateListener
Called when an ItemState has been discarded (i.e. it has been rendered 'invalid').

Specified by:
stateDiscarded in interface ItemStateListener
Parameters:
discarded - the ItemState that has been discarded
See Also:
ItemState.discard()


Copyright © 2004-2005 The Apache Software Foundation. All Rights Reserved.