nl.uva.vlet.vrs
Class Cluster

java.lang.Object
  extended by nl.uva.vlet.vrs.VNode
      extended by nl.uva.vlet.vrs.Cluster
All Implemented Interfaces:
VComposite

public abstract class Cluster
extends VNode
implements VComposite

Cluster resource VNode interface to the Registry.


Nested Class Summary
 class Cluster.ClusterElement
           
 
Field Summary
static java.lang.String CLUSTER_TYPE
           
static java.lang.String SERVICE_TYPE
           
 
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
protected Cluster(VRSContext vrs, java.lang.String name, java.lang.String root_host)
           
 
Method Summary
 VNode addNode(VNode node)
          Adds (Sub) Cluster to the registry.
 VNode addNode(VNode node, boolean isMove)
          Add a node to the underlaying Resource.
 VNode[] addNodes(VNode[] nodes, boolean isMove)
          Add specified nodes to the Resource.
 VNode createChild(java.lang.String type)
           
 VNode createChild(java.lang.String type, boolean force)
           
 VNode createChild(java.lang.String type, java.lang.String name)
           
 VNode createChild(java.lang.String type, java.lang.String name, boolean force)
          VNode method to create new Child.
static Cluster createDas2()
          Default das2 Cluster Factory
 boolean delete()
           
 boolean delete(boolean recurse)
          Recursive delete.
 boolean delNode(VNode node)
          Removes (Sub) Cluster/Service to the registry.
 boolean delNodes(VNode[] nodes)
          Removes (Sub) Clusters/Services from the registry.
 VAttribute getAttribute(java.lang.String name)
          This is the single method a Node has to implement so that attributes can be fetched.
 java.lang.String[] getAttributeNames()
          Get the names of the attributes this resource has
 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.
 java.lang.String getType()
          Returns resource type, if it has one
 boolean isComposite()
          Highlevel method to check whether the node has the VComposite interface
 boolean setAttribute(VAttribute attr)
           
 
Methods inherited from class nl.uva.vlet.vrs.VNode
compareTo, exists, getAttributes, getAttributes, getAttributeSet, getBasename, getCharSet, getHelp, getHostname, getIconURL, getID, getLocation, getMimeType, getName, getParent, getParents, getPath, getPort, getScheme, getServerAttributes, getURI, getVRL, getVRSContext, 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
addNode, getChild, getChildAttributes, getChildAttributes, hasChild, isAccessable, isDeletable
 

Field Detail

CLUSTER_TYPE

public static final java.lang.String CLUSTER_TYPE
See Also:
Constant Field Values

SERVICE_TYPE

public static final java.lang.String SERVICE_TYPE
See Also:
Constant Field Values
Constructor Detail

Cluster

protected Cluster(VRSContext vrs,
                  java.lang.String name,
                  java.lang.String root_host)
Method Detail

getType

public java.lang.String getType()
Description copied from class: VNode
Returns resource type, if it has one

Specified by:
getType in class VNode

createDas2

public static Cluster createDas2()
                          throws VlException
Default das2 Cluster Factory

Throws:
VlException

getResourceTypes

public java.lang.String[] getResourceTypes()
Description copied from interface: VComposite
Returns allowed resource types which this node can have as child and/or create.

Specified by:
getResourceTypes in interface VComposite

getNrOfChilds

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

Specified by:
getNrOfChilds in interface VComposite

getChilds

public VNode[] getChilds()
Description copied from interface: VComposite
Returns Child Nodes.

Specified by:
getChilds in interface VComposite

isComposite

public boolean isComposite()
Description copied from class: VNode
Highlevel method to check whether the node has the VComposite interface

Overrides:
isComposite in class VNode

getAttributeNames

public java.lang.String[] getAttributeNames()
Description copied from class: VNode
Get the names of the attributes this resource has

Overrides:
getAttributeNames in class VNode

getAttribute

public VAttribute getAttribute(java.lang.String name)
Description copied from class: VNode
This is the single method a Node has to implement so that attributes can be fetched. subclasses can override this method and do a super.getAttribute first to check whether the superclass provides an attribute name.

Overrides:
getAttribute in class VNode

setAttribute

public boolean setAttribute(VAttribute attr)
                     throws NotImplementedException
Throws:
NotImplementedException

addNode

public VNode addNode(VNode node)
              throws VlException
Adds (Sub) Cluster to the registry.

Throws:
VlException

delNode

public boolean delNode(VNode node)
                throws VlException
Removes (Sub) Cluster/Service to the registry.

Specified by:
delNode in interface VComposite
Throws:
VlException

delNodes

public boolean delNodes(VNode[] nodes)
                 throws VlException
Removes (Sub) Clusters/Services from the registry.

Specified by:
delNodes in interface VComposite
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

delete

public boolean delete()
               throws VlException
Throws:
VlException

createChild

public VNode createChild(java.lang.String type)
                  throws VlException
Throws:
VlException

createChild

public VNode createChild(java.lang.String type,
                         java.lang.String name)
                  throws VlException
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

createChild

public VNode createChild(java.lang.String type,
                         boolean force)
                  throws VlException
Throws:
VlException

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