org.apache.jackrabbit.rmi.client
Class ClientNode

java.lang.Object
  extended by org.apache.jackrabbit.rmi.client.ClientObject
      extended by org.apache.jackrabbit.rmi.client.ClientItem
          extended by org.apache.jackrabbit.rmi.client.ClientNode
All Implemented Interfaces:
Item, Node
Direct Known Subclasses:
ClientVersion, ClientVersionHistory

public class ClientNode
extends ClientItem
implements Node

Local adapter for the JCR-RMI RemoteNode interface. This class makes a remote node locally available using the JCR Node interface.

See Also:
Node, RemoteNode

Field Summary
 
Fields inherited from interface javax.jcr.Node
JCR_CHILD_NODE_DEFINITION, JCR_CONTENT, JCR_FROZEN_NODE, JCR_PROPERTY_DEFINITION, JCR_ROOT_VERSION, JCR_VERSION_LABELS
 
Constructor Summary
ClientNode(Session session, RemoteNode remote, LocalAdapterFactory factory)
          Creates a local adapter for the given remote node.
 
Method Summary
 void accept(ItemVisitor visitor)
          Calls the ItemVisitor.visit(Node) method of the given visitor.
 void addMixin(String name)
          
 Node addNode(String path)
          
 Node addNode(String path, String type)
          
 boolean canAddMixin(String name)
          
 void cancelMerge(Version version)
          
 Version checkin()
          
 void checkout()
          
 void doneMerge(Version version)
          
 void followLifecycleTransition(String transition)
           
 String[] getAllowedLifecycleTransistions()
           
 Version getBaseVersion()
          
 String getCorrespondingNodePath(String workspace)
          
 NodeDefinition getDefinition()
          
 String getIdentifier()
          
 int getIndex()
          
 Lock getLock()
          
 NodeType[] getMixinNodeTypes()
          
 Node getNode(String path)
          
 NodeIterator getNodes()
          
 NodeIterator getNodes(String pattern)
          
 NodeIterator getNodes(String[] globs)
          
 Item getPrimaryItem()
          
 NodeType getPrimaryNodeType()
          
 PropertyIterator getProperties()
          
 PropertyIterator getProperties(String pattern)
          
 PropertyIterator getProperties(String[] globs)
          
 Property getProperty(String path)
          
 PropertyIterator getReferences()
          
 PropertyIterator getReferences(String name)
          
 NodeIterator getSharedSet()
           
 String getUUID()
          
 VersionHistory getVersionHistory()
          
 PropertyIterator getWeakReferences()
           
 PropertyIterator getWeakReferences(String name)
           
 boolean hasNode(String path)
          
 boolean hasNodes()
          
 boolean hasProperties()
          
 boolean hasProperty(String path)
          
 boolean holdsLock()
          
 boolean isCheckedOut()
          
 boolean isLocked()
          
 boolean isNode()
          Returns true without contacting the remote node.
 boolean isNodeType(String type)
          
 Lock lock(boolean isDeep, boolean isSessionScoped)
          
 NodeIterator merge(String workspace, boolean bestEffort)
          
 void orderBefore(String src, String dst)
          
 void removeMixin(String name)
          
 void removeShare()
           
 void removeSharedSet()
           
 void restore(String version, boolean removeExisting)
          
 void restore(Version version, boolean removeExisting)
          
 void restore(Version version, String path, boolean removeExisting)
          
 void restoreByLabel(String label, boolean removeExisting)
          
 void setPrimaryType(String nodeTypeName)
           
 Property setProperty(String name, BigDecimal value)
          
 Property setProperty(String name, Binary value)
          
 Property setProperty(String name, boolean value)
          
 Property setProperty(String name, Calendar value)
          
 Property setProperty(String name, double value)
          
 Property setProperty(String name, InputStream value)
          
 Property setProperty(String name, long value)
          
 Property setProperty(String name, Node value)
          
 Property setProperty(String name, String value)
          
 Property setProperty(String name, String[] strings)
          
 Property setProperty(String name, String[] strings, int type)
          
 Property setProperty(String name, String string, int type)
          
 Property setProperty(String name, Value value)
          
 Property setProperty(String name, Value[] values)
          
 Property setProperty(String name, Value[] values, int type)
          
 Property setProperty(String name, Value value, int type)
          
 void unlock()
          
 void update(String workspace)
          
 
