experiment.entity
Class Node

java.lang.Object
  extended by experiment.entity.Entity
      extended by experiment.entity.Node

public class Node
extends Entity

Created by IntelliJ IDEA. User: andy Date: Mar 10, 2010 Represents an experiment Node and stores all the node's data


Field Summary
static java.lang.String defaultDescription
           
static boolean defaultGateway
           
static java.lang.String defaultNodeType
           
static Position defaultPosition
          Static default variables
static java.lang.String defaultProgDetails
           
 
Fields inherited from class experiment.entity.Entity
capabilityMap, enabled, entity3d, isNode, lock, state
 
Constructor Summary
Node(ExperimentState state, java.lang.String id, Position position, java.lang.String gateway, java.lang.String programDetails, java.lang.String nodeType, java.lang.String description)
          Full Constructor.
 
Method Summary
static void addDefaultCapability(Capability dC)
          Is called during experiment configurarion to set the default node capabilities.
 void addLink(Link link, java.lang.String targetId)
          Adds a link to this Node's linkMap.
 java.lang.String getDescription()
          This method is not synchronized as the description is not expected to change after initialization.
 java.lang.String getId()
          This method is not synchronized as the node id cannot change.
 java.util.Collection<Link> getLinkSet()
           
 java.lang.String getNodeType()
          This method is not synchronized as the Node type is not expected to change after initialization.
 Position getPosition()
           
 java.lang.String getProgramDetails()
          This method is not synchronized as the program Details are not expected to change after initialization.
 Link indexLink(java.lang.String targetId)
          Indexes the links that have this node as source.
 void initialize()
          Set's all Node variables to the default value
 boolean isGateway()
           
 void setGateway(boolean gateway)
          Set the Node as a gateway.
 void setNodeType(java.lang.String nodeType)
          Set the NodeType.
 void updatePosition(Position position)
          Update the Node's position.
 
Methods inherited from class experiment.entity.Entity
getCapability, getCapabilitySet, getEntity3d, getState, isEnabled, isNode, setCapability, setCapability, setEntity3d, setMonitored, setState, setStatus, updated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultDescription

public static java.lang.String defaultDescription

defaultGateway

public static boolean defaultGateway

defaultNodeType

public static java.lang.String defaultNodeType

defaultPosition

public static Position defaultPosition
Static default variables


defaultProgDetails

public static java.lang.String defaultProgDetails
Constructor Detail

Node

public Node(ExperimentState state,
            java.lang.String id,
            Position position,
            java.lang.String gateway,
            java.lang.String programDetails,
            java.lang.String nodeType,
            java.lang.String description)
Full Constructor. Put null to all not available and not required attributes.

Parameters:
state - the object that contains all the data for a given experiment state
id - the node's id
position - the node's position
gateway - it is a Boolean value in a String indicating if the node is a gateway or not. User can specify a default value.
programDetails - contains textual information describing the software image loaded on the node.
nodeType - contains textual information about the type of the device.
description - this is a textual description of the node.
Method Detail

addDefaultCapability

public static void addDefaultCapability(Capability dC)
Is called during experiment configurarion to set the default node capabilities.

Parameters:
dC - the capability to be set

addLink

public void addLink(Link link,
                    java.lang.String targetId)
Adds a link to this Node's linkMap.

Parameters:
link - the link has this node as source
targetId - the id of the link's target Node

getDescription

public java.lang.String getDescription()
This method is not synchronized as the description is not expected to change after initialization.

Returns:
a description of the Node.

getId

public java.lang.String getId()
This method is not synchronized as the node id cannot change.

Returns:
the Node's unique id.

getLinkSet

public java.util.Collection<Link> getLinkSet()
Returns:
a collection of all the Links that have this Node as source.

getNodeType

public java.lang.String getNodeType()
This method is not synchronized as the Node type is not expected to change after initialization.

Returns:
a description of the device.

getPosition

public Position getPosition()
Returns:
the node's current position.

getProgramDetails

public java.lang.String getProgramDetails()
This method is not synchronized as the program Details are not expected to change after initialization.

Returns:
A description of the software image loaded on the node.

indexLink

public Link indexLink(java.lang.String targetId)
Indexes the links that have this node as source.

Parameters:
targetId - the id of the node that is the target of the desired link
Returns:
a Link with this Node as source and the targetId as target

initialize

public void initialize()
Set's all Node variables to the default value


isGateway

public boolean isGateway()
Returns:
true if this Node is a gateway.

setGateway

public void setGateway(boolean gateway)
Set the Node as a gateway.

Parameters:
gateway - true if this is a gateway.

setNodeType

public void setNodeType(java.lang.String nodeType)
Set the NodeType.

Parameters:
nodeType - a String containing the new node type

updatePosition

public void updatePosition(Position position)
Update the Node's position.

Parameters:
position - the new position