Package com.highdeal.admin.hci
Class InstanceMap
java.lang.Object
com.highdeal.admin.hci.InstanceMap
- All Implemented Interfaces:
XMLMarshallable,Cloneable
This
Java class represents the current instance map of an SAP CC system; It is a named set of InstanceInfo
describing all the instances working for the same SAP CC Core Server system.
The SAP CC system can change its instance map.
- See Also:
XML API for HCI
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="instanceMap">
<xs:complexType>
<xs:sequence>
<xs:element ref="instanceInfo" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="lastModificationDate" type="xs:dateTime" use="required"/>
</xs:complexType>
</xs:element>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInitializes a newInstanceMapinstance without any InstanceInfo; This instance map must be initialized using the fact it is anXMLMarshallable.InstanceMap(String name, Date lastModificationDate, List<InstanceInfo> instanceInfos) Builds a newInstanceMapinstance from a list ofInstanceInfo. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCharacterData(String cData) Adds character data to the content element.voidaddChild(String tagName, XMLMarshallable child) Adds a child to the object, thechildrepresenting the marshallable object which must be added to the element.voidChecks if this instance map is compatible.voidChecks if the instance map is valid.clone()Returns a copy of this instance map; Clone modifications will not modify the original.Returns theInstanceInfosof all the declared dispatcher instances; Sorted by instance identifier.getInfo(InstanceId instanceId) Returns theInstanceInfofrom the specified istance ID.intReturns the number of system instances in this map.getInstanceInfo(InstanceType instanceType) Returns theInstanceInfoof the system instances that have the specifiedtype.Returns theInstanceInfosof all the declared instances; Sorted by instance identifier.Returns the last modification date of the instance map.getName()Returns the name of the instance map called system name too.Returns theInstanceInfosof all the declared updater instances; Sorted by instance identifier.voidmarshal(XMLOutputter output) Gives an XML representation of this object, including its children.voidsetAttributes(XMLAttributes atts) Sets the attributes of the XML representation of the element being processed.toString()Returns a printable form (in XML) of the instance map.
-
Field Details
-
TAG_NAME
The XML tag name of this class: "instanceMap"- See Also:
-
-
Constructor Details
-
InstanceMap
public InstanceMap()Initializes a newInstanceMapinstance without any InstanceInfo; This instance map must be initialized using the fact it is anXMLMarshallable. -
InstanceMap
Builds a newInstanceMapinstance from a list ofInstanceInfo.- Parameters:
name- The name of the SAP CC system; Can benulllastModificationDate- The last time this instance map has been modifiedinstanceInfos- A list of validInstanceInfo(one per instance)- Throws:
IllegalArgumentException- Ifnameis not set
-
-
Method Details
-
getName
Returns the name of the instance map called system name too.- Returns:
- The name of this instance map
-
getInstanceCount
public int getInstanceCount()Returns the number of system instances in this map.- Returns:
- The number of the
InstanceInfosof this instance map
-
getInfo
Returns theInstanceInfofrom the specified istance ID.- Parameters:
instanceId- The instance identifier of the expectedInstanceInfo- Returns:
- The
instance informationwith instanceId as ID if exists; null otherwise.
-
getLastModificationDate
Returns the last modification date of the instance map.- Returns:
- The instance map last modification date
-
getInstances
Returns theInstanceInfosof all the declared instances; Sorted by instance identifier.- Returns:
- The instance infos list
-
getDispatchers
Returns theInstanceInfosof all the declared dispatcher instances; Sorted by instance identifier.- Returns:
- The instance infos list of type
InstanceType.dispatcher; It is empty if no dispatcher is declared.
-
getUpdaters
Returns theInstanceInfosof all the declared updater instances; Sorted by instance identifier.- Returns:
- The instance infos with the identifier
InstanceType.updaterif exists;nullotherwise.
-
getInstanceInfo
Returns theInstanceInfoof the system instances that have the specifiedtype.- Returns:
- The instance infos with the type instanceType if exists; Empty list otherwise.
-
assertIsCompatible
Checks if this instance map is compatible.- Throws:
InvalidInstanceException- If the instance map is not compatiblecom.highdeal.util.NullArgumentException- If ed is null
-
setAttributes
Description copied from interface:XMLMarshallableSets the attributes of the XML representation of the element being processed.- Specified by:
setAttributesin interfaceXMLMarshallable- Parameters:
atts- TheXML attributesof the current element
-
addChild
Description copied from interface:XMLMarshallableAdds a child to the object, thechildrepresenting the marshallable object which must be added to the element.- Specified by:
addChildin interfaceXMLMarshallable- Parameters:
tagName- The name of tag for the childchild- The child to be added
-
addCharacterData
Description copied from interface:XMLMarshallableAdds character data to the content element.- Specified by:
addCharacterDatain interfaceXMLMarshallable- Parameters:
cData- The character data to be added
-
marshal
Description copied from interface:XMLMarshallableGives an XML representation of this object, including its children.- Specified by:
marshalin interfaceXMLMarshallable- Parameters:
output- TheXML outputto marshal the object into
-
checkValidity
Checks if the instance map is valid. An instance map is valid if all itsInstanceInfosare valid.- Throws:
InvalidInstanceException- if the map is malformed or invalid
-
toString
Returns a printable form (in XML) of the instance map. -
clone
Returns a copy of this instance map; Clone modifications will not modify the original.- Returns:
- A perfect clone of this instance map
-