com.sapportals.wcm.protocol.ice.protocol

Class ICEOffer

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

public class ICEOffer
extends Object
implements IICERequestElement, IICEElementHandler, IDOMStorable

ICEOffer represents an ice-offer element. An ICEOffer is an integral part of the subscription establischment between subsriber and syndicator. Note that an ICEOffer could be part of an catalog as well as a subscription request from the subscriber to the syndicator.

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

 <!ELEMENT ice-offer ( ice-delivery-policy,
                       ice-business-term* ) >
 <!ATTLIST ice-offer
           offer-id              CDATA           #IMPLIED
           constraints-hash      CDATA           #IMPLIED
           constraints-hash-method CDATA         #IMPLIED
           constraints-url       CDATA           #IMPLIED
           description           CDATA           #REQUIRED
           expiration-date       CDATA           #IMPLIED
           product-name          CDATA           #IMPLIED
           subscription-id       CDATA           #IMPLIED
           atomic-use            (false | true)  "false"
           editable              (false | true)  "false"
           ip-status             CDATA           #IMPLIED
           rights-holder         CDATA           #IMPLIED
           show-credit           (true | false)  "false"
           usage-required        (true | false)  "false"
           type       (protocol | subscription)  "subscription"
 >

Copyright 2004 SAP AG


Field Summary
static String NEW_SUBSCRIPTION
           
static String TAGNAME
           
 
Constructor Summary
ICEOffer(Attributes attributes)
          Create a new ICEOffer.
ICEOffer(Element element)
          Create an ICEOffer object from a DOM-element.
ICEOffer(String offerID, String description, String subscriptionID, ICEDeliveryPolicy deliveryPolicy)
          Create a new ICEOffer.
 
Method Summary
 boolean endElement(String name)
          Receive notification of the end of an element.
 ICEDeliveryPolicy getDeliveryPolicy()
          Get the delivery policy of the offer.
 String getDescription()
          Get the description of the offer.
 String getOfferID()
          Get the if of the offer.
 String getSubscriptionID()
          Get the id of the subscription this offer belongs to.
 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.
 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, toString, wait, wait, wait
 

Field Detail

TAGNAME

public static final String TAGNAME
See Also:
Constant Field Values

NEW_SUBSCRIPTION

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

ICEOffer

public ICEOffer(String offerID,
                String description,
                String subscriptionID,
                ICEDeliveryPolicy deliveryPolicy)
Create a new ICEOffer.

Parameters:
offerID - The id of the offer
description - The description of the offer
subscriptionID - The id of the subscription if applicable
deliveryPolicy - @todo: Description of the incoming method parameter

ICEOffer

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

Parameters:
attributes - The attributes of the ice-offer tag

ICEOffer

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

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

getOfferID

public String getOfferID()
Get the if of the offer.

Returns:
The id of the offer

getDescription

public String getDescription()
Get the description of the offer.

Returns:
The description of the offer

getSubscriptionID

public String getSubscriptionID()
Get the id of the subscription this offer belongs to. If the offer does not belong to a subscription (i.e. it is part of an ice-catalog during subscription establishment) the default value "ICE-NEW-SUBSCRIPTION" is returned.

Returns:
The id of the subscription

getDeliveryPolicy

public ICEDeliveryPolicy getDeliveryPolicy()
Get the delivery policy of the offer.

Returns:
The delivery policy of the offer

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)
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