ist.palcom.resource.descriptor
Class PRDAssembly

java.lang.Object
  extended by ist.palcom.resource.descriptor.ASTNode
      extended by ist.palcom.resource.descriptor.AbstractXMLRepresentable
          extended by ist.palcom.resource.descriptor.PRDData
              extended by ist.palcom.resource.descriptor.PalcomResourceDescriptor
                  extended by ist.palcom.resource.descriptor.PRDSecondOrder
                      extended by ist.palcom.resource.descriptor.PRDAssembly
All Implemented Interfaces:
IHgraphNode, XMLRepresentable, Cloneable

public class PRDAssembly
extends PRDSecondOrder
implements Cloneable


Field Summary
protected  boolean encloseInBraces_visited
           
protected  boolean getAssemblyLabel_visited
           
protected  boolean getParentPRDAssembly_visited
           
protected  Set lookupConnection_ServiceExp_ServiceExp_visited
           
protected  Set lookupConnections_ServiceExp_visited
           
protected  Set lookupDevice_Identifier_visited
           
protected  Set lookupDevice_URN_visited
           
protected  Set lookupService_Identifier_visited
           
protected  Set lookupService_ServiceUse_visited
           
protected  Set lookupService_URN_visited
           
protected  Set lookupVariable_String_visited
           
static String VERSION_DELIM
           
 
Fields inherited from class ist.palcom.resource.descriptor.PRDSecondOrder
list_visited
 
Fields inherited from class ist.palcom.resource.descriptor.PRDData
_node
 
Fields inherited from class ist.palcom.resource.descriptor.AbstractXMLRepresentable
getBrowserLabel_visited
 
Fields inherited from class ist.palcom.resource.descriptor.ASTNode
CHANGE, children, generatedWithCacheCycle, generatedWithCircularEnabled, generatedWithComponentCheck, getErrorList_visited, getIndent_visited, getPrettyClosingString_visited, getPrettyString_visited, IN_CIRCLE, LAST_CYCLE, numChildren, parent, prettyPrintChildren_visited, RESET_CYCLE
 
Fields inherited from interface ist.palcom.hgraph.IHgraphNode
CHILD_NAME_CLASH, CIRCULARITY_CLASH, COMMAND_OR_NODE_MISSING, ERROR, HANDLER_MISSING, INVOKATOR_MISSING, LISTENER_MISSING, NODE_NOT_CHILD, PATH_MISSING, SIBLING_ALREADY_EXISTS, SIBLING_NONEXISTENT, SIBLING_REFERENCE_ALREADY_EXISTS, SIBLING_REFERENCE_NONEXISTENT, STATUS_OK, VALUE_ALREADY_EXISTS, VALUE_NOT_PRESENT
 
Constructor Summary
PRDAssembly()
           
PRDAssembly(String p1, DeviceDeclList p2, ServiceDeclList p3, ConnectionDeclList p4, Opt p5, Opt p6)
          Deprecated.  
PRDAssembly(String p0, String p1, String p2, boolean p3, DeviceDeclList p4, ServiceDeclList p5, ConnectionDeclList p6, Opt p7, Opt p8)
           