Methods inherited from class org.apache.jackrabbit.rmi.client.ClientItem
getAncestor, getDepth, getName, getParent, getPath, getSession, isModified, isNew, isSame, refresh, remove, save
 
Methods inherited from class org.apache.jackrabbit.rmi.client.ClientObject
getFactory, getItem, getNode, getNodeTypeArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jcr.Item
getAncestor, getDepth, getName, getParent, getPath, getSession, isModified, isNew, isSame, refresh, remove, save
 

Constructor Detail

ClientNode

public ClientNode(Session session,
                  RemoteNode remote,
                  LocalAdapterFactory factory)
Creates a local adapter for the given remote node.

Parameters:
session - current session
remote - remote node
factory - local adapter factory
Method Detail

isNode

public boolean isNode()
Returns true without contacting the remote node. Returns false by default without contacting the remote item. This method should be overridden by Node subclasses.

Specified by:
isNode in interface Item
Overrides:
isNode in class ClientItem
Returns:
false

accept

public void accept(ItemVisitor visitor)
            throws RepositoryException
Calls the ItemVisitor.visit(Node) method of the given visitor. Does not contact the remote node, but the visitor may invoke other methods that do contact the remote node. Accepts the visitor to visit this item. Node and Property subclasses should override this method to call the appropriate ItemVisitor methods, as the default implementation does nothing.

Specified by:
accept in interface Item
Overrides:
accept in class ClientItem
Throws:
RepositoryException

addNode

public Node addNode(String path)
             throws RepositoryException

Specified by:
addNode in interface Node
Throws:
RepositoryException

addNode

public Node addNode(String path,
                    String type)
             throws RepositoryException

Specified by:
addNode in interface Node
Throws:
RepositoryException

orderBefore

public void orderBefore(String src,
                        String dst)
                 throws RepositoryException

Specified by:
orderBefore in interface Node
Throws:
RepositoryException

setProperty

public Property setProperty(String name,
                            Value value)
                     throws RepositoryException

Specified by:
setProperty in interface Node
Throws:
RepositoryException

setProperty

public Property setProperty(String name,
                            Value[] values)
                     throws RepositoryException

Specified by:
setProperty in interface Node
Throws:
RepositoryException

setProperty

public Property setProperty(String name,
                            String[] strings)
                     throws RepositoryException

Specified by:
setProperty in interface Node
Throws:
RepositoryException

setProperty

public Property setProperty(String name,
                            String value)
                     throws RepositoryException

Specified by:
setProperty in interface Node
Throws:
RepositoryException

setProperty

public Property setProperty(String name,
                            InputStream value)
                     throws RepositoryException

Specified by:
setProperty in interface Node
Throws:
RepositoryException

setProperty

public Property setProperty(String name,
                            boolean value)
                     throws RepositoryException

Specified by:
setProperty in interface Node
Throws:
RepositoryException

setProperty

public Property setProperty(String name,
                            double value)
                     throws RepositoryException

Specified by:
setProperty in interface Node
Throws:
RepositoryException

setProperty

public Property setProperty(String name,
                            long value)
                     throws RepositoryException

Specified by:
setProperty in interface Node
Throws:
RepositoryException

setProperty

public Property setProperty(String name,
                            Calendar value)
                     throws RepositoryException

Specified by:
setProperty in interface Node
Throws:
RepositoryException

setProperty

public Property setProperty(String name,
                            Node value)
                     throws RepositoryException

Specified by:
setProperty in interface Node
Throws:
RepositoryException

setProperty

public Property setProperty(String name,
                            Binary value)
                     throws RepositoryException

Specified by:
setProperty in interface Node
Throws:
RepositoryException

setProperty

public Property setProperty(String name,
                            BigDecimal value)
                     throws RepositoryException

Specified by:
setProperty in interface Node
Throws:
RepositoryException

getNode

public Node getNode(String path)
             throws RepositoryException

Specified by:
getNode in interface Node
Throws:
RepositoryException

getNodes

public NodeIterator getNodes()
                      throws RepositoryException

Specified by:
getNodes in interface Node
Throws:
RepositoryException

