usc.cse.desi.rasdsmodel
Class DeSiDataModel

java.lang.Object
  extended byusc.cse.desi.rasdsmodel.DeSiDataModel

public class DeSiDataModel
extends java.lang.Object

Top of the Model Hierarchy

Author:
Kari A. Nies (kari@ics.uci.edu)

Nested Class Summary
(package private)  class DeSiDataModel.LinkPairInfo
           
(package private)  class DeSiDataModel.NodeInterfacePair
           
 
Field Summary
(package private)  java.util.List hosts
           
(package private)  edu.uci.ics.xarchutils.ObjRef hostStructureRef
           
(package private)  java.util.ArrayList linkInfoList
           
(package private)  java.util.ArrayList logicalConnectors
           
(package private)  java.util.ArrayList physicalConnectors
           
(package private)  edu.uci.ics.xarchutils.XArchFlatInterface xarch
           
(package private)  edu.uci.ics.xarchutils.ObjRef xArchRef
           
 
Constructor Summary
DeSiDataModel(edu.uci.ics.xarchutils.XArchFlatInterface xarch, edu.uci.ics.xarchutils.ObjRef xarchRef, edu.uci.ics.xarchutils.ObjRef hostStructureRef)
          Constructor
 
Method Summary
 void addHost(HostDataModel host)
           
private  void buildDesiModel(edu.uci.ics.xarchutils.XArchFlatInterface xarch, edu.uci.ics.xarchutils.ObjRef hostStructureRef)
           
private  edu.uci.ics.xarchutils.ObjRef buildHostInterfaceAndSignature(edu.uci.ics.xarchutils.ObjRef typesContextRef, edu.uci.ics.xarchutils.ObjRef hostRef, edu.uci.ics.xarchutils.ObjRef compRef, edu.uci.ics.xarchutils.ObjRef compInterfaceRef, edu.uci.ics.xarchutils.ObjRef externalCompRef)
           
private  java.util.List buildHosts(edu.uci.ics.xarchutils.ObjRef[] hostRefs)
           
private  void changePointAnchor(edu.uci.ics.xarchutils.ObjRef linkRef, int pointNum, edu.uci.ics.xarchutils.ObjRef newInterfaceRef)
           
 ComponentDataModel findComponent(edu.uci.ics.xarchutils.ObjRef compRef)
          Given reference to a component, find the DeSi ComponentDataModel that wraps it
 HostDataModel findHost(edu.uci.ics.xarchutils.ObjRef hostRef)
          Given reference to a host node, find the DeSi HostDataModel that wraps it
private  DeSiDataModel.LinkPairInfo findLinksOnConnector(edu.uci.ics.xarchutils.ObjRef connRef, java.util.List linkInfoList)
          Iterates through a list of LinkInfo objects to locate the two links associated with the given object (connector or component), keeping track of each links outbound endpoint
private  DeSiDataModel.NodeInterfacePair followLink(edu.uci.ics.xadlutils.XadlUtils.LinkInfo linkInfo, int endpoint)
          Follow a link from the given endpoint
 java.util.List getHosts()
           
private  edu.uci.ics.xarchutils.ObjRef getInterfaceRef(edu.uci.ics.xarchutils.ObjRef linkRef, int pointNum)
           
private  int getOutgoingPoint(edu.uci.ics.xarchutils.ObjRef linkRef, edu.uci.ics.xarchutils.ObjRef connRef)
           
protected  edu.uci.ics.xarchutils.ObjRef getSubArchStruct(edu.uci.ics.xarchutils.ObjRef comp)
           
private  int isConnectedTo(edu.uci.ics.xarchutils.ObjRef objRef, edu.uci.ics.xadlutils.XadlUtils.LinkInfo linkInfo)
          Check to see if a link described in an LinkInfo object is attached to the given object
private  boolean isCrossHostLogicalConnection(edu.uci.ics.xarchutils.ObjRef connRef, java.util.List linkInfoList)
           
private  void moveXadlLinkObjects(LogicalLinkDataModel link, edu.uci.ics.xarchutils.ObjRef fromStruct, edu.uci.ics.xarchutils.ObjRef toStruct)
          Move the xADL objects wrapped in the given LogicalLinkDataModel from one struct to another
