com.sapportals.wcm.protocol.ice.protocol

Class ICEPackage

java.lang.Object
  extended by com.sapportals.wcm.protocol.ice.protocol.ICEItemBase
      extended by com.sapportals.wcm.protocol.ice.protocol.ICEItemCollection
          extended by com.sapportals.wcm.protocol.ice.protocol.ICEPackage
All Implemented Interfaces:
IICEElementHandler, IICEElement, IICERequestElement, IICEResponseElement

public class ICEPackage
extends ICEItemCollection
implements IICERequestElement, IICEResponseElement, IICEElementHandler

ICEPackage is a representation of an ice-package element. During a package pull operation an ICEPackage is a response from the syndicator, during a push operation it is a request to the subscriber.

Detailed information about package pull resp. push operations could be found in the ICE 1.1 specification section 5.3 resp. section 5.4 , the ice-package format is described in section 5.2 . ice-package format

 <!ENTITY % cm.content           "ice-item-group |
                                  ice-item |
                                  ice-item-ref" >
 <!ENTITY % cm.package           "((ice-item-remove+, (%cm.content;)*) |
                                  (%cm.content;)+)" >
 <!ELEMENT ice-package         (%cm.package;)   >
 <!ATTLIST ice-package
           activation            CDATA           #IMPLIED
           atomic-use            (false | true)  "false"
           confirmation          (false | true)  "false"
           editable              (false | true)  "false"
           exclusion             CDATA           #IMPLIED
           expiration            CDATA           #IMPLIED
           fullupdate            (false | true)  "false"
           xml:lang              CDATA           #IMPLIED
           new-state             CDATA           #REQUIRED
           old-state             CDATA           #REQUIRED
           package-id            CDATA           #REQUIRED
           show-credit           CDATA           #IMPLIED
           subscription-id       CDATA           #REQUIRED

           ip-status             CDATA           #IMPLIED
           license               CDATA           #IMPLIED
           item-repair           (false | true)  "false"
           rights-holder         CDATA           #IMPLIED
 >

See Also:

Copyright 2004 SAP AG


Field Summary
static String STATE_INITIAL
           
static String TAGNAME
           
 
Fields inherited from class com.sapportals.wcm.protocol.ice.protocol.ICEItemCollection
m_itemIterator
 
Constructor Summary
ICEPackage(Attributes attributes)
          Create a new ICEPackage.
ICEPackage(String packageID, String subscriptionID, String oldState, String newState, IICEItemIterator itemIterator)
          Create a new ICEPackage.
 
Method Summary
 boolean endElement(String name)
          Receive notification of the end of an element.
 String getNewState()
          Get the if of the state after this package has been processed.
 String getOldState()
          Get the id of the state this package depends on.
 String getPackageID()
          Get the id of the package.
 String getSubscriptionID()
          Get the id of the subscription.
 boolean isAtomicUse()
          Check if the ICE package is considered as a single entity.
 boolean isEditable()
          Check if the content of the ICE package is editable.
 boolean isFullupdate()
          Check if the ICE package contains a full update.
 boolean isItemRepair()
          Check if the the ICE package item repair flag is set.
 void setFullupdate(boolean fullupdate)
          Set the ICE package to full update.
 void setItemHandler(IICEItemHandler itemHandler)
          Register an IICEItemHandler that should receive notifications about the ICE items inside the package.
 void setItemRepair(boolean itemRepair)
          Set the ICE package item repair flag.
 IICECharacterHandler startElement(String name, Attributes attributes, PreparsedXML input)
          Receive notification of the beginning of an element.
 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

STATE_INITIAL

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

ICEPackage

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

Parameters:
attributes - The attributes of the ice-package tag
Throws:
SAXException - Exception raised in failure situation
SAXException - if the ice-package tag is invalid

ICEPackage

public ICEPackage(String packageID,
                  String subscriptionID,
                  String oldState,
                  String newState,
                  IICEItemIterator itemIterator)
Create a new ICEPackage.

Parameters:
packageID - The id of the package
subscriptionID - The id of the subscription
oldState - The id of the state this package depends on
newState - The id of the state after this package has been processed
itemIterator - @todo: Description of the incoming method parameter
Method Detail

setFullupdate

public void setFullupdate(boolean fullupdate)
Set the ICE package to full update.

Parameters:
fullupdate - true if the package contains a full update
See Also:
isFullupdate()

setItemRepair

public void setItemRepair(boolean itemRepair)
Set the ICE package item repair flag.

Parameters:
itemRepair - true if the package contains an individual asset pair
See Also:
isItemRepair()

setItemHandler

public void setItemHandler(IICEItemHandler itemHandler)
Register an IICEItemHandler that should receive notifications about the ICE items inside the package.

Parameters:
itemHandler - The IICEItemHandler that should receive the notifications

getPackageID

public String getPackageID()
Get the id of the package.

Returns:
The id of the package

getSubscriptionID

public String getSubscriptionID()
Get the id of the subscription.

Returns:
The id of the subscription

getOldState

public String getOldState()
Get the id of the state this package depends on.

Returns:
The id of the state this package depends on

getNewState

public String getNewState()
Get the if of the state after this package has been processed.

Returns:
The id of the state after this package has been processed

isFullupdate

public boolean isFullupdate()
Check if the ICE package contains a full update. Indicates whether the processing of the package requires a full update of all content previously delivered in the subscription. A full update implies that all content previously delivered MUST be removed. The package MAY contain additions that update previously delivered content. At the end of the processing, any content that was not updated by the additions in this package MUST not exist on the Subscribers system. The default value, false , indicates that the package is an incremental update.

Returns:
true if the package contains a full update

isItemRepair

public boolean isItemRepair()
Check if the the ICE package item repair flag is set. This flag is set if the package is send in response to an ice-repair-item request and only contains an individual asset pair.

Detailed informationscould be found in the ICE 1.1 specification section 5.5.3 .

Returns:
true if the package contains an individual asset pair

isAtomicUse

public boolean isAtomicUse()
Check if the ICE package is considered as a single entity. Indicates a presentation constraint that all of the content delivered must be used or none of it is allowed to be used. The default value, false , indicates that atomic use of the content is not required.

Returns:
false if the package is to be considered as a single entity

isEditable

public boolean isEditable()
Check if the content of the ICE package is editable. Indicates whether the Subscriber may modify the information or must use it exactly as it is delivered. The default value, false , indicates that the content is not editable and therefore MUST be used exactly as it was delivered.

Returns:
true if the content of the package is editable

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)
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 2012 SAP AG Complete Copyright Notice