be.ac.ulg.montefiore.run.totem.domain.model.impl
Class NodeImpl

java.lang.Object
  extended by be.ac.ulg.montefiore.run.totem.domain.model.jaxb.impl.NodeImpl
      extended by be.ac.ulg.montefiore.run.totem.domain.model.impl.NodeImpl
All Implemented Interfaces:
DomainElement, Node, UnmarshallableObject, ValidatableObject, XMLSerializable, com.sun.xml.bind.JAXBObject

public class NodeImpl
extends NodeImpl
implements Node

Represent a Node in a Domain

Creation date: 19-Jan-2005 15:46:33

Author:
Fabian Skivee (skivee@run.montefiore.ulg.ac.be)

Nested Class Summary
 
Nested classes/interfaces inherited from class be.ac.ulg.montefiore.run.totem.domain.model.jaxb.impl.NodeImpl
NodeImpl.InterfacesTypeImpl, NodeImpl.LocationTypeImpl, NodeImpl.Unmarshaller
 
Nested classes/interfaces inherited from interface be.ac.ulg.montefiore.run.totem.domain.model.Node
Node.Type
 
Nested classes/interfaces inherited from interface be.ac.ulg.montefiore.run.totem.domain.model.jaxb.Node
Node.InterfacesType, Node.LocationType
 
Field Summary
 
Fields inherited from class be.ac.ulg.montefiore.run.totem.domain.model.jaxb.impl.NodeImpl
_Description, _Id, _Interfaces, _Location, _Rid, _Status, _Type, version
 
Fields inherited from interface be.ac.ulg.montefiore.run.totem.domain.model.Node
STATUS_DOWN, STATUS_UP
 
Constructor Summary
NodeImpl()
           
NodeImpl(Domain domain, java.lang.String nodeId)
          Create a node
 
Method Summary
 void addInLink(Link l)
          Initialisation method: Add a link to the list of incoming links.
 void addNodeInterface(NodeInterface nodeInterface)
           
 void addOutLink(Link l)
          Initialisation method: Add a link to the list of outcoming links.
 void delInLink(Link l)
          Initialisation method: Remove a link from the list of incoming links.
 void delOutLink(Link l)
          Initialisation method: Remove a link from the list of outcoming links.
 boolean equals(java.lang.Object o)
           
 java.util.List<Link> getAllInLink()
          Return the list of the links that ends at this node.
 java.util.List<java.lang.String> getallIPs()
           
 java.util.List<Link> getAllOutLink()
          Return the list of the links that begins at this node.
 BgpRouter getBgpRouter()
          Returns the BGP router associated with this node.
 java.util.List<Link> getInLink()
          Return the list of the links that ends at this node and for which status is UP.
 float getLatitude()
          Get the latitude of a node and 0 if not defined
 float getLongitude()
          Get the longitude of a node and 0 if not defined
 NodeInterface getNodeInterface(java.lang.String nodeInterfaceId)
           
 NodeInterface getNodeInterfaceByIP(java.lang.String nodeInterfaceIP)
           
 java.util.List<NodeInterface> getNodeInterfaces()
           
 int getNodeStatus()
          Get the status of the node
 Node.Type getNodeType()
          Gets the type of the node.
 java.util.List<Link> getOutLink()
          Return the list of the links that begins at this node and for which status is UP.
 int hashCode()
           
 void init(Domain domain)
           
 void setDomain(Domain domain)
          Set the domain
 void setElementId(java.lang.String id)
          Sets the node id to the given id.
 void setLatitude(float latitude)
          Set the latitude of a node
 void setLongitude(float longitude)
          Set the longitude of a node
 void setNodeStatus(int status)
          Set the status of the node
 void setNodeStatus(java.lang.String status)
           
 void setNodeType(Node.Type type)
          Sets the type of the node.
 
Methods inherited from class be.ac.ulg.montefiore.run.totem.domain.model.jaxb.impl.NodeImpl
createRawValidator, createUnmarshaller, getDescription, getId, getInterfaces, getLocation, getPrimaryInterface, getRid, getStatus, getType, isSetDescription, isSetId, isSetInterfaces, isSetLocation, isSetRid, isSetStatus, isSetType, serializeAttributes, serializeBody, serializeURIs, setDescription, setId, setInterfaces, setLocation, setRid, setStatus, setType, unsetDescription, unsetId, unsetInterfaces, unsetLocation, unsetRid, unsetStatus, unsetType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface be.ac.ulg.montefiore.run.totem.domain.model.Node
getDescription, getRid, setDescription, setRid
 
