public class InstanceMap extends Object implements XMLMarshallable
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.
InstanceInfo,
GetInstanceMapOpThe 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>
| Modifier and Type | Field and Description |
|---|---|
static String |
TAG_NAME
The XML tag name of this class: "instanceMap"
|
| Constructor and Description |
|---|
InstanceMap()
Initializes a new
InstanceMap instance without any InstanceInfo; This instance map
must be initialized using the fact it is an XMLMarshallable. |
InstanceMap(String name,
Date lastModificationDate,
List<InstanceInfo> instanceInfos)
Builds a new
InstanceMap instance from a list of InstanceInfo. |
| Modifier and Type | Method and Description |
|---|---|
void |
addCharacterData(String cData)
Adds character data to the content element.
|
void |
addChild(String tagName,
XMLMarshallable child)
Adds a child to the object, the
child representing
the marshallable object which must be added to the element. |
void |
assertIsCompatible()
Checks if this instance map is compatible.
|
void |
checkValidity()
Checks if the instance map is valid.
|
InstanceMap |
clone()
Returns a copy of this instance map; Clone modifications will not modify the original.
|
List<InstanceInfo> |
getDispatchers()
Returns the
InstanceInfos of all the declared dispatcher instances; Sorted by instance identifier. |
InstanceInfo |
getInfo(InstanceId instanceId)
Returns the
InstanceInfo from the specified istance ID. |
int |
getInstanceCount()
Returns the number of system instances in this map.
|
List<InstanceInfo> |
getInstanceInfo(InstanceType instanceType)
Returns the
InstanceInfo of the system instances that have the specified type. |
List<InstanceInfo> |
getInstances()
Returns the
InstanceInfos of all the declared instances; Sorted by instance identifier. |
Date |
getLastModificationDate()
Returns the last modification date of the instance map.
|
String |
getName()
Returns the name of the instance map called system name too.
|
List<InstanceInfo> |
getUpdaters()
Returns the
InstanceInfos of all the declared updater instances; Sorted by instance identifier. |
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, including its children.
|
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the element being
processed.
|
String |
toString()
Returns a printable form (in XML) of the instance map.
|
public static final String TAG_NAME
public InstanceMap()
InstanceMap instance without any InstanceInfo; This instance map
must be initialized using the fact it is an XMLMarshallable.public InstanceMap(String name, Date lastModificationDate, List<InstanceInfo> instanceInfos)
InstanceMap instance from a list of InstanceInfo.name - The name of the SAP CC system; Can be nulllastModificationDate - The last time this instance map has been modifiedinstanceInfos - A list of valid InstanceInfo (one per instance)IllegalArgumentException - If name is not setpublic String getName()
public int getInstanceCount()
InstanceInfos of this instance mappublic InstanceInfo getInfo(InstanceId instanceId)
InstanceInfo from the specified istance ID.instanceId - The instance identifier of the expected InstanceInfoinstance information with instanceId as ID if exists; null otherwise.public Date getLastModificationDate()
public List<InstanceInfo> getInstances()
InstanceInfos of all the declared instances; Sorted by instance identifier.public List<InstanceInfo> getDispatchers()
InstanceInfos of all the declared dispatcher instances; Sorted by instance identifier.InstanceType.dispatcher; It is empty
if no dispatcher is declared.public List<InstanceInfo> getUpdaters()
InstanceInfos of all the declared updater instances; Sorted by instance identifier.InstanceType.updater
if exists; null otherwise.public List<InstanceInfo> getInstanceInfo(InstanceType instanceType)
InstanceInfo of the system instances that have the specified type.public void assertIsCompatible()
throws InvalidInstanceException
InvalidInstanceException - If the instance map is not compatiblecom.highdeal.util.NullArgumentException - If ed is nullpublic void setAttributes(XMLAttributes atts)
XMLMarshallablesetAttributes in interface XMLMarshallableatts - The XML attributes of the current elementpublic void addChild(String tagName, XMLMarshallable child)
XMLMarshallablechild representing
the marshallable object which must be added to the element.addChild in interface XMLMarshallabletagName - The name of tag for the childchild - The child to be addedpublic void addCharacterData(String cData)
XMLMarshallableaddCharacterData in interface XMLMarshallablecData - The character data to be addedpublic void marshal(XMLOutputter output)
XMLMarshallablemarshal in interface XMLMarshallableoutput - The XML output to marshal the object intopublic void checkValidity()
throws InvalidInstanceException
InstanceInfos are valid.InvalidInstanceException - if the map is malformed or invalidpublic String toString()
public InstanceMap clone()