getNodes

public NodeIterator getNodes(String pattern)
                      throws RepositoryException

Specified by:
getNodes in interface Node
Throws:
RepositoryException

getNodes

public NodeIterator getNodes(String[] globs)
                      throws RepositoryException

Specified by:
getNodes in interface Node
Throws:
RepositoryException

getProperty

public Property getProperty(String path)
                     throws RepositoryException

Specified by:
getProperty in interface Node
Throws:
RepositoryException

getProperties

public PropertyIterator getProperties()
                               throws RepositoryException

Specified by:
getProperties in interface Node
Throws:
RepositoryException

getProperties

public PropertyIterator getProperties(String pattern)
                               throws RepositoryException

Specified by:
getProperties in interface Node
Throws:
RepositoryException

getProperties

public PropertyIterator getProperties(String[] globs)
                               throws RepositoryException

Specified by:
getProperties in interface Node
Throws:
RepositoryException

getPrimaryItem

public Item getPrimaryItem()
                    throws RepositoryException

Specified by:
getPrimaryItem in interface Node
Throws:
RepositoryException

getIdentifier

public String getIdentifier()
                     throws RepositoryException

Specified by:
getIdentifier in interface Node
Throws:
RepositoryException

getUUID

public String getUUID()
               throws RepositoryException

Specified by:
getUUID in interface Node
Throws:
RepositoryException

getReferences

public PropertyIterator getReferences()
                               throws RepositoryException

Specified by:
getReferences in interface Node
Throws:
RepositoryException

getReferences

public PropertyIterator getReferences(String name)
                               throws RepositoryException

Specified by:
getReferences in interface Node
Throws:
RepositoryException

hasNode

public boolean hasNode(String path)
                throws RepositoryException

Specified by:
hasNode in interface Node
Throws:
RepositoryException

hasProperty

public boolean hasProperty(String path)
                    throws RepositoryException

Specified by:
hasProperty in interface Node
Throws:
RepositoryException

hasNodes

public boolean hasNodes()
                 throws RepositoryException

Specified by:
hasNodes in interface Node
Throws:
RepositoryException

hasProperties

public boolean hasProperties()
                      throws RepositoryException

Specified by:
hasProperties in interface Node
Throws:
RepositoryException

getPrimaryNodeType

public NodeType getPrimaryNodeType()
                            throws RepositoryException

Specified by:
getPrimaryNodeType in interface Node
Throws:
RepositoryException

getMixinNodeTypes

public NodeType[] getMixinNodeTypes()
                             throws RepositoryException

Specified by:
getMixinNodeTypes in interface Node
Throws:
RepositoryException

isNodeType

public boolean isNodeType(String type)
                   throws RepositoryException

Specified by:
isNodeType in interface Node
Throws:
RepositoryException

addMixin

public void addMixin(String name)
              throws RepositoryException

Specified by:
addMixin in interface Node
Throws:
RepositoryException

removeMixin

public void removeMixin(String name)
                 throws RepositoryException

Specified by:
removeMixin in interface Node
Throws:
RepositoryException

canAddMixin

public boolean canAddMixin(String name)
                    throws RepositoryException

Specified by:
canAddMixin in interface Node
Throws:
RepositoryException

getDefinition

public NodeDefinition getDefinition()
                             throws RepositoryException

Specified by:
getDefinition in interface Node
Throws:
RepositoryException

checkin

public Version checkin()
                throws RepositoryException

Specified by:
checkin in interface Node
Throws:
RepositoryException

checkout

public void checkout()
              throws RepositoryException

Specified by:
checkout in interface Node
Throws:
RepositoryException

update

public void update(String workspace)
            throws RepositoryException

Specified by:
update in interface Node
Throws:
RepositoryException

merge

public NodeIterator merge(String workspace,
                          boolean bestEffort)
                   throws RepositoryException

Specified by:
merge in interface Node
Throws:
RepositoryException

cancelMerge

public void cancelMerge(Version version)
                 throws RepositoryException

Specified by:
cancelMerge in interface Node
Throws:
RepositoryException

doneMerge

public void doneMerge(Version version)
               throws RepositoryException

Specified by:
doneMerge in interface Node
Throws:
RepositoryException

getCorrespondingNodePath

