com.sapportals.wcm.protocol.ice.protocol

Class ICEDeliveryPolicy

java.lang.Object
  extended by com.sapportals.wcm.protocol.ice.protocol.ICEDeliveryPolicy
All Implemented Interfaces:
IICEElementHandler, IICEElement, IDOMStorable

public class ICEDeliveryPolicy
extends Object
implements IICEElement, IICEElementHandler, IDOMStorable

ICEDeliveryPolicy represents an ice-delivery-policy element. A delivery rule is part of an ICEOffer during the subscription establishment or in an active subscription or part of an ICEAccessWindow.

Detailed information about ICE offer and subscription establishment could be found in the ICE 1.1 specification Section 4.4 ice-delivery-policy format

 <!ELEMENT ice-delivery-policy   (ice-delivery-rule+) >
 <!ATTLIST ice-delivery-policy
           startdate             CDATA           #IMPLIED
           stopdate              CDATA           #IMPLIED
 >

See Also:
ICEOffer,

Copyright 2004 SAP AG


Field Summary
static String CID_DELIVERY_POLICY
           
static String TAGNAME
           
 
Constructor Summary
ICEDeliveryPolicy(Attributes attributes)
          Creates a new delivery policy.
ICEDeliveryPolicy(Element element)
          Create an ICEDeliveryPolicy object from a DOM-element.
ICEDeliveryPolicy(List rules)
          Creates a new delivery policy containing a list of delivery rules.
ICEDeliveryPolicy(String configId)
           
 
Method Summary
 void deleteConfig(com.sapportals.config.fwk.IConfigPlugin icePlugin)
           
 boolean endElement(String name)
          Receive notification of the end of an element.
 String getConfigId()
          Gets the identifier of the configurable which stores the configuration of this policy.
 List getDeliveryRules()
          Get all delivery rules of the delivery policy.
 List getMatchingRules(Date date, Date lastUpdate, ICEDeliveryMode mode)
          Gets the delivery rules that match a certain time and delivery mode.
 Date getStartDate()
          Get the overall start date of the delivery policy.
 Date getStopDate()
          Get the overall stop date of the delivery policy.
 void saveConfig(com.sapportals.config.fwk.IConfigPlugin icePlugin)
           
 IICECharacterHandler startElement(String name, Attributes attributes, PreparsedXML input)
          Receive notification of the beginning of an element.
 Node store(Document document)
          Store the informations into a DOM.
 String toString()
          Returns a string representation of this delivery policy.
 void write(ContentHandler handler)
          Write the XML representation of the ICE element to a SAX ContentHandler.
 boolean writeChunk(ContentHandler handler)
          Write a chunk of XML to a SAX ContentHandler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TAGNAME

public static final String TAGNAME
See Also:
Constant Field Values

CID_DELIVERY_POLICY

public static final String CID_DELIVERY_POLICY
See Also:
Constant Field Values
Constructor Detail

ICEDeliveryPolicy

public ICEDeliveryPolicy(List rules)
Creates a new delivery policy containing a list of delivery rules.

Parameters:
rules - a list of DeliveryRule objects (must not be empty)

ICEDeliveryPolicy

public ICEDeliveryPolicy(Attributes attributes)
Creates a new delivery policy. This constructor is used by ICEInput to create an ICEOffer from an incoming payload.

Parameters:
attributes - The attributes of the ice-delivery-policy tag.

ICEDeliveryPolicy

public ICEDeliveryPolicy(String configId)
                  throws com.sapportals.config.fwk.InitialConfigException,
                         com.sapportals.config.fwk.CannotAccessConfigException
Throws:
com.sapportals.config.fwk.InitialConfigException
com.sapportals.config.fwk.CannotAccessConfigException

ICEDeliveryPolicy

public ICEDeliveryPolicy(Element element)
Create an ICEDeliveryPolicy object from a DOM-element.

Parameters:
element - A DOM-element containing the data of the delivery policy
Method Detail

getStartDate

public Date getStartDate()
Get the overall start date of the delivery policy.

Returns:
The overall start date or null

getStopDate

public Date getStopDate()
Get the overall stop date of the delivery policy.

Returns:
The overall stop date or null

getDeliveryRules

public List getDeliveryRules()
Get all delivery rules of the delivery policy.

Returns:
A List of delivery rules

getMatchingRules

public List getMatchingRules(Date date,
                             Date lastUpdate,
                             ICEDeliveryMode mode)
Gets the delivery rules that match a certain time and delivery mode.

Parameters:
date - the date to filter the rules (might be null)
lastUpdate - the date of the last update (might be null)
mode - the delivery mode to filter the rules
Returns:
a list of delivery rules that match date and mode or null if there are no matching rules

startElement

public IICECharacterHandler startElement(String name,
                                         Attributes attributes,
                                         PreparsedXML input)
                                  throws SAXException
Receive notification of the beginning of an element. ICEInput invokes this method upon a start element event from the underlying SAX parser.

Specified by:
startElement in interface IICEElementHandler
Parameters:
name - The local name of the XML element (we don't need namespaces at this point)
input - The preparsed XML stream to get the element content
attributes - @todo: Description of the incoming method parameter
Returns:
An IICECharacterHandler to receive the character events from the SAX parser or null if the character events could be ignored
Throws:
SAXException - on error (might wrap another exception)

endElement

public boolean endElement(String name)
                   throws SAXException
Receive notification of the end of an element. ICEInput invokes this method upon an end element event from the underlying SAX parser.

Specified by:
endElement in interface IICEElementHandler
Parameters:
name - The local name of the XML element (we don't need namespaces at this point)
Returns:
true if this handler should still receive SAX element events, false if this handler isn't interested in the following SAX element events
Throws:
SAXException - on error (might wrap another exception)

write

public void write(ContentHandler handler)
           throws SAXException
Write the XML representation of the ICE element to a SAX ContentHandler. This method is used by ICEOutput to create an ICE payload.

Specified by:
write in interface IICEElement
Parameters:
handler - The SAX ContentHandler (usually an XMLSerializer)
Throws:
SAXException - on error (might wrap another exception)

writeChunk

public boolean writeChunk(ContentHandler handler)
                   throws SAXException
Write a chunk of XML to a SAX ContentHandler. This method is used by ICEOutput to write an ICE payload in chunked mode.

Specified by:
writeChunk in interface IICEElement
Parameters:
handler - The SAX ContentHandler (usually a XMLSerializer)
Returns:
true if there are more chunks in the queue
Throws:
SAXException - on error (might wrap another exception)

store

public Node store(Document document)
Store the informations into a DOM.

Specified by:
store in interface IDOMStorable
Parameters:
document - The DOM document that should be used as factory for the DOM elements
Returns:
A Node containing the informations of the configuration object (this might be the document element of the XML that is eventually written to the repository)

saveConfig

public void saveConfig(com.sapportals.config.fwk.IConfigPlugin icePlugin)
                throws com.sapportals.config.fwk.ConfigException
Throws:
com.sapportals.config.fwk.ConfigException

deleteConfig

public void deleteConfig(com.sapportals.config.fwk.IConfigPlugin icePlugin)
                  throws com.sapportals.config.fwk.ConfigException
Throws:
com.sapportals.config.fwk.ConfigException

getConfigId

public String getConfigId()
Gets the identifier of the configurable which stores the configuration of this policy.

Returns:
the identifier of the configurable

toString

public String toString()
Returns a string representation of this delivery policy.

Overrides:
toString in class Object
Returns:
a string representation of this delivery policy
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM


Copyright 2011 SAP AG Complete Copyright Notice