PRDAssembly(String format, String name, URN DeviceURN, String logicalVersion)
           
 
Method Summary
 void addChildFromXMLElement(XMLRepresentable child)
          The implementation up here is empty.
 boolean checkReleasedForEditing()
           
 Object clone()
           
 ASTNode copy()
           
 PRDAssembly Define_PRDAssembly_ai(ASTNode caller, ASTNode child)
           
 boolean encloseInBraces()
           
 void flushCache()
           
 ASTNode fullCopy()
           
 String getAssemblyLabel()
           
 String getBaseVersion()
           
 Object[] getChildArray()
          Helper method for the TreeView
 ConnectionDeclList getConnections()
           
 ConnectionDeclList getConnectionsNoTransform()
           
 String getCreatingURN()
           
 DeviceDeclList getDevices()
           
 DeviceDeclList getDevicesNoTransform()
           
 URN getDeviceURN()
           
 EventHandlerScript getEventHandlerScript()
           
 Opt getEventHandlerScriptOpt()
           
 Opt getEventHandlerScriptOptNoTransform()
           
 String getFormat()
           
 String getIDforEditing()
          get the ID (name, etc) of the attribute or child to be edited when selecting the node.
 String getInitialTimestamp()
           
 String getLogicalVersion()
           
 String getName()
           
 PRDAssembly getParentPRDAssembly()
          This is a hack used for the released flag check.
 String getParentTimestamp()
           
 String getParentURN()
           
 PRDServiceFMDescription getPRDServiceFMDescription()
           
 Opt getPRDServiceFMDescriptionOpt()
           
 Opt getPRDServiceFMDescriptionOptNoTransform()
           
 boolean getReleased()
           
 ServiceDeclList getServices()
           
 ServiceDeclList getServicesNoTransform()
           
 String getTagName()
           
 String getUpdatingTimestamp()
           
 String getUpdatingURN()
           
 URN getURN()
           
 URNLeaf getURNLeaf()
           
 String getVersion()
           
 boolean hasEventHandlerScript()
           
 int hashCode()
           
 boolean hasPRDServiceFMDescription()
           
 void initializeFromElement(XmlPullParser parser)
          Initialize the XMLRepresentable from the element where the parser is currently standing.
 boolean isAboutTheSameEntityAs(PRDData info)
           
 boolean isRelatedTo(PRDAssembly ai)
          Checks if ai and this are versions of the same entity, i.e., they share a common ancestor.
 boolean isUpdate(PRDAssembly ai)
          Checks if ai is an update to this
 String lookupAndFormatURN(URN urn)
           
 ConnectionDecl lookupConnection(ServiceExp cust, ServiceExp prov)
           
 ArrayList lookupConnections(ServiceExp svc)
           
 DeviceDecl lookupDevice(Identifier id)
           
 DeviceDecl lookupDevice(URN urn)
           
 ServiceDecl lookupService(Identifier id)
           
 ServiceDecl lookupService(ServiceUse su)
           
 ServiceDecl lookupService(URN urn)
           
 VariableDecl lookupVariable(String name)
           
 PRDAssembly newVersion(URN urn, String logicalVersion)
          Create a new version (full copy).
protected  int numChildren()
           
 void setConnections(ConnectionDeclList node)
           
 void setDevices(DeviceDeclList node)
           
 void setEventHandlerScript(EventHandlerScript node)
           
 void setEventHandlerScriptOpt(Opt opt)
           
 void setFormat(String value)
           
 void setName(String value)
           
 void setPRDServiceFMDescription(PRDServiceFMDescription node)
           
 void setPRDServiceFMDescriptionOpt(Opt opt)
           
 void setReleased(boolean value)
           
 void setServices(ServiceDeclList node)
           
 void setThisReferencesToDeviceURN(URN deviceURN)
           
 void setVersion(String value)
           
protected static String tsStr()
           
 boolean updateIDfromEditor(String id)
          Set the new name (ID, etc).
 void writeAttributes(KXmlSerializer serializer)
           
 void writeXMLElement(KXmlSerializer serializer)
           
 
Methods inherited from class ist.palcom.resource.descriptor.PRDSecondOrder
list
 
Methods inherited from class ist.palcom.resource.descriptor.PRDData
addNodeChild, getChildIterator, getFuncFunc, getNodeName, getNodeParent, getPath, getPRDDataThatEquals, getPRDDataThatIsAboutTheSameEntityAs, getSiblingFunc, getValueFunc, hasChildNamed, isAncestorOf, removeNodeChild, safeEqual, setChild, setNodeName, setNodeParent, toXML, toXMLFull, toXMLFullRecursively, toXMLRecursively, updatePath, urnToServiceURN
 
Methods inherited from class ist.palcom.resource.descriptor.AbstractXMLRepresentable
addToAssembly, equals, getBrowserLabel, getXMLData, getXMLData, removeFromAssembly, toString
 
Methods inherited from class ist.palcom.resource.descriptor.ASTNode
addASTtoList, addChild, Define_CommandInfo_ci, Define_Device_parentDevice, Define_Identifier_getLocalName, Define_NetworkNode_lookup, Define_PRDSecondOrderList_list, Define_Service_inhCust, Define_Service_inhProv, Define_String_expectedType, Define_Universe_universe, getChild, getChildNoTransform, getErrorList, getIndent, getIndexOfChild, getNumChild, getParent, getPrettyClosingString, getPrettyString, insertChild, prettyprint, prettyPrintChildren, remove, removeChild, reset, resetTree, setParent
 
Methods inherited from class java.lang.Object
getClass, println
 

Field Detail

VERSION_DELIM

public static final String VERSION_DELIM
See Also:
Constant Field Values

lookupVariable_String_visited

protected Set lookupVariable_String_visited

lookupDevice_URN_visited

protected Set lookupDevice_URN_visited

lookupDevice_Identifier_visited

protected Set lookupDevice_Identifier_visited

lookupService_URN_visited