private  LogicalLinkDataModel parseCrossHostLogicalConnection(edu.uci.ics.xarchutils.ObjRef connRef, java.util.List linkInfoList)
           
private  void parseHosts(java.util.List hosts)
           
private  LogicalLinkDataModel parseLogicalConnection(edu.uci.ics.xarchutils.ObjRef connRef, java.util.List linkInfoList)
           
private  PhysicalLinkDataModel parsePhysicalConnection(edu.uci.ics.xarchutils.ObjRef connRef, java.util.List linkInfoList)
           
private  void parsePhysicalConnectors(edu.uci.ics.xarchutils.ObjRef[] physicalConnRefs, java.util.List linkInfoList)
           
 void printDeSiDataModel()
           
 void rehostComponent(ComponentDataModel component, HostDataModel newHost)
          Move a component from one host to another while maintaining intercomponent connections updating logical and physical links as necessary.
 void rehostLogicalLink(LogicalLinkDataModel link, ComponentDataModel comp)
           
 void reinitialize()
           
 void removeHost(HostDataModel host)
           
private  void removeHostInterfaceAndSignature(edu.uci.ics.xarchutils.ObjRef hostInterfaceRef)
           
private  void updateLinkEndPointInterfaces(LogicalLinkDataModel link, int sourcePointNum, edu.uci.ics.xarchutils.ObjRef sourceInterfaceRef, edu.uci.ics.xarchutils.ObjRef targetInterfaceRef)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xarch

edu.uci.ics.xarchutils.XArchFlatInterface xarch

xArchRef

edu.uci.ics.xarchutils.ObjRef xArchRef

hostStructureRef

edu.uci.ics.xarchutils.ObjRef hostStructureRef

physicalConnectors

java.util.ArrayList physicalConnectors

logicalConnectors

java.util.ArrayList logicalConnectors

linkInfoList

java.util.ArrayList linkInfoList

hosts

java.util.List hosts
Constructor Detail

DeSiDataModel

public DeSiDataModel(edu.uci.ics.xarchutils.XArchFlatInterface xarch,
                     edu.uci.ics.xarchutils.ObjRef xarchRef,
                     edu.uci.ics.xarchutils.ObjRef hostStructureRef)
Constructor

Parameters:
xarch - interface to instance of xarch structure
xarchRef - reference to the root of the xarch structure
hostStructureRef - reference to the xarch node enclosing all hosts
Method Detail

addHost

public void addHost(HostDataModel host)

removeHost

public void removeHost(HostDataModel host)

reinitialize

public void reinitialize()

getHosts

public java.util.List getHosts()

printDeSiDataModel

public void printDeSiDataModel()

buildHosts

private java.util.List buildHosts(edu.uci.ics.xarchutils.ObjRef[] hostRefs)

getSubArchStruct

protected edu.uci.ics.xarchutils.ObjRef getSubArchStruct(edu.uci.ics.xarchutils.ObjRef comp)

followLink

private DeSiDataModel.NodeInterfacePair followLink(edu.uci.ics.xadlutils.XadlUtils.LinkInfo linkInfo,
                                                   int endpoint)
Follow a link from the given endpoint

Parameters:
linkInfo -
endpoint -
Returns:
return both the interface to which the endpoint is connected and the node to which the interface is attatched

isConnectedTo

private int isConnectedTo(edu.uci.ics.xarchutils.ObjRef objRef,
                          edu.uci.ics.xadlutils.XadlUtils.LinkInfo linkInfo)
Check to see if a link described in an LinkInfo object is attached to the given object

Parameters:
linkInfo -
Returns:
The out going endpoint of the link, 1 if attatached by endpoint2, 2 if attatched by endpoint1, 0 if no match

findLinksOnConnector

private DeSiDataModel.LinkPairInfo findLinksOnConnector(edu.uci.ics.xarchutils.ObjRef connRef,
                                                        java.util.List linkInfoList)
Iterates through a list of LinkInfo objects to locate the two links associated with the given object (connector or component), keeping track of each links outbound endpoint

Parameters:
connRef - connector for which we are searching for links
linkInfoList - a list of LinkInfo objects
Returns:

findHost

public HostDataModel findHost(edu.uci.ics.xarchutils.ObjRef hostRef)
Given reference to a host node, find the DeSi HostDataModel that wraps it

Parameters:
hostRef -
Returns:
the DeSi HostDataModel that wraps the given hostRef

findComponent

public ComponentDataModel findComponent(edu.uci.ics.xarchutils.ObjRef compRef)
Given reference to a component, find the DeSi ComponentDataModel that wraps it

Returns:
the DeSi ComponentDataModel that wraps the given compRef

moveXadlLinkObjects

private void moveXadlLinkObjects(LogicalLinkDataModel link,
                                 edu.uci.ics.xarchutils.ObjRef fromStruct,
                                 edu.uci.ics.xarchutils.ObjRef toStruct)
Move the xADL objects wrapped in the given LogicalLinkDataModel from one struct to another

Parameters:
link - DeSi logical link to be relocated
fromStruct - struct to remove link from
toStruct - struct to add link to

buildHostInterfaceAndSignature

private edu.uci.ics.xarchutils.ObjRef buildHostInterfaceAndSignature(edu.uci.ics.xarchutils.ObjRef typesContextRef,
                                                                     edu.uci.ics.xarchutils.ObjRef hostRef,
                                                                     edu.uci.ics.xarchutils.ObjRef compRef,
                                                                     edu.uci.ics.xarchutils.ObjRef compInterfaceRef,
                                                                     edu.uci.ics.xarchutils.ObjRef externalCompRef)

removeHostInterfaceAndSignature

private void removeHostInterfaceAndSignature(edu.uci.ics.xarchutils.ObjRef hostInterfaceRef)

changePointAnchor

private void changePointAnchor(edu.uci.ics.xarchutils.ObjRef linkRef,
                               int pointNum,
                               edu.uci.ics.xarchutils.ObjRef newInterfaceRef)

getInterfaceRef

private edu.uci.ics.xarchutils.ObjRef getInterfaceRef(edu.uci.ics.xarchutils.ObjRef linkRef,
                                                      int pointNum)

updateLinkEndPointInterfaces

private void updateLinkEndPointInterfaces(LogicalLinkDataModel link,
                                          int sourcePointNum,
                                          edu.uci.ics.xarchutils.ObjRef sourceInterfaceRef,
                                          edu.uci.ics.xarchutils.ObjRef targetInterfaceRef)

getOutgoingPoint

private int getOutgoingPoint(edu.uci.ics.xarchutils.ObjRef linkRef,
                             edu.uci.ics.xarchutils.ObjRef connRef)

rehostLogicalLink

public void rehostLogicalLink(LogicalLinkDataModel link,
                              ComponentDataModel comp)

rehostComponent

public void rehostComponent(ComponentDataModel component,
                            HostDataModel newHost)
Move a component from one host to another while maintaining intercomponent connections updating logical and physical links as necessary.

Parameters:
component - component to be rehosted
newHost - host to which the component will be moved

isCrossHostLogicalConnection

private boolean isCrossHostLogicalConnection(edu.uci.ics.xarchutils.ObjRef connRef,
                                             java.util.List linkInfoList)

parseCrossHostLogicalConnection

private LogicalLinkDataModel parseCrossHostLogicalConnection(edu.uci.ics.xarchutils.ObjRef connRef,
                                                             java.util.List linkInfoList)

parseLogicalConnection

private LogicalLinkDataModel parseLogicalConnection(edu.uci.ics.xarchutils.ObjRef connRef,
                                                    java.util.List linkInfoList)

parsePhysicalConnection

private PhysicalLinkDataModel parsePhysicalConnection(edu.uci.ics.xarchutils.ObjRef connRef,
                                                      java.util.List linkInfoList)

parseHosts

private void parseHosts(java.util.List hosts)

parsePhysicalConnectors

private void parsePhysicalConnectors(edu.uci.ics.xarchutils.ObjRef[] physicalConnRefs,
                                     java.util.List linkInfoList)

buildDesiModel

private void buildDesiModel(edu.uci.ics.xarchutils.XArchFlatInterface xarch,
                            edu.uci.ics.xarchutils.ObjRef hostStructureRef)