com.sapportals.wcm.protocol.ice.protocol

Class ICEDeliveryRule

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

public class ICEDeliveryRule
extends Object
implements IICEElement, IDOMStorable

ICEDeliveryRule represents an ice-delivery-rule element. A delivery rule is part of an ICEDeliveryPolicy during the subscription establishment or in an active subscription. Detailed information about ICE offer and subscription establishment could be found in the ICE 1.1 specification Section 4.4 ice-delivery-rule format

 <!ELEMENT ice-delivery-rule     (ice-negotiable*) >
 <!ATTLIST ice-delivery-rule
           mode                  (push | pull)   #REQUIRED
           monthday              NMTOKENS        #IMPLIED
           weekday               NMTOKENS        #IMPLIED
           startdate             CDATA           #IMPLIED
           starttime             CDATA           #IMPLIED
           stopdate              CDATA           #IMPLIED
           duration              CDATA           #IMPLIED
           min-update-interval   CDATA           #IMPLIED
           max-update-interval   CDATA           #IMPLIED
           min-num-updates       CDATA           #IMPLIED
           max-num-updates       CDATA           #IMPLIED
           url                   CDATA           #IMPLIED
           maxcount              CDATA           #IMPLIED
           maxfreq               CDATA           #IMPLIED
           mincount              CDATA           #IMPLIED
           minfreq               CDATA           #IMPLIED
 >
 

See Also:

Copyright 2004 SAP AG


Field Summary
static String CID_DELIVERY_RULE
          Description of the Field
static String TAGNAME
          Description of the Field
 
Constructor Summary
ICEDeliveryRule(Attributes attributes)
          Create a new ICEDeliveryRule.
ICEDeliveryRule(Element element)
          Create an ICEDeliveryRule object from a DOM-element.
ICEDeliveryRule(ICEDeliveryMode mode)
          Create a new ICEDeliveryRule.
ICEDeliveryRule(String configId)
           
 
Method Summary
 Object clone()
          Returns a clone of this delivery rule.
 void deleteConfig(com.sapportals.config.fwk.IConfigPlugin icePlugin)
           
 boolean equals(Object obj)
          Compare two delivery rules.
 String getConfigId()
          Gets the identifier of the configurable which stores the configuration of this rule.
 ICEDeliveryMode getDeliveryMode()
          Get the delivery mode.
 long getDuration()
          Get the duration.
 long getMaxUpdateInterval()
          Get the maximum update interval.
 long getMinUpdateInterval()
          Get the minimum update interval.
 int[] getMonthDay()
          Get the allowed month days.
 Date getStartDate()
          Get the start date.
 Date getStartTime()
          Get the start time.
 Date getStopDate()
          Get the stop date.
 String getUrl()
          Get the url of the delivery policy.
 int[] getWeekDay()
          Get the allowed week days.
 int hashCode()
          Calculate a hash code for the delivery rule.
 boolean match(ICEDeliveryMode mode, Date date, Date lastUpdate)
          Checks if a certain time is matched by this delivery rule.
 void saveConfig(com.sapportals.config.fwk.IConfigPlugin icePlugin)
           
 void setMaxUpdateInterval(long maxUpdateInterval)
          Set the maximum update interval.
 void setMinUpdateInterval(long minUpdateInterval)
          Set the minimum update interval.
 void setMonthDay(int[] monthDay)
          Set the allowed month days.
 void setStartDate(Date startDate)
          Set the start date of the delivery rule.
 void setStopDate(Date stopDate)
          Set the stop date of the delivery rule.
 void setTimeWindow(Date startTime, long duration)
          Set the start time and duration.
 void setUrl(String url)
          Set the url of the delivery policy.
 void setWeekDay(int[] weekDay)
          Set the allowed week days.
 Node store(Document document)
          Store the informations into a DOM.
 String toString()
          Returns a string representation of this delivery rule.
 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
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TAGNAME

public static final String TAGNAME
Description of the Field

See Also:
Constant Field Values

CID_DELIVERY_RULE

public static final String CID_DELIVERY_RULE
Description of the Field

See Also:
Constant Field Values
Constructor Detail

ICEDeliveryRule

public ICEDeliveryRule(ICEDeliveryMode mode)
Create a new ICEDeliveryRule.

Parameters:
mode - The delivery mode (push or pull)

ICEDeliveryRule

public ICEDeliveryRule(Attributes attributes)
                throws SAXException
Create a new ICEDeliveryRule. This constructor is used by ICEInput to create an ICEOffer from an incomming payload.