Methods inherited from interface be.ac.ulg.montefiore.run.totem.domain.model.DomainElement
getId
 

Constructor Detail

NodeImpl

public NodeImpl()

NodeImpl

public NodeImpl(Domain domain,
                java.lang.String nodeId)
Create a node

Parameters:
domain -
Method Detail

init

public void init(Domain domain)

setDomain

public void setDomain(Domain domain)
Set the domain

Parameters:
domain -

addInLink

public void addInLink(Link l)
Initialisation method: Add a link to the list of incoming links.

Parameters:
l -

addOutLink

public void addOutLink(Link l)
Initialisation method: Add a link to the list of outcoming links.

Parameters:
l -

delInLink

public void delInLink(Link l)
Initialisation method: Remove a link from the list of incoming links.

Parameters:
l -

delOutLink

public void delOutLink(Link l)
Initialisation method: Remove a link from the list of outcoming links.

Parameters:
l -

getNodeType

public Node.Type getNodeType()
Gets the type of the node.

Returns:
A member of the enum Node.Type. Type.EDGE if not set.

setNodeType

public void setNodeType(Node.Type type)
Sets the type of the node.

Parameters:
type -

getNodeStatus

public int getNodeStatus()
Get the status of the node

Returns:
Node.STATUS_UP if the node is UP and Node.STATUS_DOWN otherwise

setNodeStatus

public void setNodeStatus(int status)
                   throws StatusTypeException
Set the status of the node

Parameters:
status - Node.STATUS_DOWN or Node.STATUS_UP
Throws:
StatusTypeException - if status is neither Node.STATUS_DOWN nor Node.STATUS_UP

setNodeStatus

public void setNodeStatus(java.lang.String status)
                   throws StatusTypeException
Throws:
StatusTypeException

getOutLink

public java.util.List<Link> getOutLink()
Return the list of the links that begins at this node and for which status is UP.

Returns:
the list of the links that arrives at this node

getInLink

public java.util.List<Link> getInLink()
Return the list of the links that ends at this node and for which status is UP.

Returns:
the list of the links that arrives at this node

getAllOutLink

public java.util.List<Link> getAllOutLink()
Return the list of the links that begins at this node.

Returns:
the list of the links that arrives at this node

getAllInLink

public java.util.List<Link> getAllInLink()
Return the list of the links that ends at this node.

Returns:
the list of the links that arrives at this node

getLongitude

public float getLongitude()
Get the longitude of a node and 0 if not defined

Returns:

getLatitude

public float getLatitude()
Get the latitude of a node and 0 if not defined

Returns:

setLongitude

public void setLongitude(float longitude)
Set the longitude of a node

Parameters:
longitude -

setLatitude

public void setLatitude(float latitude)
Set the latitude of a node

Parameters:
latitude -

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getBgpRouter

public BgpRouter getBgpRouter()
Returns the BGP router associated with this node. If the node does not support BGP, returns null.


getallIPs

public java.util.List<java.lang.String> getallIPs()

getNodeInterface

public NodeInterface getNodeInterface(java.lang.String nodeInterfaceId)
                               throws NodeInterfaceNotFoundException
Throws:
NodeInterfaceNotFoundException

getNodeInterfaceByIP

public NodeInterface getNodeInterfaceByIP(java.lang.String nodeInterfaceIP)
                                   throws NodeInterfaceNotFoundException
Throws:
NodeInterfaceNotFoundException

getNodeInterfaces

public java.util.List<NodeInterface> getNodeInterfaces()

addNodeInterface

public void addNodeInterface(NodeInterface nodeInterface)
                      throws NodeInterfaceAlreadyExistException
Throws:
NodeInterfaceAlreadyExistException

setElementId

public void setElementId(java.lang.String id)
                  throws IdException
Sets the node id to the given id.

Specified by:
setElementId in interface DomainElement
Parameters:
id -
Throws:
IdException - If the node is in the domain


Copyright © 2004-2007 Research Unit in Networking, All Rights Reserved.