Class SystemModel

java.lang.Object
com.nt.udc.util.SystemModel
All Implemented Interfaces:
Serializable

public class SystemModel extends Object implements Serializable
See Also:
  • Constructor Details

    • SystemModel

      public SystemModel()
    • SystemModel

      public SystemModel(Vector inNMList)
      Initializes the SystemModel with the current list of Node Managers.
      Parameters:
      inNMList - Vector of NMItem objects representing the current list of NodeManagers known in the system.
  • Method Details

    • getNMList

      public Vector getNMList()
      Retrieves the list of NodeManagers maintained by this model.
      Returns:
      Vector of NMItem objects which represents all node managers known to the Admin Server.
    • setIsHostBased

      public void setIsHostBased(boolean isHostBasedEnv)
    • setNMList

      public void setNMList(Vector inNMList)
      Allows the AdminServer to set the list of NodeManagers.
      Parameters:
      inNMList - List of NodeManagers which replaces this model's current list of NodeManagers.
    • getNodeList

      public Vector getNodeList()
      Returns:
      Returns a Vector of NodeInfo objects which represents all nodes known to the Admin Server.
    • setExportNodeList

      public void setExportNodeList(Vector nodesToExport)
    • getExportNodeList

      public Vector getExportNodeList()
    • getNodeList

      public Vector getNodeList(String inIPAddress, int inPort)
      Parameters:
      inPort - Port the NodeManager is running on
      inIPAddres - IPAddress of the NodeManager to retrieve the list of nodes for.
      Returns:
      Vector of NodeInfo objects which represents all nodes controlled by the NodeManager at the specified IP Address/Port.
    • getOutputNodes

      public Vector getOutputNodes(String inNodeId)
      Parameters:
      inNodeId - String representing the node ID to get the destinations for.
      Returns:
      Vector of ChannelInfo objects which represents all channels/nodes that receive input from the specified node.
    • setNodeOutputs

      public void setNodeOutputs(String inNodeId, Vector inNodeOutputs)
      Parameters:
      inNodeOutputs - Vector of String objects representing the nodes which should have their output nodes set to inNodeId.
      inNodeID - Node ID to set output nodes to.
    • validateChannelIds

      public boolean validateChannelIds(Vector inVecNodes)
    • removeOutputNodes

      public void removeOutputNodes(String inNodeId, Vector inOutputNodes)
      Removes the specified output nodes from the specified node.
      Parameters:
      inNodeId - Node ID which will have output nodes removed.
      inOutputNodes - Vector of String objects representing the output nodes to be removed from inNodeId.
    • addNM

      public void addNM(com.nt.udc.admin.NMItem newNM)
      Allows the AdminServer to add a new NodeManager to this model's current list of NodeManagers
      Parameters:
      newNM - NMItem representing the Node Manager to be added.
    • changeNM

      public void changeNM(com.nt.udc.admin.NMItem inNMItem)
      Allows the AdminServer to replace an NMItem object in this SystemModel with the given NMItem. inNMItem.getIPAddress() and inNMItem.getPort() are used to identify the NodeManager to change.
      Parameters:
      inNMItem - The NMItem to replace this model's current one.
    • removeNM

      public void removeNM(com.nt.udc.admin.NMItem inNMItem)
      Allows the AdminServer to remove the corresponding NMItem object. inNMItem.getIPAddress() and inNMItem.getPort() are used to identify the NodeManager to remove.
      Parameters:
      inNMItem - The NMItem to remove from this model's current list of Node Managers.
    • addNode

      public void addNode(com.nt.udc.admin.NodeItem newNode)
      Add a new node (represented by the NodeItem object) to the NodeManager residing at the specified IP Address in the NodeItem.
      Parameters:
      newNode - NodeItem to be added
    • addNodes

      public void addNodes(Vector newNodes)
      Adds multiple nodes to the NodeManager residing at the IP Address specified in the NodeItem objects.
      Parameters:
      newNodes - Vector of NodeItem objects to be added
    • removeNode

      public void removeNode(com.nt.udc.admin.NodeItem inNodeItem)
      Removes the specified node from the system.
      Parameters:
      inNodeItem - NodeItem to be removed.
    • removeNodes

      public void removeNodes(Vector inNodeItems)
      Removes the specified nodes from the system.
      Parameters:
      inNodeItems - Vector of NodeItem objects representing the nodes to be removed.
    • changeNode

      public void changeNode(com.nt.udc.admin.NodeItem newNode)
      Replaces the NodeItem object this model is currently using with the one given (based on NodeId).
      Parameters:
      changedNode - NodeItem which changed
    • setNodeInfo

      public void setNodeInfo(com.nt.udc.admin.NodeInfo nodeInfo)
      Set the NodeInfo object of the NodeItem with the corresponding Node ID to the passed-in NodeInfo object.
      Parameters:
      nodeInfo - Parameters for the node
    • getNodeInfo

      public com.nt.udc.admin.NodeInfo getNodeInfo(String inNodeId)
      Get a NodeInfo object describing the specified node.
      Parameters:
      inNodeId - Node ID of the node to retrieve the Node Info for
    • load

      public void load(String configFile) throws IOException
      Initializes this SystemModel with information stored in the given filename. It is assumed that this information was stored using the save method.
      Parameters:
      configFile - Name of the file to read data from.
      Throws:
      IOException
    • save

      public void save(String configFile) throws IOException
      Persists the information contained in this SystemModel to the specified file name.
      Parameters:
      configFile - Name of the file to write data to.
      Throws:
      IOException
    • nodeManagersAdded

      public void nodeManagersAdded(Vector inNMList)
      Updates this SystemModel based on information received from AcctEventListener.nodeManagersAdded() events.
      Parameters:
      inNMList - Vector of NMItem objects
    • nodeManagersRemoved

      public void nodeManagersRemoved(Vector inNMList)
      Updates this SystemModel based on information received from AcctEventListener.nodeManagersRemoved() events.
      Parameters:
      inNMList - Vector of NMItem objects
    • nodeManagerChanged

      public void nodeManagerChanged(com.nt.udc.admin.NMItem nmItem)
      Updates this SystemModel based on information received from AcctEventListener.nodeManagerChanged() events.
      Parameters:
      nmItem - NMItem representing the NodeManager that changed.
    • nodesAdded

      public void nodesAdded(com.nt.udc.admin.NMItem nmItem)
      Updates this SystemModel based on information received from AcctEventListener.nodesAdded() events.
      Parameters:
      nmItem - NMItem representing the NodeManager that nodes were added to.
    • nodesRemoved

      public void nodesRemoved(com.nt.udc.admin.NMItem nmItem)
      Updates this SystemModel based on information received from AcctEventListener.nodesRemoved() events.
      Parameters:
      nmItem - NMItem representing the NodeManager that nodes were removed from.
    • nodeChanged

      public void nodeChanged(com.nt.udc.admin.NMItem nmItem)
      Updates this SystemModel based on information received from AcctEventListener.nodeChanged() events.
      Parameters:
      nmItem - NMItem representing the NodeManager whose nodes changed
    • fileChanged

      public void fileChanged(com.nt.udc.admin.FileItem file)
    • nodePerformanceUpdate

      public void nodePerformanceUpdate(Vector perfs)
    • systemUpdate

      public void systemUpdate(SystemModel inModel)
      Updates this SystemModel based on information received from AcctEventListener.systemUpdate() events.
      Parameters:
      inModel - SystemModel representing the new state of the system
    • clone

      public Object clone()
      Overrides:
      clone in class Object
    • getNMItem

      public com.nt.udc.admin.NMItem getNMItem(String inIPAddress, int inPort)
      Allows the AdminServer to get the NMItem object corresponding to the given IP address and port.
      Parameters:
      inPort - Port of the NodeManager
      inIPAddres - IPAddress of the NodeManager
      Returns:
      NMItem object corresponding to the NodeManager at the specified IP address and port.
    • getNMItem

      public com.nt.udc.admin.NMItem getNMItem(String nodeManagerId)
      Allows the AdminServer to get the NMItem object corresponding to the given IP address and port.
      Parameters:
      nodeManagerId - ID of the node manager
      Returns:
      NMItem object corresponding to the NodeManager with the specified ID.
    • getNodeItem

      public com.nt.udc.admin.NodeItem getNodeItem(String inNodeId)
      Allows the AdminServer to get the NodeItem object corresponding to the given Node ID.