SAP CC 1.0
API 4.2 (Core)

com.highdeal.admin.hci
Class InstanceMap

java.lang.Object
  extended by com.highdeal.admin.hci.InstanceMap
All Implemented Interfaces:
XMLMarshallable

public class InstanceMap
extends java.lang.Object
implements XMLMarshallable

This class represents an instance map.

The instance map is a named set of InstanceInfo describing all the instances working for the same cluster.


XML Schema 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
static java.lang.String TAG_NAME
           
 
Constructor Summary
InstanceMap()
          Initializes a new InstanceMap instance without any InstanceInfo.
InstanceMap(java.lang.String name, java.util.Date lastModificationDate, java.util.List<InstanceInfo> instanceInfos)
          Builds a new InstanceMap instance from a list of InstanceInfo.
 
Method Summary
 void addCharacterData(java.lang.String cData)
          Adds character data to the content element.
 void addChild(java.lang.String tagName, XMLMarshallable child)
          Adds a child to the objects, the child represents the marshallable object to be added into the content tree.
 void assertIsCompatible(com.highdeal.util.Version.Edition edition)
          Checks if this instance map is compatible with the specified edition.
 void checkValidity()
          Throws an InvalidInstanceMapException if the map is malformed or invalid.
 InstanceMap clone()
          Returns a copy of this instance map.
 int getBackupCount()
          Returns the backup count of this map.
 InstanceInfo getBillingAssistant()
          Returns the InstanceInfo of the billing assistant.
 InstanceInfo getBulkLoader()
          Returns the InstanceInfos of all the declared chargers sorted by instance id.
 int getChargerCount()
          Returns the guider count of this map.
 java.util.List<InstanceInfo> getChargers()
          Returns the InstanceInfos of all the declared chargers sorted by instance id.
 java.util.List<InstanceInfo> getEZTaxers()
          Returns the InstanceInfos of all the declared EZTaxers sorted by instance id.
 int getGuiderCount()
          Returns the guider count of this map.
 java.util.List<InstanceInfo> getGuiders()
          Returns the InstanceInfos of all the declared guiders sorted by instance id.
 InstanceInfo getInfo(InstanceId instanceId)
          Returns the InstanceInfo with the given ID.
 int getInstanceCount()
          Returns the instance count of this map.
 java.util.List<InstanceInfo> getInstances()
          Returns the InstanceInfos of all the declared instances sorted by instance id.
 java.util.Date getLastModificationDate()
          Returns the instance map last modification date stored the database.
 java.lang.String getName()
          Returns the name of the instance map called cluster name too.
 short[][] getPartitionMap()
          This method returns an array (new short[ratingInstanceCount][2]) which give for each ratingInstance ID the related partition ID range.
 InstanceInfo getPrimaryBackup()
          Returns the InstanceInfo of the primary backup.
 int getRaterCount()
          Returns the rater count of this map (backup excluded).
 java.util.List<InstanceInfo> getRaters()
          Returns the InstanceInfos of all the declared raters sorted by instance id.
 InstanceInfo getSecondaryBackup()
          Returns the InstanceInfo of secondary backup.
 InstanceInfo getUpdater()
          Returns the InstanceInfo of the updater.
 void marshal(XMLOutputter output)
          Gives an XML representation of this object, and of its children.
 void setAttributes(XMLAttributes atts)
          Sets the attributes of the XML representation of the tag beeing processed.
 java.lang.String toString()
          Returns a printable form of the instance map in XML.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TAG_NAME

public static final java.lang.String TAG_NAME
See Also:
Constant Field Values
Constructor Detail

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(java.lang.String name,
                   java.util.Date lastModificationDate,
                   java.util.List<InstanceInfo> instanceInfos)
Builds a new InstanceMap instance from a list of InstanceInfo.

Parameters:
name - the name of the cluster that can be null.
lastModificationDate - the last time this instance map has been modified.
instanceInfos - a list of valid InstanceInfo (one per instance).
Throws:
java.lang.IllegalArgumentException - if name is not set
Method Detail

getName

public java.lang.String getName()
Returns the name of the instance map called cluster name too.

Returns:
the name of this instance map.

getInstanceCount

public int getInstanceCount()
Returns the instance count of this map.

Returns:
the number of the InstanceInfos of this instance map.

getRaterCount

public int getRaterCount()
Returns the rater count of this map (backup excluded).

Returns:
the number of InstanceInfos of type InstanceType.rater.

getGuiderCount

public int getGuiderCount()
Returns the guider count of this map.

Returns:
the number of InstanceInfos of type InstanceType.guider.

getChargerCount

public int getChargerCount()
Returns the guider count of this map.