protected Set lookupService_URN_visited

lookupService_ServiceUse_visited

protected Set lookupService_ServiceUse_visited

lookupService_Identifier_visited

protected Set lookupService_Identifier_visited

lookupConnection_ServiceExp_ServiceExp_visited

protected Set lookupConnection_ServiceExp_ServiceExp_visited

lookupConnections_ServiceExp_visited

protected Set lookupConnections_ServiceExp_visited

getParentPRDAssembly_visited

protected boolean getParentPRDAssembly_visited

getAssemblyLabel_visited

protected boolean getAssemblyLabel_visited

encloseInBraces_visited

protected boolean encloseInBraces_visited
Constructor Detail

PRDAssembly

public PRDAssembly(String p1,
                   DeviceDeclList p2,
                   ServiceDeclList p3,
                   ConnectionDeclList p4,
                   Opt p5,
                   Opt p6)
Deprecated. 

The PRDAssembly constructor without the version parameters is only intended to keep old code compiling. Please update your code. The format field is assigned a default value, "2". The version field is assigned a default value, "1".


PRDAssembly

public PRDAssembly(String format,
                   String name,
                   URN DeviceURN,
                   String logicalVersion)

PRDAssembly

public PRDAssembly()

PRDAssembly

public PRDAssembly(String p0,
                   String p1,
                   String p2,
                   boolean p3,
                   DeviceDeclList p4,
                   ServiceDeclList p5,
                   ConnectionDeclList p6,
                   Opt p7,
                   Opt p8)
Method Detail

flushCache

public void flushCache()
Overrides:
flushCache in class PRDSecondOrder

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class PRDSecondOrder
Throws:
CloneNotSupportedException

copy

public ASTNode copy()
Overrides:
copy in class ASTNode

fullCopy

public ASTNode fullCopy()
Overrides:
fullCopy in class ASTNode

isAboutTheSameEntityAs

