com.highdeal.pnr.hci
Class OneShotRateModel

java.lang.Object
  extended by com.highdeal.pnr.hci.RateModel
      extended by com.highdeal.pnr.hci.OneShotRateModel
All Implemented Interfaces:
IXMLMarshallable, XMLMarshallable, ContextualNode

public class OneShotRateModel
extends RateModel

This class represents a one shot rate that applies on a particular internal event, such as subscription (for setup fees) or cancellation.

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:simpleType name="oneShotName">
   <xs:restriction base="xs:string">
      <xs:enumeration value="_subscription_event_"/>
      <xs:enumeration value="_cancellation_event_"/>
      <xs:enumeration value="_early_cancellation_event_"/>
      <xs:enumeration value="_suspension_event_"/>
      <xs:enumeration value="_resumption_event_"/>
      <xs:enumeration value="_any_propagated_event_"/>
   </xs:restriction>
 </xs:simpleType>
 <xs:element name="oneShot">
   <xs:complexType>
    <xs:sequence>
     <xs:element ref="component" minOccurs="1" maxOccurs="1"/>
    </xs:sequence>
     <xs:attribute name="eventName" type="oneShotName" use="required"/>
     <xs:attribute name="name" type="xs:string"/>
     <xs:attribute name="description" type="xs:string"/>
   </xs:complexType>
 </xs:element>


Field Summary
static java.lang.String ANY_PROPAGATED_EVENT
          Event name for one-time event from a master business relationship.
static java.lang.String CANCELLATION_EVENT
          Event name for the cancellation.
static java.lang.String EARLY_CANCELLATION_EVENT
          Event name for the early cancellation.
static java.lang.String RESUMPTION_EVENT
          Event name for the resumption.
static java.lang.String SUBSCRIPTION_EVENT
          Event name for the subscription.
static java.lang.String SUSPENSION_EVENT
          Event name for the suspension.
static java.lang.String TAG_NAME
          The value of that constant is the XML tag name of the one shot rate.
 
Constructor Summary
OneShotRateModel()
           
 
Method Summary
 boolean checkValidity()
          Returns true if the one shot rate is valid.
 java.util.Vector<java.lang.String> getAvailableEventNames()
          Gets available event names.
 RatingContextDescription getContext(ContextualNode child)
          Gets the context for the specified child.
static java.util.Vector<PropertyDescriptionModel> getDefaultPropertyDescriptions(java.lang.String eventName)
          Returns the descriptions for the default property according to the type of the event for one shot rates.
 java.lang.String getEventName()
          Gets the name of the event that this one shot rate charges.
protected  java.lang.String getEventNameFromAttributeName(java.lang.String attributeEventName)
          Get the event name of this one shot rate according to the specified xml attribute.
protected  java.lang.String getTagName()
          Returns the tag nameof this model.
 void marshal(XMLOutputter output)
          Gives an XML representation of this object, including its children.
 void marshalChildren(XMLOutputter output)
          Gives an XML representation of the child objects of an object.
 void setAttributes(XMLAttributes atts)
          Sets the attributes of the XML representation of the element being processed.
 void setEventName(java.lang.String name)
          Sets the name of the event that this one shot rate charges.
 
Methods inherited from class com.highdeal.pnr.hci.RateModel
addCharacterData, addChild, getDescription, getName, getParent, getRateComponent, inheritedContext, marshalAttributes, remove, setDescription, setName, setParent, setRateComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUBSCRIPTION_EVENT

public static final java.lang.String SUBSCRIPTION_EVENT
Event name for the subscription.

See Also:
Constant Field Values

CANCELLATION_EVENT

public static final java.lang.String CANCELLATION_EVENT
Event name for the cancellation.

See Also:
Constant Field Values

EARLY_CANCELLATION_EVENT

public static final java.lang.String EARLY_CANCELLATION_EVENT
Event name for the early cancellation.

See Also:
Constant Field Values

SUSPENSION_EVENT

public static final java.lang.String SUSPENSION_EVENT
Event name for the suspension.

See Also:
Constant Field Values

RESUMPTION_EVENT

public static final java.lang.String RESUMPTION_EVENT
Event name for the resumption.

See Also:
Constant Field Values

ANY_PROPAGATED_EVENT

public static final java.lang.String ANY_PROPAGATED_EVENT
Event name for one-time event from a master business relationship.

See Also:
Constant Field Values

TAG_NAME

public static final java.lang.String TAG_NAME
The value of that constant is the XML tag name of the one shot rate.

See Also:
Constant Field Values
Constructor Detail

OneShotRateModel

public OneShotRateModel()
Method Detail

getEventName

public java.lang.String getEventName()
Gets the name of the event that this one shot rate charges. Returned values are :

Returns:
the name of the event.

setEventName

public void setEventName(java.lang.String name)
Sets the name of the event that this one shot rate charges.

Parameters:
name - the name of the event. Allowed values are :

checkValidity

public boolean checkValidity()
Returns true if the one shot rate is valid. Rate valid if all the following conditions are met:

Overrides:
checkValidity in class RateModel
Returns:
true if the Rate is valid, false otherwise.

getContext

public RatingContextDescription getContext(ContextualNode child)
Gets the context for the specified child.

Parameters:
child - the child node
Returns:
the context.

getAvailableEventNames

public java.util.Vector<java.lang.String> getAvailableEventNames()
Gets available event names.

Returns:
a Vector of String containing all available event names.

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
Overrides:
setAttributes in class RateModel
Parameters:
atts - The XML attributes of the current element

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 IXMLMarshallable
Specified by:
marshal in interface XMLMarshallable
Overrides:
marshal in class RateModel
Parameters:
output - The XML output to marshal the object into

getTagName

protected java.lang.String getTagName()
Returns the tag nameof this model.

Returns:
TAG_NAME

getEventNameFromAttributeName

protected java.lang.String getEventNameFromAttributeName(java.lang.String attributeEventName)
Get the event name of this one shot rate according to the specified xml attribute.

Parameters:
attributeEventName - the name of the xml attribute
Returns:
the event name corresponding to the xml attribute

marshalChildren

public void marshalChildren(XMLOutputter output)
Description copied from interface: IXMLMarshallable
Gives an XML representation of the child objects of an object.

Specified by:
marshalChildren in interface IXMLMarshallable
Overrides:
marshalChildren in class RateModel
Parameters:
output - The XML output to marshal the child objects into

getDefaultPropertyDescriptions

public static java.util.Vector<PropertyDescriptionModel> getDefaultPropertyDescriptions(java.lang.String eventName)
Returns the descriptions for the default property according to the type of the event for one shot rates. The vector contains PropertyDescriptionModel.

Parameters:
eventName - the name of the event.
Returns:
a vector of property description models.

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)