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:
javax.jcr.Item, javax.jcr.Node
Direct Known Subclasses:
ClientVersion, ClientVersionHistory

public class ClientNode
extends ClientItem
implements javax.jcr.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

Constructor Summary
ClientNode(javax.jcr.Session session, RemoteNode remote, LocalAdapterFactory factory)
          Creates a local adapter for the given remote node.
 
Method Summary
 void accept(javax.jcr.ItemVisitor visitor)
          Calls the ItemVisitor.visit(Node) method of the given visitor.
 void addMixin(String name)
          
 javax.jcr.Node addNode(String path)
          
 javax.jcr.Node addNode(String path, String type)
          
 boolean canAddMixin(String name)
          
 void cancelMerge(javax.jcr.version.Version version)
          
 javax.jcr.version.Version checkin()
          
 void checkout()
          
 void doneMerge(javax.jcr.version.Version version)
          
 javax.jcr.version.Version getBaseVersion()
          
 String getCorrespondingNodePath(String workspace)
          
 javax.jcr.nodetype.NodeDefinition getDefinition()
          
 int getIndex()
          
 javax.jcr.lock.Lock getLock()
          
 javax.jcr.nodetype.NodeType[] getMixinNodeTypes()
          
 javax.jcr.Node getNode(String path)
          
 javax.jcr.NodeIterator getNodes()
          
 javax.jcr.NodeIterator getNodes(String pattern)
          
 javax.jcr.Item getPrimaryItem()
          
 javax.jcr.nodetype.NodeType getPrimaryNodeType()
          
 javax.jcr.PropertyIterator getProperties()
          
 javax.jcr.PropertyIterator getProperties(String pattern)
          
 javax.jcr.Property getProperty(String path)
          
 javax.jcr.PropertyIterator getReferences()
          
 String getUUID()
          
 javax.jcr.version.VersionHistory getVersionHistory()
          
 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)
          
 javax.jcr.lock.Lock lock(boolean isDeep, boolean isSessionScoped)
          
 javax.jcr.NodeIterator merge(String workspace, boolean bestEffort)
          
 void orderBefore(String src, String dst)
          
 void removeMixin(String name)
          
 void restore(String version, boolean removeExisting)
          
 void restore(javax.jcr.version.Version version, boolean removeExisting)
          
 void restore(javax.jcr.version.Version version, String path, boolean removeExisting)
          
 void restoreByLabel(String label, boolean removeExisting)
          
 javax.jcr.Property setProperty(String name, boolean value)
          
 javax.jcr.Property setProperty(String name, Calendar value)
          
 javax.jcr.Property setProperty(String name, double value)
          
 javax.jcr.Property setProperty(String name, InputStream value)
          
 javax.jcr.Property setProperty(String name, long value)
          
 javax.jcr.Property setProperty(String name, javax.jcr.Node value)
          
 javax.jcr.Property setProperty(String name, String value)
          
 javax.jcr.Property setProperty(String name, String[] strings)
          
 javax.jcr.Property setProperty(String name, String[] strings, int type)
          
 javax.jcr.Property setProperty(String name, String value, int type)
          
 javax.jcr.Property setProperty(String name, javax.jcr.Value value)
          
 javax.jcr.Property setProperty(String name, javax.jcr.Value[] values)
          
 javax.jcr.Property setProperty(String name, javax.jcr.Value[] values, int type)
          
 javax.jcr.Property setProperty(String name, javax.jcr.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(javax.jcr.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 javax.jcr.Item
Overrides:
isNode in class ClientItem
Returns:
false

accept

public void accept(javax.jcr.ItemVisitor visitor)
            throws javax.jcr.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 javax.jcr.Item
Overrides:
accept in class ClientItem
Throws:
javax.jcr.RepositoryException

addNode

public javax.jcr.Node addNode(String path)
                       throws javax.jcr.RepositoryException

Specified by:
addNode in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

addNode

public javax.jcr.Node addNode(String path,
                              String type)
                       throws javax.jcr.RepositoryException

Specified by:
addNode in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

orderBefore

public void orderBefore(String src,
                        String dst)
                 throws javax.jcr.RepositoryException

Specified by:
orderBefore in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

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

Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

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

Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

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

Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

public javax.jcr.Property setProperty(String name,
                                      String value)
                               throws javax.jcr.RepositoryException

Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

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

Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

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

Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

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

Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

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

Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

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

Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

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

Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getNode

public javax.jcr.Node getNode(String path)
                       throws javax.jcr.RepositoryException

Specified by:
getNode in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getNodes

public javax.jcr.NodeIterator getNodes()
                                throws javax.jcr.RepositoryException

Specified by:
getNodes in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getNodes

public javax.jcr.NodeIterator getNodes(String pattern)
                                throws javax.jcr.RepositoryException

Specified by:
getNodes in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getProperty

public javax.jcr.Property getProperty(String path)
                               throws javax.jcr.RepositoryException

Specified by:
getProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getProperties

public javax.jcr.PropertyIterator getProperties()
                                         throws javax.jcr.RepositoryException

Specified by:
getProperties in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getProperties

public javax.jcr.PropertyIterator getProperties(String pattern)
                                         throws javax.jcr.RepositoryException

Specified by:
getProperties in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getPrimaryItem

public javax.jcr.Item getPrimaryItem()
                              throws javax.jcr.RepositoryException

Specified by:
getPrimaryItem in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getUUID

public String getUUID()
               throws javax.jcr.RepositoryException

Specified by:
getUUID in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getReferences

public javax.jcr.PropertyIterator getReferences()
                                         throws javax.jcr.RepositoryException

Specified by:
getReferences in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

hasNode

public boolean hasNode(String path)
                throws javax.jcr.RepositoryException

Specified by:
hasNode in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

hasProperty

public boolean hasProperty(String path)
                    throws javax.jcr.RepositoryException

Specified by:
hasProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

hasNodes

public boolean hasNodes()
                 throws javax.jcr.RepositoryException

Specified by:
hasNodes in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

hasProperties

public boolean hasProperties()
                      throws javax.jcr.RepositoryException

Specified by:
hasProperties in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getPrimaryNodeType

public javax.jcr.nodetype.NodeType getPrimaryNodeType()
                                               throws javax.jcr.RepositoryException

Specified by:
getPrimaryNodeType in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getMixinNodeTypes

public javax.jcr.nodetype.NodeType[] getMixinNodeTypes()
                                                throws javax.jcr.RepositoryException

Specified by:
getMixinNodeTypes in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

isNodeType

public boolean isNodeType(String type)
                   throws javax.jcr.RepositoryException

Specified by:
isNodeType in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

addMixin

public void addMixin(String name)
              throws javax.jcr.RepositoryException

Specified by:
addMixin in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

removeMixin

public void removeMixin(String name)
                 throws javax.jcr.RepositoryException

Specified by:
removeMixin in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

canAddMixin

public boolean canAddMixin(String name)
                    throws javax.jcr.RepositoryException

Specified by:
canAddMixin in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getDefinition

public javax.jcr.nodetype.NodeDefinition getDefinition()
                                                throws javax.jcr.RepositoryException

Specified by:
getDefinition in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

checkin

public javax.jcr.version.Version checkin()
                                  throws javax.jcr.RepositoryException

Specified by:
checkin in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

checkout

public void checkout()
              throws javax.jcr.RepositoryException

Specified by:
checkout in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

update

public void update(String workspace)
            throws javax.jcr.RepositoryException

Specified by:
update in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

merge

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

Specified by:
merge in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

cancelMerge

public void cancelMerge(javax.jcr.version.Version version)
                 throws javax.jcr.RepositoryException

Specified by:
cancelMerge in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

doneMerge

public void doneMerge(javax.jcr.version.Version version)
               throws javax.jcr.RepositoryException

Specified by:
doneMerge in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getCorrespondingNodePath

public String getCorrespondingNodePath(String workspace)
                                throws javax.jcr.RepositoryException

Specified by:
getCorrespondingNodePath in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getIndex

public int getIndex()
             throws javax.jcr.RepositoryException

Specified by:
getIndex in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

restore

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

Specified by:
restore in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

restore

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

Specified by:
restore in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

restore

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

Specified by:
restore in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

restoreByLabel

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

Specified by:
restoreByLabel in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

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

Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

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

Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

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

Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

public javax.jcr.Property setProperty(String name,
                                      String value,
                                      int type)
                               throws javax.jcr.RepositoryException

Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

isCheckedOut

public boolean isCheckedOut()
                     throws javax.jcr.RepositoryException

Specified by:
isCheckedOut in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getVersionHistory

public javax.jcr.version.VersionHistory getVersionHistory()
                                                   throws javax.jcr.RepositoryException

Specified by:
getVersionHistory in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getBaseVersion

public javax.jcr.version.Version getBaseVersion()
                                         throws javax.jcr.RepositoryException

Specified by:
getBaseVersion in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

lock

public javax.jcr.lock.Lock lock(boolean isDeep,
                                boolean isSessionScoped)
                         throws javax.jcr.RepositoryException

Specified by:
lock in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getLock

public javax.jcr.lock.Lock getLock()
                            throws javax.jcr.RepositoryException

Specified by:
getLock in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

unlock

public void unlock()
            throws javax.jcr.RepositoryException

Specified by:
unlock in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

holdsLock

public boolean holdsLock()
                  throws javax.jcr.RepositoryException

Specified by:
holdsLock in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

isLocked

public boolean isLocked()
                 throws javax.jcr.RepositoryException

Specified by:
isLocked in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.