nl.uva.vlet.vrs
Class VCompositeNode

java.lang.Object
  extended by nl.uva.vlet.vrs.VNode
      extended by nl.uva.vlet.vrs.VCompositeNode
All Implemented Interfaces:
VComposite
Direct Known Subclasses:
MyVLe

public abstract class VCompositeNode
extends VNode
implements VComposite

Convenvience Adapter class which directly extends VNode and implements some VComposite interface methods.


Field Summary
 
Fields inherited from class nl.uva.vlet.vrs.VNode
ATTR_CHARSET, ATTR_HOSTNAME, ATTR_ICON, ATTR_ISVLINK, ATTR_LOCATION, ATTR_MIMETYPE, ATTR_NAME, ATTR_PATH, ATTR_PORT, ATTR_SCHEME, ATTR_TYPE, location, vrsContext
 
Constructor Summary
VCompositeNode(VRSContext context, VRL vrl)
           
 
Method Summary
 VNode addNode(VNode node, boolean isMove)
          Add a node to the underlaying Resource.
 VNode addNode(VNode node, java.lang.String newName, boolean isMove)
          Add a node to the underlaying Resource with a optional new name.
 VNode[] addNodes(VNode[] nodes, boolean isMove)
          Add specified nodes to the Resource.
 VNode createChild(java.lang.String type, java.lang.String name, boolean force)
          VNode method to create new Child.
 boolean delete(boolean recurse)
          Recursive delete.
 boolean delNode(VNode node)
          VRS method to delete specified resource Node
 boolean delNodes(VNode[] nodes)
          VRS method to delete specified resource Nodes
 boolean exists()
          Whether this node (still) exists
 VNode getChild(java.lang.String name)
          Returns Child Node.
 VAttribute[][] getChildAttributes(java.lang.String[] names)
          Returns attributes for all childs
 VAttribute[][] getChildAttributes(java.lang.String[] childNames, java.lang.String[] names)
          Return attribute matrix for given childs.
 VRL getHelp()
          Returns simple text file or complete HTML page.
 long getNrOfChilds()
          Returns number of child nodes.
 VNode[] getParents()
          Get Parents if the Node is part of a Graph.
 boolean hasChild(java.lang.String name)
          Checks whether this node has a child with the specified name
 boolean isAccessable()
          Override this method if your directory can be accessable but not be 'readable'.
 boolean isDeletable()
           
 
Methods inherited from class nl.uva.vlet.vrs.VNode
compareTo, getAttribute, getAttributeNames, getAttributes, getAttributes, getAttributeSet, getBasename, getCharSet, getHostname, getIconURL, getID, getLocation, getMimeType, getName, getParent, getPath, getPort, getScheme, getServerAttributes, getType, getURI, getVRL, getVRSContext, isComposite, isVirtual, isVLink, mergedGetAttributes, setLocation, setVRL, toLinkNode, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface nl.uva.vlet.vrs.VComposite
getChilds, getResourceTypes
 

Constructor Detail

VCompositeNode

public VCompositeNode(VRSContext context,
                      VRL vrl)
Method Detail

getParents

public VNode[] getParents()
                   throws VlException
Description copied from class: VNode
Get Parents if the Node is part of a Graph.
Returns one parent if Node is part of a Tree or null if Node has no parents.

Overrides:
getParents in class VNode
Throws:
VlException

getNrOfChilds

public long getNrOfChilds()
                   throws VlException
Description copied from interface: VComposite
Returns number of child nodes.

Specified by:
getNrOfChilds in interface VComposite
Throws:
VlException

getChild

public VNode getChild(java.lang.String name)
               throws VlException
Description copied from interface: VComposite
Returns Child Node.

Specified by:
getChild in interface VComposite
Throws:
VlException

addNode

public VNode addNode(VNode node,
                     boolean isMove)
              throws VlException
Description copied from interface: VComposite
Add a node to the underlaying Resource.

