Class InstanceMap

java.lang.Object
com.highdeal.admin.hci.InstanceMap
All Implemented Interfaces:
XMLMarshallable, Cloneable

public class InstanceMap extends Object implements 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 Details

  • Constructor Details

    • InstanceMap

      public InstanceMap()
      Initializes a new InstanceMap instance without any InstanceInfo; This instance map must be initialized using the fact it is an XMLMarshallable.
    • InstanceMap

      public InstanceMap(String name, Date lastModificationDate, List<InstanceInfo> instanceInfos)
      Builds a new InstanceMap instance from a list of InstanceInfo.
      Parameters:
      name - The name of the SAP CC system; Can be null
      lastModificationDate - The last time this instance map has been modified
      instanceInfos - A list of valid InstanceInfo (one per instance)
      Throws:
      IllegalArgumentException - If name is not set
  • Method Details

    • getName

      public String 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 InstanceInfos of this instance map
    • getInfo

      public InstanceInfo getInfo(InstanceId instanceId)
      Returns the InstanceInfo from the specified istance ID.
      Parameters:
      instanceId - The instance identifier of the expected InstanceInfo
      Returns:
      The instance information with instanceId as ID if exists; null otherwise.
    • getLastModificationDate

      public Date getLastModificationDate()
      Returns the last modification date of the instance map.
      Returns:
      The instance map last modification date
    • getInstances

      public List<InstanceInfo> getInstances()
      Returns the InstanceInfos of all the declared instances; Sorted by instance identifier.
      Returns:
      The instance infos list
    • getDispatchers

      public List<InstanceInfo> getDispatchers()
      Returns the InstanceInfos of 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

      public List<InstanceInfo> getUpdaters()
      Returns the InstanceInfos of all the declared updater instances; Sorted by instance identifier.
      Returns:
      The instance infos with the identifier InstanceType.updater if exists; null otherwise.
    • getInstanceInfo

      public List<InstanceInfo> getInstanceInfo(InstanceType instanceType)
      Returns the InstanceInfo of the system instances that have the specified type.
      Returns:
      The instance infos with the type instanceType if exists; Empty list otherwise.
    • assertIsCompatible

      public void assertIsCompatible() throws InvalidInstanceException
      Checks if this instance map is compatible.
      Throws:
      InvalidInstanceException - If the instance map is not compatible
      com.highdeal.util.NullArgumentException - If ed is null
    • setAttributes

      public void setAttributes(XMLAttributes atts)
      Description copied from interface: XMLMarshallable
      Sets the attributes of the XML representation of the element being processed.
      Specified by:
      setAttributes in interface XMLMarshallable
      Parameters:
      atts - The XML attributes of the current element
    • addChild

      public void addChild(String tagName, XMLMarshallable child)
      Description copied from interface: XMLMarshallable
      Adds a child to the object, the child representing the marshallable object which must be added to the element.
      Specified by:
      addChild in interface XMLMarshallable
      Parameters:
      tagName - The name of tag for the child
      child - The child to be added
    • addCharacterData

      public void addCharacterData(String cData)
      Description copied from interface: XMLMarshallable
      Adds character data to the content element.
      Specified by:
      addCharacterData in interface XMLMarshallable
      Parameters:
      cData - The character data to be added
    • marshal

      public void marshal(XMLOutputter output)
      Description copied from interface: XMLMarshallable
      Gives an XML representation of this object, including its children.
      Specified by:
      marshal in interface XMLMarshallable
      Parameters:
      output - The XML output to marshal the object into
    • checkValidity

      public void checkValidity() throws InvalidInstanceException
      Checks if the instance map is valid. An instance map is valid if all its InstanceInfos are valid.
      Throws:
      InvalidInstanceException - if the map is malformed or invalid
    • toString

      public String toString()
      Returns a printable form (in XML) of the instance map.
      Overrides:
      toString in class Object
      Returns:
      The marshalled instance map
    • clone

      public InstanceMap clone()
      Returns a copy of this instance map; Clone modifications will not modify the original.
      Returns:
      A perfect clone of this instance map