Parameters:
attributes - The attributes of the ice-delivery-policy tag.
Throws:
SAXException - Exception raised in failure situation
SAXException - on error (might encapsulate another exception

ICEDeliveryRule

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

Parameters:
element - A DOM-element containing the data of the delivery rule

ICEDeliveryRule

public ICEDeliveryRule(String configId)
                throws com.sapportals.config.fwk.InitialConfigException,
                       com.sapportals.config.fwk.CannotAccessConfigException
Parameters:
configProxy - Description of the Parameter
configId - Description of the Parameter
Throws:
com.sapportals.config.fwk.CannotAccessConfigException - Description of the Exception
com.sapportals.config.fwk.InitialConfigException
Method Detail

setUrl

public void setUrl(String url)
Set the url of the delivery policy.

Parameters:
url - The url of the delivery policy

setStartDate

public void setStartDate(Date startDate)
Set the start date of the delivery rule.

Parameters:
startDate - The start date

setStopDate

public void setStopDate(Date stopDate)
Set the stop date of the delivery rule.

Parameters:
stopDate - The stop date

setTimeWindow

public void setTimeWindow(Date startTime,
                          long duration)
Set the start time and duration.

Parameters:
startTime - The start time
duration - The duration

setMonthDay

public void setMonthDay(int[] monthDay)
Set the allowed month days.

Parameters:
monthDay - The allowed month days

setWeekDay

public void setWeekDay(int[] weekDay)
Set the allowed week days.

Parameters:
weekDay - The allowed week days

setMinUpdateInterval

public void setMinUpdateInterval(long minUpdateInterval)
Set the minimum update interval.

Parameters:
minUpdateInterval - The minimum update interval

setMaxUpdateInterval

public void setMaxUpdateInterval(long maxUpdateInterval)
Set the maximum update interval.

Parameters:
maxUpdateInterval - The maximum update interval

getUrl

public String getUrl()
Get the url of the delivery policy.

Returns:
The url of the delivery policy or null

getStartDate

public Date getStartDate()
Get the start date.

Returns:
The start date or null

getStopDate

public Date getStopDate()
Get the stop date.

Returns:
The stop date or null

getStartTime

public Date getStartTime()
Get the start time.

Returns:
The start time or null

getDuration

public long getDuration()
Get the duration.

Returns:
The duration

getMonthDay

public int[] getMonthDay()
Get the allowed month days.

Returns:
The allowed month days or null if any is allowed

getWeekDay

public int[] getWeekDay()
Get the allowed week days.

Returns:
The allowed week days or null if any is allowed

getDeliveryMode

public ICEDeliveryMode getDeliveryMode()
Get the delivery mode.

Returns:
The delivery mode (push or pull)

getMinUpdateInterval

public long getMinUpdateInterval()
Get the minimum update interval.

Returns:
The minimum update interval or -1 if not set.

getMaxUpdateInterval

public long getMaxUpdateInterval()
Get the maximum update interval.

Returns:
The maximum update interval or -1 if not set.

getConfigId

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

Returns:
the identifier of the configurable

clone

public Object clone()
Returns a clone of this delivery rule.

Overrides:
clone in class Object
Returns:
a clone of this delivery rule (object of type ICEDeliveryRule)

match

public boolean match(ICEDeliveryMode mode,
                     Date date,
                     Date lastUpdate)
Checks if a certain time is matched by this delivery rule.

Parameters:
mode - the delivery mode to filter the rules
date - the date that has to be matched (might be null)
lastUpdate - the date of the last update (might be null)
Returns:
true if this rule matches the specified filter, false otherwise

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
Parameters:
deep - Description of the Parameter
Throws:
com.sapportals.config.fwk.ConfigException - Description of the Exception

deleteConfig

public void deleteConfig(com.sapportals.config.fwk.IConfigPlugin icePlugin)
                  throws com.sapportals.config.fwk.ConfigException
Throws:
com.sapportals.config.fwk.ConfigException - Description of the Exception

equals

public boolean equals(Object obj)
Compare two delivery rules.

Overrides:
equals in class Object
Parameters:
obj - The object to compare to
Returns:
true if this deliver rule is equal to obj

hashCode

public int hashCode()
Calculate a hash code for the delivery rule.

Overrides:
hashCode in class Object
Returns:
The hash code of the delivery rule

toString

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

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

This class can be accessed from:


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


Copyright 2011 SAP AG Complete Copyright Notice