public boolean isAboutTheSameEntityAs(PRDData info)
Overrides:
isAboutTheSameEntityAs in class PRDData
Returns:
True if info and this info are for the same entity. This can be /**

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getIDforEditing

public String getIDforEditing()
Description copied from class: ASTNode
get the ID (name, etc) of the attribute or child to be edited when selecting the node.

Overrides:
getIDforEditing in class ASTNode

updateIDfromEditor

public boolean updateIDfromEditor(String id)
Description copied from class: ASTNode
Set the new name (ID, etc).

Overrides:
updateIDfromEditor in class ASTNode
Returns:
true if the tree was actually changed.

getURN

public URN getURN()
Overrides:
getURN in class PRDData
Returns:
The URN of the entity described, or null if not applicable.

getDeviceURN

public URN getDeviceURN()
Overrides:
getDeviceURN in class PRDData
Returns:
The URN of the device that the entity belongs to, or null.

setThisReferencesToDeviceURN

public void setThisReferencesToDeviceURN(URN deviceURN)

getChildArray

public Object[] getChildArray()
Description copied from class: ASTNode
Helper method for the TreeView

Overrides:
getChildArray in class ASTNode
Returns:
The (interesting) children of a node, as an Object array possibly bypassing levels in the tree or ignoring certain children.

getURNLeaf

public URNLeaf getURNLeaf()

checkReleasedForEditing

public boolean checkReleasedForEditing()

getCreatingURN

public String getCreatingURN()

getInitialTimestamp

public String getInitialTimestamp()

getLogicalVersion

public String getLogicalVersion()

getParentURN

public String getParentURN()

getParentTimestamp

public String getParentTimestamp()

getUpdatingURN

public String getUpdatingURN()

getUpdatingTimestamp

public String getUpdatingTimestamp()

tsStr

protected static String tsStr()

getBaseVersion

public String getBaseVersion()

newVersion

public PRDAssembly newVersion(URN urn,
                              String logicalVersion)
Create a new version (full copy). Sets this version as released;


isRelatedTo

public boolean isRelatedTo(PRDAssembly ai)
Checks if ai and this are versions of the same entity, i.e., they share a common ancestor.


isUpdate

public boolean isUpdate(PRDAssembly ai)
Checks if ai is an update to this

Returns:
true if this and ai have a common ancestor, and it there is a known path in the version tree from this to ai. (I.e., the parent version is present)

writeAttributes

public void writeAttributes(KXmlSerializer serializer)
                     throws IOException
Overrides:
writeAttributes in class PalcomResourceDescriptor
Throws:
IOException

getTagName

public String getTagName()
Specified by:
getTagName in interface XMLRepresentable
Specified by:
getTagName in class AbstractXMLRepresentable

initializeFromElement

public void initializeFromElement(XmlPullParser parser)
Description copied from interface: XMLRepresentable
Initialize the XMLRepresentable from the element where the parser is currently standing. When calling this method, the parser must be on the start tag of the element. After returning from the method, the parser will be at the end tag of the element.

Specified by:
initializeFromElement in interface XMLRepresentable
Overrides:
initializeFromElement in class PalcomResourceDescriptor

addChildFromXMLElement

public void addChildFromXMLElement(XMLRepresentable child)
Description copied from class: AbstractXMLRepresentable
The implementation up here is empty.

Specified by:
addChildFromXMLElement in interface XMLRepresentable
Overrides:
addChildFromXMLElement in class AbstractXMLRepresentable

writeXMLElement

public void writeXMLElement(KXmlSerializer serializer)
                     throws IOException
Specified by:
writeXMLElement in interface XMLRepresentable
Throws:
IOException

lookupAndFormatURN

public String lookupAndFormatURN(URN urn)

numChildren

protected int numChildren()
Overrides:
numChildren in class PRDSecondOrder

setFormat

public void setFormat(String value)

getFormat

public String getFormat()

setName

public void setName(String value)
Overrides:
setName in class PRDSecondOrder

getName

public String getName()
Overrides:
getName in class PRDSecondOrder

setVersion

public void setVersion(String value)

getVersion

public String getVersion()

setReleased

public void setReleased(boolean value)

getReleased

public boolean getReleased()

setDevices

public void setDevices(DeviceDeclList node)

getDevices

public DeviceDeclList getDevices()

getDevicesNoTransform

public DeviceDeclList getDevicesNoTransform()

setServices

public void setServices(ServiceDeclList node)

getServices

public ServiceDeclList getServices()

getServicesNoTransform

public ServiceDeclList getServicesNoTransform()

setConnections

public void setConnections(ConnectionDeclList node)

getConnections

public ConnectionDeclList getConnections()

getConnectionsNoTransform

public ConnectionDeclList getConnectionsNoTransform()

setEventHandlerScriptOpt

public void setEventHandlerScriptOpt(Opt opt)

hasEventHandlerScript

public boolean hasEventHandlerScript()

getEventHandlerScript

public EventHandlerScript getEventHandlerScript()

setEventHandlerScript

public void setEventHandlerScript(EventHandlerScript node)

getEventHandlerScriptOpt

public Opt getEventHandlerScriptOpt()

getEventHandlerScriptOptNoTransform

public Opt getEventHandlerScriptOptNoTransform()

setPRDServiceFMDescriptionOpt

public void setPRDServiceFMDescriptionOpt(Opt opt)

hasPRDServiceFMDescription

public boolean hasPRDServiceFMDescription()

getPRDServiceFMDescription

public PRDServiceFMDescription getPRDServiceFMDescription()

setPRDServiceFMDescription

public void setPRDServiceFMDescription(PRDServiceFMDescription node)

getPRDServiceFMDescriptionOpt

public Opt getPRDServiceFMDescriptionOpt()

getPRDServiceFMDescriptionOptNoTransform

public Opt getPRDServiceFMDescriptionOptNoTransform()

lookupVariable

public VariableDecl lookupVariable(String name)

lookupDevice

public DeviceDecl lookupDevice(URN urn)

lookupDevice

public DeviceDecl lookupDevice(Identifier id)

lookupService

public ServiceDecl lookupService(URN urn)

lookupService

public ServiceDecl lookupService(ServiceUse su)

lookupService

public ServiceDecl lookupService(Identifier id)

lookupConnection

public ConnectionDecl lookupConnection(ServiceExp cust,
                                       ServiceExp prov)

lookupConnections

public ArrayList lookupConnections(ServiceExp svc)

getParentPRDAssembly

public PRDAssembly getParentPRDAssembly()
This is a hack used for the released flag check. (as ASTNode cannot inherit ai())

Overrides:
getParentPRDAssembly in class ASTNode
Returns:
the PRDAssembly at the root of the tree or null Declared in AssemblyVersioning.jadd at line 232

getAssemblyLabel

public String getAssemblyLabel()
Overrides:
getAssemblyLabel in class ASTNode

encloseInBraces

public boolean encloseInBraces()
Overrides:
encloseInBraces in class ASTNode

Define_PRDAssembly_ai

public PRDAssembly Define_PRDAssembly_ai(ASTNode caller,
                                         ASTNode child)
Overrides:
Define_PRDAssembly_ai in class ASTNode