oracle.syndication.client.local
Class ICESampleOfferManager

java.lang.Object
  |
  +--oracle.syndication.client.local.ICESampleOfferManager

public class ICESampleOfferManager
extends java.lang.Object
implements ICEClientOfferManager, ICEClientOfferConstants, ICEStatusCode

Reference implementation of the ICEClientOfferManager interface, which is used for clients to keep track of the catalogs / offers received from the Syndication Server and all the established subscriptions.

Since:
9.0.0.0.0 Beta

Constructor Summary
ICESampleOfferManager()
          Empty constructor does some initializations
 
Method Summary
TypeMethod
 Ice_contact getCatalogContact()
          Get the contact information for the current catalog response.
 java.lang.String getCurrentState(java.lang.String szSubscriptionId)
          Return the current state for the given subscription in order to retrieve content from the server
 int getNumberOfOfferGroups()
          Due to the fixed sturcture of ICE payload, any catalog is required to contain ICE-OFFER-GROUP as the starting element.
 Ice_offer getOffer(java.lang.String szOfferId)
          Get the offer in the current catalog stored at the client side by its key : group description
 java.util.Iterator getOfferGroups()
          Get all the offer-groups in the current catalog stored at the client side
 java.lang.String getRawServerResponse(java.lang.String szResponseType)
          Get the raw response that's been stored.
 java.lang.String getServerRequest(java.lang.String szRequestType)
          String version of the subscription
 Ice_payload getServerResponse(java.lang.String szResponseType)
          Get the Ice_payload that's been stored.
 java.lang.String getSubscription(java.lang.String szSubsId)
          Returns a String representation of the subscription given the subscription Id.
 java.util.Iterator getSubscriptionIds()
          Returns the list of subscription Ids
 void removeSubscription(java.lang.String szSubscriptionId)
          Remove the subscription response from the server.
 void setServerRequest(java.lang.String szRequestType, java.io.Reader rdSubscribe)
          Set the user's subscribe request.
 void setServerResponse(java.lang.String szResponseType, Ice_payload payload)
          Store the offer-groups/offers
 void updateCurrentState(java.lang.String szSubscriptionId, java.lang.String szNewState)
          Each time after a PULL content, the client needs to update its local subscriptiontable for the "current state"
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ICESampleOfferManager

public ICESampleOfferManager()
Empty constructor does some initializations
Method Detail

setServerResponse

public void setServerResponse(java.lang.String szResponseType,
                              Ice_payload payload)
                       throws OSSException
Store the offer-groups/offers
Specified by:
setServerResponse in interface ICEClientOfferManager
Parameters:
iResponseType - Type of the response we're remembering
szRawResponse - String representation of the response
payload - ICE Payload representation of the response

getRawServerResponse

public java.lang.String getRawServerResponse(java.lang.String szResponseType)
Get the raw response that's been stored.
Specified by:
getRawServerResponse in interface ICEClientOfferManager
Parameters:
szResponseType - Type of the response remembered.

getServerResponse

public Ice_payload getServerResponse(java.lang.String szResponseType)
Get the Ice_payload that's been stored.
Specified by:
getServerResponse in interface ICEClientOfferManager
Parameters:
szResponseType - Type of the response remembered.

getCatalogContact

public Ice_contact getCatalogContact()
                              throws OSSException
Get the contact information for the current catalog response.
Specified by:
getCatalogContact in interface ICEClientOfferManager

getNumberOfOfferGroups

public int getNumberOfOfferGroups()
                           throws OSSException
Due to the fixed sturcture of ICE payload, any catalog is required to contain ICE-OFFER-GROUP as the starting element. No ICE-OFFER can be included without a ICE-OFFER-GROUP as its parent node
Specified by:
getNumberOfOfferGroups in interface ICEClientOfferManager

getOfferGroups

public java.util.Iterator getOfferGroups()
                                  throws OSSException
Get all the offer-groups in the current catalog stored at the client side
Specified by:
getOfferGroups in interface ICEClientOfferManager

getOffer

public Ice_offer getOffer(java.lang.String szOfferId)
                   throws OSSException
Get the offer in the current catalog stored at the client side by its key : group description
Specified by:
getOffer in interface ICEClientOfferManager

setServerRequest

public void setServerRequest(java.lang.String szRequestType,
                             java.io.Reader rdSubscribe)
                      throws OSSException
Set the user's subscribe request.
Specified by:
setServerRequest in interface ICEClientOfferManager
Parameters:
rdSubscribe - The complete ICE payload which contains all the subscribed offers TODO: Change this to take in just a string. Have the caller pass in a String already.

getServerRequest

public java.lang.String getServerRequest(java.lang.String szRequestType)
String version of the subscription
Specified by:
getServerRequest in interface ICEClientOfferManager

removeSubscription

public void removeSubscription(java.lang.String szSubscriptionId)
Remove the subscription response from the server.
Specified by:
removeSubscription in interface ICEClientOfferManager

getSubscriptionIds

public java.util.Iterator getSubscriptionIds()
Returns the list of subscription Ids
Specified by:
getSubscriptionIds in interface ICEClientOfferManager

getSubscription

public java.lang.String getSubscription(java.lang.String szSubsId)
Returns a String representation of the subscription given the subscription Id.
Specified by:
getSubscription in interface ICEClientOfferManager

getCurrentState

public java.lang.String getCurrentState(java.lang.String szSubscriptionId)
Return the current state for the given subscription in order to retrieve content from the server
Specified by:
getCurrentState in interface ICEClientOfferManager

updateCurrentState

public void updateCurrentState(java.lang.String szSubscriptionId,
                               java.lang.String szNewState)
Each time after a PULL content, the client needs to update its local subscriptiontable for the "current state"
Specified by:
updateCurrentState in interface ICEClientOfferManager