nl.uva.vlet.vrs
Interface VComposite

All Known Implementing Classes:
Cluster, MyVLe, VCompositeNode, VDir

public interface VComposite

The Composite interface for VNodes which have 'child nodes' (for example: VDir).

The method VNode.isComposite() can be used to check wether a node has child nodes and implements this interface. Or use the (... instanceof VComposite) construction.


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
 VNode getChild(java.lang.String name)
          Returns Child Node.
 VAttribute[][] getChildAttributes(java.lang.String[] attributeNames)
          Returns attributes for all childs
 VAttribute[][] getChildAttributes(java.lang.String[] childNames, java.lang.String[] attrNames)
          Return attribute matrix for given childs.
 VNode[] getChilds()
          Returns Child Nodes.
 long getNrOfChilds()
          Returns number of child nodes.
 java.lang.String[] getResourceTypes()
          Returns allowed resource types which this node can have as child and/or create.
 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()
           
 

Method Detail

getResourceTypes

java.lang.String[] getResourceTypes()
Returns allowed resource types which this node can have as child and/or create.


getNrOfChilds

long getNrOfChilds()
                   throws VlException
Returns number of child nodes.

Throws:
VlException

getChilds

VNode[] getChilds()
                  throws VlException
Returns Child Nodes.

Throws:
VlException

getChild

VNode getChild(java.lang.String name)
               throws VlException
Returns Child Node.

Throws:
VlException

addNode

VNode addNode(VNode node,
              boolean isMove)
              throws VlException
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.

Parameters:
node -
isMove -
Returns:
new created VNode
Throws:
VlException

addNode

VNode addNode(VNode node,
              java.lang.String newName,
              boolean isMove)
              throws VlException
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.

Parameters:
node -
isMove -
Returns:
new created VNode
Throws:
VlException

addNodes

VNode[] addNodes(VNode[] nodes,
                 boolean isMove)
                 throws VlException
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.

Throws:
VlException

delNode

boolean delNode(VNode node)
                throws VlException
VRS method to delete specified resource Node

Throws:
VlException

delNodes

boolean delNodes(VNode[] nodes)
                 throws VlException
VRS method to delete specified resource Nodes

Throws:
VlException

createChild

VNode createChild(java.lang.String type,
                  java.lang.String name,
                  boolean force)
                  throws VlException
VNode method to create new Child.

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

boolean delete(boolean recurse)
               throws VlException
Recursive delete. The parameter recurse is similiar to the 'rm -r' option.

Parameters:
recurse - whether to delete its children also.
Returns:
Returns true upon succes.
Throws:
VlException

isDeletable

boolean isDeletable()
                    throws VlException
Throws:
VlException

hasChild

boolean hasChild(java.lang.String name)
                 throws VlException
Checks whether this node has a child with the specified name

Throws:
VlException

getChildAttributes

VAttribute[][] getChildAttributes(java.lang.String[] childNames,
                                  java.lang.String[] attrNames)
                                  throws VlException
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 !

Parameters:
childNames - list of child names
attrNames - list of attribute names
Returns:
Throws:
VlException
VlException

getChildAttributes

VAttribute[][] getChildAttributes(java.lang.String[] attributeNames)
                                  throws VlException
Returns attributes for all childs

Throws:
VlException

isAccessable

boolean isAccessable()
                     throws VlException
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).

Throws:
VlException