Returns:
the number of InstanceInfos of type InstanceType.guider.

getBackupCount

public int getBackupCount()
Returns the backup count of this map.

Returns:
the number of InstanceInfos of type InstanceType.backup.

getInfo

public InstanceInfo getInfo(InstanceId instanceId)
Returns the InstanceInfo with the given ID.

Parameters:
instanceId - the instance id of the expected InstanceInfo.
Returns:
the instance info with instanceId as id if exists, null otherwise.

getLastModificationDate

public java.util.Date getLastModificationDate()
Returns the instance map last modification date stored the database.

Returns:
the instance map last modification date.

getInstances

public java.util.List<InstanceInfo> getInstances()
Returns the InstanceInfos of all the declared instances sorted by instance id.

Returns:
the instance infos list.

getRaters

public java.util.List<InstanceInfo> getRaters()
Returns the InstanceInfos of all the declared raters sorted by instance id.

Returns:
the instance infos list of type InstanceType.rater. It is empty if the no rater is declared.

getGuiders

public java.util.List<InstanceInfo> getGuiders()
Returns the InstanceInfos of all the declared guiders sorted by instance id.

Returns:
the instance infos list of type InstanceType.guider. It is empty if the no guider is declared.

getChargers

public java.util.List<InstanceInfo> getChargers()
Returns the InstanceInfos of all the declared chargers sorted by instance id.

Returns:
the instance infos list of type InstanceType.charger. It is empty if the no guider is declared.

getBulkLoader

public InstanceInfo getBulkLoader()
Returns the InstanceInfos of all the declared chargers sorted by instance id.

Returns:
the instance infos list of type InstanceType.charger. It is empty if the no guider is declared.

getEZTaxers

public java.util.List<InstanceInfo> getEZTaxers()
Returns the InstanceInfos of all the declared EZTaxers sorted by instance id.

Returns:
the instance infos list of type InstanceType.eztaxer. It is empty if the no guider is declared.

getPrimaryBackup

public InstanceInfo getPrimaryBackup()
Returns the InstanceInfo of the primary backup.

Returns:
the instance info with the id InstanceType.backup and 1 as instance number. if exists, null otherwise.

getSecondaryBackup

public InstanceInfo getSecondaryBackup()
Returns the InstanceInfo of secondary backup.

Returns:
the instance info with the id InstanceType.backup and 2 as instance number. if exists, null otherwise.

getUpdater

public InstanceInfo getUpdater()
Returns the InstanceInfo of the updater.

Returns:
the instance info with the id InstanceType.updater if exists, null otherwise.

getBillingAssistant

public InstanceInfo getBillingAssistant()
Returns the InstanceInfo of the billing assistant.

Returns:
the instance info with the id InstanceType.billingAssistant if exists, null otherwise.

getPartitionMap

public short[][] getPartitionMap()
This method returns an array (new short[ratingInstanceCount][2]) which give for each ratingInstance ID the related partition ID range. Example : result[3][0] will be the "from" partition ID for the rating instance 3 and result[3][1] will be the "to" partition ID for the rating instance 3 and

Returns:
a nx2 array which contains the partition for each n rating instances.

assertIsCompatible

public void assertIsCompatible(com.highdeal.util.Version.Edition edition)
                        throws InvalidInstanceException
Checks if this instance map is compatible with the specified edition.

Parameters:
edition - the edition to check. Cannot be null.
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 tag beeing processed.

Specified by:
setAttributes in interface XMLMarshallable
Parameters:
atts - the XML attributes of the current tag.

addChild

public void addChild(java.lang.String tagName,
                     XMLMarshallable child)
Description copied from interface: XMLMarshallable
Adds a child to the objects, the child represents the marshallable object to be added into the content tree.

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(java.lang.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, and of its children.

Specified by:
marshal in interface XMLMarshallable
Parameters:
output - the XML output to marshall the object into.

checkValidity

public void checkValidity()
                   throws InvalidInstanceException
Throws an InvalidInstanceMapException if the map is malformed or invalid.

An instance map is valid if all its InstanceInfos are valid.

Throws:
InvalidInstanceException

toString

public java.lang.String toString()
Returns a printable form of the instance map in XML.

Overrides:
toString in class java.lang.Object
Returns:
the marshalled instance map.

clone

public InstanceMap clone()
Returns a copy of this instance map.

To Modify the clone won't modify the original.

Overrides:
clone in class java.lang.Object
Returns:
a perfect clone of this instance map.

SAP CC 1.0
API 4.2 (Core)


API Reference - July 2009

SAP Convergent Charging 1.0 (build R4.2.1.35.0.0)
CONVERGENT CHARGING 4.2

(c) Copyright 2009 SAP AG. All rights reserved.