public String getCorrespondingNodePath(String workspace)
                                throws RepositoryException

Specified by:
getCorrespondingNodePath in interface Node
Throws:
RepositoryException

getIndex

public int getIndex()
             throws RepositoryException

Specified by:
getIndex in interface Node
Throws:
RepositoryException

restore

public void restore(String version,
                    boolean removeExisting)
             throws RepositoryException

Specified by:
restore in interface Node
Throws:
RepositoryException

restore

public void restore(Version version,
                    boolean removeExisting)
             throws RepositoryException

Specified by:
restore in interface Node
Throws:
RepositoryException

restore

public void restore(Version version,
                    String path,
                    boolean removeExisting)
             throws RepositoryException

Specified by:
restore in interface Node
Throws:
RepositoryException

restoreByLabel

public void restoreByLabel(String label,
                           boolean removeExisting)
                    throws RepositoryException

Specified by:
restoreByLabel in interface Node
Throws:
RepositoryException

setProperty

public Property setProperty(String name,
                            String[] strings,
                            int type)
                     throws RepositoryException

Specified by:
setProperty in interface Node
Throws:
RepositoryException

setProperty

public Property setProperty(String name,
                            Value[] values,
                            int type)
                     throws RepositoryException

Specified by:
setProperty in interface Node
Throws:
RepositoryException

setProperty

public Property setProperty(String name,
                            Value value,
                            int type)
                     throws RepositoryException

Specified by:
setProperty in interface Node
Throws:
RepositoryException

setProperty

public Property setProperty(String name,
                            String string,
                            int type)
                     throws RepositoryException

Specified by:
setProperty in interface Node
Throws:
RepositoryException

isCheckedOut

public boolean isCheckedOut()
                     throws RepositoryException

Specified by:
isCheckedOut in interface Node
Throws:
RepositoryException

getVersionHistory

public VersionHistory getVersionHistory()
                                 throws RepositoryException

Specified by:
getVersionHistory in interface Node
Throws:
RepositoryException

getBaseVersion

public Version getBaseVersion()
                       throws RepositoryException

Specified by:
getBaseVersion in interface Node
Throws:
RepositoryException

lock

public Lock lock(boolean isDeep,
                 boolean isSessionScoped)
          throws RepositoryException

Specified by:
lock in interface Node
Throws:
RepositoryException

getLock

public Lock getLock()
             throws RepositoryException

Specified by:
getLock in interface Node
Throws:
RepositoryException

unlock

public void unlock()
            throws RepositoryException

Specified by:
unlock in interface Node
Throws:
RepositoryException

holdsLock

public boolean holdsLock()
                  throws RepositoryException

Specified by:
holdsLock in interface Node
Throws:
RepositoryException

isLocked

public boolean isLocked()
                 throws RepositoryException

Specified by:
isLocked in interface Node
Throws:
RepositoryException

followLifecycleTransition

public void followLifecycleTransition(String transition)
                               throws RepositoryException
Specified by:
followLifecycleTransition in interface Node
Throws:
RepositoryException

getAllowedLifecycleTransistions

public String[] getAllowedLifecycleTransistions()
                                         throws RepositoryException
Specified by:
getAllowedLifecycleTransistions in interface Node
Throws:
RepositoryException

getSharedSet

public NodeIterator getSharedSet()
                          throws RepositoryException
Specified by:
getSharedSet in interface Node
Throws:
RepositoryException

getWeakReferences

public PropertyIterator getWeakReferences()
                                   throws RepositoryException
Specified by:
getWeakReferences in interface Node
Throws:
RepositoryException

getWeakReferences

public PropertyIterator getWeakReferences(String name)
                                   throws RepositoryException
Specified by:
getWeakReferences in interface Node
Throws:
RepositoryException

removeShare

public void removeShare()
                 throws RepositoryException
Specified by:
removeShare in interface Node
Throws:
RepositoryException

removeSharedSet

public void removeSharedSet()
                     throws RepositoryException
Specified by:
removeSharedSet in interface Node
Throws:
RepositoryException

setPrimaryType

public void setPrimaryType(String nodeTypeName)
                    throws RepositoryException
Specified by:
setPrimaryType in interface Node
Throws:
RepositoryException


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