Class SubscriptionModel
- All Implemented Interfaces:
XMLMarshallable
Java class represents a subscription in customer master data owned by a service provider;
A subscription represents a business agreement between an end customer and the service provider.
It includes subscribed pricing information, customer information, and the associated subscriber account that holds this subscription.
It is the result of an service offer that is subscribed to by an end customer of the service provider as part of
a commercial agreement.
When a subscription is created, all the mandatory charges of the related offer
are automatically activated. Charges and suboffers of the related subscription can then be activated according to
the subscriber contract.
Features
Structure
A subscription may contain several sub-subscriptions, which represents subscriptions to suboffers of the root offer.
-
All the sub-subscriptions contained within a subscription must be associated to an
offer conditiondirectly contained by theofferof this subscription. -
All the
charge activation itemscontained within this subscription must be associated to acharge conditiondirectly contained by theofferof this subscription.
A subscription includes both a subscription context and a chronology of subscription contexts.
Type
A subscription can be:
-
Offlinesubscription is always charged in a batch mode and belongs to a unique batch rating group to schedule and optimize the sessions of offline charging. During the charging process, the SAP CC system generatescounter snapshots(backups of the subscription counters) that enable the rerating services. -
Hybridsubscription can be charged both in realtime and in batch modes according to the marketable service that is consumed by an end customer. Even if hybrid subscriptions belong to a batch rating group, they are not elligible to the rerating services. -
Onlinesubscription is charged in realtime mode and is not compatible with the rerating services
Parameter Configuration
A subscription includes parameters at different levels:
-
Parameters at subscription level (like in sub-subscriptions) are stored in a
parameterSethimself stored in a chronology managed intosubscriptionContext. -
Parameters at
charge activationlevel are stored in a chronology managed intoparameterSetstored in eachchargeActivation.
Modifying a parameter in a subscription, whatever its level, represents the same operation as:
- Building the target subscription with its
parametersredefined each level) - Sending this subscription to the server via a
Modify Subscription operation
The simplest way to do this is:
- To get the current subscription from the server
-
To select the
parameter setsandtranslation tablesexceptions that must be applied at a specified date - To send the modified subscription
Notes
-
If the
parameterwas already redefined (the subscription did not follow the standard parameters values), it is necessary to retrieve theparameterand change its value. -
If the
parameterwas not already defined, it is necessary to create aparameterwith the new value and insert it at the right place.
- See Also:
XML API for HCI
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="subscription">
<xs:complexType>
<xs:sequence>
<xs:element ref="subscriptionContext" minOccurs="0" maxOccurs="1"/>
<xs:element ref="subscription" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="chargeActivation" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="additionalInformation" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="counter" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="subscriptionContextChronology" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element ref="chronology" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="code" type="xs:string"/> <!-- mandatory for a root subscription -->
<xs:attribute name="reference" type="xs:string"/>
<xs:attribute name="offerCode" type="xs:string"/> <!-- required for a root subscription -->
<xs:attribute name="offerConditionCode" type="xs:string"/> <!-- mandatory for a root subscription -->
<xs:attribute name="subscriberAccountCode" type="xs:string" use="required"/>
<xs:attribute name="subscriberAccountServiceProvider" type="xs:string" use="required"/>
<xs:attribute name="reratingLockCode" type="xs:string"/>
<xs:attribute name="reratingLastCode" type="xs:string"/>
<xs:attribute name="reratingLastStatus" type="ReratingLastStatusType"/>
<xs:attribute name="reratingSuggestedDate" type="xs:dateTime"/>
<xs:attribute name="type" type="SubscriptionTypeType"/>
<xs:attribute name="batchRatingGroupCode" type="xs:string"/>
<xs:attribute name="effective" type="xs:dateTime"/> <!-- mandatory for a root subscription -->
<xs:attribute name="expiration" type="xs:dateTime"/>
<xs:attribute name="priceFreezeEffective" type="xs:dateTime"/>
<xs:attribute name="priceFreezeExpiration" type="xs:dateTime"/>
<xs:attribute name="commitmentExpiration" type="xs:dateTime"/>
<xs:attribute name="suspensionDate" type="xs:dateTime"/>
<xs:attribute name="resumptionDate" type="xs:dateTime"/>
<xs:attribute name="cancellationDate" type="xs:dateTime"/>
<xs:attribute name="lastSnapshotDate" type="xs:dateTime"/>
<xs:attribute name="overrideDependencies" type="xs:boolean" use="optional"/>
</xs:complexType>
</xs:element>
<xs:simpleType name="SubscriptionTypeType">
<xs:restriction base="xs:string">
<xs:enumeration value="online"/>
<xs:enumeration value="hybrid"/>
<xs:enumeration value="offline"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ReratingLastStatusType">
<xs:restriction base="xs:string">
<xs:enumeration value="alreadyLockedFailure"/>
<xs:enumeration value="counterRestorationFailure"/>
<xs:enumeration value="billingFailure"/>
<xs:enumeration value="bartRestorationFailure"/>
<xs:enumeration value="exportFailure"/>
<xs:enumeration value="unlockFailure"/>
<xs:enumeration value="exportAndUnlockFailure"/>
<xs:enumeration value="restorationSuccess"/>
<xs:enumeration value="reratingSuccess"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="subscriptionContextChronology">
<xs:complexType>
<xs:sequence>
<xs:element ref="chronology" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intStatus for active subscription.static final intStatus for closed subscription.static final intStatus for locked subscription.static final StringThe XML tag name of this data model: "subscription" -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCharacterData(String cData) Adds character data to the content element.voidaddChargeActivation(ChargeActivationModel activation) voidaddChargeActivation(ChargeActivationModel activation, boolean generateSubCode) voidaddChild(String name, XMLMarshallable child) Adds a child to the object, thechildrepresenting the marshallable object which must be added to the element.voidReturns the list of AdditionalInfoModel.Returns the batch rating group code that subscription has registered to; If batch rating group code isnull, this subscription is online.Returns the cancellation date of this subscription.Returns the list of ChargeActivationModel.getCode()Returns the identification code of this subscription.Returns the commitment expiration date of this subscription.Returns the subscription context.Returns the offer context chronology of this subscription.Returns the list ofCounterModel.Returns the effective date of this subscription.Returns the expiration date of this subscription.Returns the last snapshot date of this subscription.Returns the code of the subscribed offer.Returns the code of the offer condition of the subscribed offer.Returns the subscription parent.Returns the price freeze effective date of this subscription.Returns the price freeze expiration date of this subscription.Returns the reference of this subscription.Returns the last rerating code of this subscription; This code corresponds to the last rerating operation identifier that has been launched on this subscription.Returns the rerating status of the subscription; This field maintains the last rerating state of the subscription.Gets the code of the rerating operation that has locked this subscription; This code can be set foroffline subscriptiononly.Returns the suggested rerating date.Returns the resumption date of this subscription.Returns the code of the subscriber account for this subscription.Returns the service provider of the subscriber account for this subscription.Returns the subscriptions.Returns the suspension date of this subscription.getType()booleanReturns whether the subscription overrides the charge dependencies of the offer.voidmarshal(XMLOutputter output) Gives an XML representation of this object, including its children.voidReturns the charge activations of this subscription and all the charge activations of its sub-subcriptions.Returns all the subscriptions which has this subscription as ancestor.Returns all the invalid charge activation subcodes.voidsetAttributes(XMLAttributes atts) Sets the attributes of the XML representation of the element being processed.voidsetBatchRatingGroupCode(String batchRatingGroupCode) Sets the batch rating group code that subscription must registered to; Batch rating group code must be set tonullif subscription is online.voidsetCancellationDate(Date cancellationDate) Sets the cancellation date of this subscription.voidSets the identification code for this subscription.voidsetCommitmentExpiration(Date commitmentExpiration) Sets the commitment expiration date of this subscription.voidsetContext(SubscriptionContextModel context) Sets the context of this subscription.voidsetEffective(Date effective) Sets the effective date of this subscription.voidsetExpiration(Date expiration) Sets the expiration date of this subscription.voidsetLastSnapshotDate(Date lastSnapshotDate) Sets the last snapshot date of this subscription.voidsetOfferCode(String offerCode) Sets the code of the subscribed offer.voidsetOfferConditionCode(String offerConditionCode) Sets the code of the offer condition of the subscribed offer.voidsetOverrideDependencies(boolean override) Sets whether the subscription overrides the charge dependencies of the offer.voidsetParent(SubscriptionModel parent) Sets the parent for this subscription.voidsetPriceFreezeEffective(Date priceFreezeEffective) Sets the price freeze effective date of this subscription.voidsetPriceFreezeExpiration(Date priceFreezeExpiration) Sets the price freeze expiration date of this subscription.voidsetReference(String reference) Sets the reference of this subscription.voidsetReratingLastCode(String reratingLastCode) Sets the last rerating code of this subscription; This code corresponds to the last rerating operation identifier that has been launched on this subscription.voidsetReratingLastStatus(ReratingStatus reratingLastStatus) Sets the rerating status of the subscription, which must be a value amongReratingStatus.ALREADY_LOCKED_FAILURE,ReratingStatus.COUNTER_RESTORATION_FAILUREorReratingStatus.BILLING_FAILUREfor failure types orReratingStatus.RESTORATION_SUCCESSorReratingStatus.RERATING_SUCCESSfor success types.voidsetReratingLockCode(String reratingLockCode) Sets the code of the rerating operation that has locked this subscription; Changing this code has not effect on the subscription.voidsetReratingSuggestedDate(Date reratingSuggestedDate) Sets the suggested rerating date.voidsetResumptionDate(Date resumptionDate) Sets the resumption date of this subscription.voidsetSubscriberAccountCode(String subscriberAccountCode) Sets the identification code of the subscriber account belonging this subscription.voidsetSubscriberAccountServiceProvider(String subscriberAccountServiceProvider) Sets the service provider of the subscriber account for this subscription.voidsetSuspensionDate(Date suspensionDate) Sets the suspension date of this subscription.void
-
Field Details
-
ACTIVE_STATUS
public static final int ACTIVE_STATUSStatus for active subscription. Reserved for internal use.- See Also:
-
LOCKED_STATUS
public static final int LOCKED_STATUSStatus for locked subscription. Reserved for internal use.- See Also:
-
CLOSED_STATUS
public static final int CLOSED_STATUSStatus for closed subscription. Reserved for internal use.- See Also:
-
NAME
The XML tag name of this data model: "subscription"- See Also:
-
-
Constructor Details
-
SubscriptionModel
public SubscriptionModel()Builds an empty SubscriptionModel.
-
-
Method Details
-
getParent
Returns the subscription parent.- Returns:
- The subscription parent
- See Also:
-
setParent
Sets the parent for this subscription.- Parameters:
parent- The parent of the subscription- See Also:
-
getCode
Returns the identification code of this subscription.- Returns:
- This subscription identification code
- See Also:
-
setCode
Sets the identification code for this subscription.- Parameters:
code- The identification code of subscription- See Also:
-
getReference
Returns the reference of this subscription.- Returns:
- This subscription reference
- See Also:
-
setReference
Sets the reference of this subscription.- Parameters:
reference- The reference of subscription- See Also:
-
getSubscriberAccountCode
Returns the code of the subscriber account for this subscription.- Returns:
- The subscriber account code for this subscription
-
setSubscriberAccountCode
Sets the identification code of the subscriber account belonging this subscription.- Parameters:
subscriberAccountCode- The identification code of the subscriber account for this subscription
-
getSubscriberAccountServiceProvider
Returns the service provider of the subscriber account for this subscription.- Returns:
- The subscriber account service provider for this subscription
-
setSubscriberAccountServiceProvider
Sets the service provider of the subscriber account for this subscription.- Parameters:
subscriberAccountServiceProvider- The subscriber account service provider for this subscription
-
getOfferCode
Returns the code of the subscribed offer.- Returns:
- The code of the subscribed offer
- See Also:
-
setOfferCode
Sets the code of the subscribed offer.- Parameters:
offerCode- The code- See Also:
-
getOfferConditionCode
Returns the code of the offer condition of the subscribed offer.- Returns:
- The code of the offer condition of the subscribed offer
- See Also:
-
setOfferConditionCode
Sets the code of the offer condition of the subscribed offer.- Parameters:
offerConditionCode- The code of the offer condition- See Also:
-
getReratingLockCode
Gets the code of the rerating operation that has locked this subscription; This code can be set foroffline subscriptiononly. The lock code corresponds to the rerating operation identifier.- Returns:
- The code of the rerating operation that has locked this subscription
-
setReratingLockCode
Sets the code of the rerating operation that has locked this subscription; Changing this code has not effect on the subscription. If needed, use the operationUnlockSubscriptionOpinstead.- Parameters:
reratingLockCode- The code of the rerating operation that has locked this subscription
-
getBatchRatingGroupCode
Returns the batch rating group code that subscription has registered to; If batch rating group code isnull, this subscription is online.- Returns:
- The batch rating group code
-
setBatchRatingGroupCode
Sets the batch rating group code that subscription must registered to; Batch rating group code must be set tonullif subscription is online.- Parameters:
batchRatingGroupCode- The batch rating group code
-
getType
-
setType
-
getReratingLastStatus
Returns the rerating status of the subscription; This field maintains the last rerating state of the subscription. It can be one state amongReratingStatus.ALREADY_LOCKED_FAILURE,ReratingStatus.COUNTER_RESTORATION_FAILUREorReratingStatus.BILLING_FAILUREfor failure types orReratingStatus.RESTORATION_SUCCESSorReratingStatus.RERATING_SUCCESSfor success types.- Returns:
- The rerating state of the subscription
- See Also:
-
setReratingLastStatus
Sets the rerating status of the subscription, which must be a value amongReratingStatus.ALREADY_LOCKED_FAILURE,ReratingStatus.COUNTER_RESTORATION_FAILUREorReratingStatus.BILLING_FAILUREfor failure types orReratingStatus.RESTORATION_SUCCESSorReratingStatus.RERATING_SUCCESSfor success types.- Parameters:
reratingLastStatus- The rerating state of the subscription- See Also:
-
getReratingSuggestedDate
Returns the suggested rerating date.- Returns:
- The suggested rerating date
-
setReratingSuggestedDate
Sets the suggested rerating date.- Parameters:
reratingSuggestedDate- The suggested rerating date
-
getEffective
Returns the effective date of this subscription.- Returns:
- This subscription effective date
- See Also:
-
setEffective
Sets the effective date of this subscription.- Parameters:
effective- The effective date of the subscription- See Also:
-
getExpiration
Returns the expiration date of this subscription.- Returns:
- This subscription expiration date
- See Also:
-
setExpiration
Sets the expiration date of this subscription.- Parameters:
expiration- The expiration date of the subscription- See Also:
-
getLastSnapshotDate
Returns the last snapshot date of this subscription.- Returns:
- The snapshot date of the subscription
- See Also:
-
setLastSnapshotDate
Sets the last snapshot date of this subscription.- Parameters:
lastSnapshotDate- The snapshot date of the subscription- See Also:
-
getReratingLastCode
Returns the last rerating code of this subscription; This code corresponds to the last rerating operation identifier that has been launched on this subscription.- Returns:
- The last rerating operation code of the subscription
- See Also:
-
setReratingLastCode
Sets the last rerating code of this subscription; This code corresponds to the last rerating operation identifier that has been launched on this subscription.- Parameters:
reratingLastCode- The last rerating operation code of the subscription- See Also:
-
getPriceFreezeEffective
Returns the price freeze effective date of this subscription.- Returns:
- This subscription price freeze effective date
- See Also:
-
setPriceFreezeEffective
Sets the price freeze effective date of this subscription.- Parameters:
priceFreezeEffective- The price freeze effective date of the subscription- See Also:
-
getPriceFreezeExpiration
Returns the price freeze expiration date of this subscription.- Returns:
- This subscription price freeze expiration date
- See Also:
-
setPriceFreezeExpiration
Sets the price freeze expiration date of this subscription.- Parameters:
priceFreezeExpiration- The priceFreeze expiration date of the subscription- See Also:
-
getCommitmentExpiration
Returns the commitment expiration date of this subscription.- Returns:
- This subscription commitment expiration date
- See Also:
-
setCommitmentExpiration
Sets the commitment expiration date of this subscription.- Parameters:
commitmentExpiration- The commitmentExpiration date of the subscription- See Also:
-
getSuspensionDate
Returns the suspension date of this subscription.- Returns:
- This subscription suspension date
- See Also:
-
setSuspensionDate
Sets the suspension date of this subscription.- Parameters:
suspensionDate- The suspension date of the subscription- See Also:
-
getResumptionDate
Returns the resumption date of this subscription.- Returns:
- This subscription resumption date
- See Also:
-
setResumptionDate
Sets the resumption date of this subscription.- Parameters:
resumptionDate- The resumption date of the subscription- See Also:
-
getCancellationDate
Returns the cancellation date of this subscription.- Returns:
- This subscription cancellation date
- See Also:
-
setCancellationDate
Sets the cancellation date of this subscription.- Parameters:
cancellationDate- he cancellation date of the subscription- See Also:
-
isOverrideDependencies
public boolean isOverrideDependencies()Returns whether the subscription overrides the charge dependencies of the offer.- Returns:
trueif the subscription overrides the charge dependencies of the offer,falseotherwise
-
setOverrideDependencies
public void setOverrideDependencies(boolean override) Sets whether the subscription overrides the charge dependencies of the offer.- Parameters:
override-trueif the subscription overrides the charge dependencies of the offer, false otherwise
-
getSubscriptions
Returns the subscriptions.- Returns:
- The
subscriptions
-
getChargeActivations
Returns the list of ChargeActivationModel.- Returns:
- The list of the associated
charge activations
-
getAdditionalInfos
Returns the list of AdditionalInfoModel.- Returns:
- The list of the associated
additional information items
-
getCounters
Returns the list ofCounterModel.- Returns:
- The list of the associated
counters
-
getContextChronology
Returns the offer context chronology of this subscription.- Returns:
- All the
subscription contextsin achronology
-
setContext
Sets the context of this subscription.- Parameters:
context- The context of this subscription
-
getContext
Returns the subscription context.- Returns:
- The context of this subscription
-
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:
name- 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
-
removeSubscription
-
addSubscription
-
addChargeActivation
-
addChargeActivation
-
retrieveAllCharges
Returns the charge activations of this subscription and all the charge activations of its sub-subcriptions.- Returns:
- A list of
charge activations
-
retrieveAllSubscriptions
Returns all the subscriptions which has this subscription as ancestor.- Returns:
- A list of
subscriptions
-
retrieveInvalidChargeSubCodes
Returns all the invalid charge activation subcodes.- Returns:
- A list of
charge activations
-