For optimization the isMove determines if it is a move, so the implementation can optimize local movements for example on the same filesystems or on the same SRB Server.

Specified by:
addNode in interface VComposite
Returns:
new created VNode
Throws:
VlException

addNodes

public VNode[] addNodes(VNode[] nodes,
                        boolean isMove)
                 throws VlException
Description copied from interface: VComposite
Add specified nodes to the Resource. A drag and drop from the user interface might call this method to add or 'drop' resource nodes to this composite Node.

For optimization the isMove determines if it is a move, so the implementation can optimize local movements for example on the same filesystems.

Specified by:
addNodes in interface VComposite
Throws:
VlException

delNode

public boolean delNode(VNode node)
                throws VlException
Description copied from interface: VComposite
VRS method to delete specified resource Node

Specified by:
delNode in interface VComposite
Throws:
VlException

delNodes

public boolean delNodes(VNode[] nodes)
                 throws VlException
Description copied from interface: VComposite
VRS method to delete specified resource Nodes

Specified by:
delNodes in interface VComposite
Throws:
VlException

hasChild

public boolean hasChild(java.lang.String name)
                 throws VlException
Description copied from interface: VComposite
Checks whether this node has a child with the specified name

Specified by:
hasChild in interface VComposite
Throws:
VlException

getChildAttributes

public VAttribute[][] getChildAttributes(java.lang.String[] childNames,
                                         java.lang.String[] names)
                                  throws VlException
Description copied from interface: VComposite
Return attribute matrix for given childs. The matrix should be in the form: VAttribute[childName][attrname].
Developers note:
Override this method for a faster getall attributes. Also allow for entries in the name and node list to be null ! This is for attribute list merging and optimization !

Specified by:
getChildAttributes in interface VComposite
Parameters:
childNames - list of child names
names - list of attribute names
Returns:
Throws:
VlException

getChildAttributes

public VAttribute[][] getChildAttributes(java.lang.String[] names)
                                  throws VlException
Description copied from interface: VComposite
Returns attributes for all childs

Specified by:
getChildAttributes in interface VComposite
Throws:
VlException

isDeletable

public boolean isDeletable()
                    throws VlException
Specified by:
isDeletable in interface VComposite
Throws:
VlException

isAccessable

public boolean isAccessable()
Description copied from interface: VComposite
Override this method if your directory can be accessable but not be 'readable'. For example a the contents of unix directory may not be 'read' (list() will fails), but each individual file may be accessable (mode= --x).

Specified by:
isAccessable in interface VComposite

exists

public boolean exists()
Description copied from class: VNode
Whether this node (still) exists

Specified by:
exists in class VNode

createChild

public VNode createChild(java.lang.String type,
                         java.lang.String name,
                         boolean force)
                  throws VlException
Description copied from interface: VComposite
VNode method to create new Child.

Specified by:
createChild in interface VComposite
Parameters:
type - must be on of the types getResourceTypes() returns.
name - may be null. The implementation might choose a default name or prompt the user.
force - means to create the child even if it already exists.
Throws:
VlException

delete

public boolean delete(boolean recurse)
               throws VlException
Description copied from interface: VComposite
Recursive delete. The parameter recurse is similiar to the 'rm -r' option.

Specified by:
delete in interface VComposite
Parameters:
recurse - whether to delete its children also.
Returns:
Returns true upon succes.
Throws:
VlException

getHelp

public VRL getHelp()
Description copied from class: VNode
Returns simple text file or complete HTML page. Method should point to installed documentation. Default is to return help about this type.

Overrides:
getHelp in class VNode

addNode

public VNode addNode(VNode node,
                     java.lang.String newName,
                     boolean isMove)
              throws VlException
Description copied from interface: VComposite
Add a node to the underlaying Resource with a optional new name.

For optimization the isMove determines if it is a move, so the implementation can optimize local movements for example on the same filesystems or on the same SRB Server.

Specified by:
addNode in interface VComposite
Returns:
new created VNode
Throws:
VlException