Package com.highdeal.pnr.hci
Class OneShotRateModel
java.lang.Object
com.highdeal.pnr.hci.RateModel
com.highdeal.pnr.hci.OneShotRateModel
- All Implemented Interfaces:
IXMLMarshallable,XMLMarshallable,ContextualNode
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
FieldsModifier and TypeFieldDescriptionstatic final StringEvent name for one-time event from a master business relationship.static final StringEvent name for the cancellation.static final StringEvent name for the early cancellation.static final StringEvent name for the resumption.static final StringEvent name for the subscription.static final StringEvent name for the suspension.static final StringThe value of that constant is the XML tag name of the one shot rate. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the one shot rate is valid.Gets available event names.getContext(ContextualNode child) Gets the context for the specified child.static Vector<PropertyDescriptionModel>getDefaultPropertyDescriptions(String eventName) Returns the descriptions for the default property according to the type of the event for one shot rates.Gets the name of the event that this one shot rate charges.voidmarshal(XMLOutputter output) Gives an XML representation of this object, including its children.voidmarshalChildren(XMLOutputter output) Gives an XML representation of the child objects of an object.voidsetAttributes(XMLAttributes atts) Sets the attributes of the XML representation of the element being processed.voidsetEventName(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
-
Field Details
-
SUBSCRIPTION_EVENT
Event name for the subscription.- See Also:
-
CANCELLATION_EVENT
Event name for the cancellation.- See Also:
-
EARLY_CANCELLATION_EVENT
Event name for the early cancellation.- See Also:
-
SUSPENSION_EVENT
Event name for the suspension.- See Also:
-
RESUMPTION_EVENT
Event name for the resumption.- See Also:
-
ANY_PROPAGATED_EVENT
Event name for one-time event from a master business relationship.- See Also:
-
TAG_NAME
The value of that constant is the XML tag name of the one shot rate.- See Also:
-
-
Constructor Details
-
OneShotRateModel
public OneShotRateModel()
-
-
Method Details
-
getEventName
Gets the name of the event that this one shot rate charges. Returned values are :- Returns:
- the name of the event.
-
setEventName
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:- The RateModel.checkValidity() returned true.
- The eventName is not null and is valid.
- Overrides:
checkValidityin classRateModel- Returns:
- true if the Rate is valid, false otherwise.
-
getContext
Gets the context for the specified child.- Parameters:
child- the child node- Returns:
- the context.
-
getAvailableEventNames
Gets available event names.- Returns:
- a Vector of
Stringcontaining all available event names.
-
setAttributes
Description copied from interface:XMLMarshallableSets the attributes of the XML representation of the element being processed.- Specified by:
setAttributesin interfaceXMLMarshallable- Overrides:
setAttributesin classRateModel- Parameters:
atts- TheXML attributesof the current element
-
marshal
Description copied from interface:XMLMarshallableGives an XML representation of this object, including its children.- Specified by:
marshalin interfaceIXMLMarshallable- Specified by:
marshalin interfaceXMLMarshallable- Overrides:
marshalin classRateModel- Parameters:
output- TheXML outputto marshal the object into
-
marshalChildren
Description copied from interface:IXMLMarshallableGives an XML representation of the child objects of an object.- Specified by:
marshalChildrenin interfaceIXMLMarshallable- Overrides:
marshalChildrenin classRateModel- Parameters:
output- TheXML outputto marshal the child objects into
-
getDefaultPropertyDescriptions
Returns the descriptions for the default property according to the type of the event for one shot rates. The vector containsPropertyDescriptionModel.- Parameters:
eventName- the name of the event.- Returns:
- a vector of
property description models.
-