|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jimm.twice.ice.IceMachine jimm.twice.ice.Syndicator
The syndicator class implements behavior common to all syndicators. Subclasses need to manage subscribers and worry about HTTP.
We don't hold on to a list of subscribers because doing so would depend on the persistence mechanism used. For example, we may not want to hold a list of all subscribers in memory.
Field Summary | |
protected static java.lang.String |
LOG_FILE_PREFIX
|
protected static java.lang.String |
OFFER_SUBSCRIPTION_ID
|
protected int |
packageItemId
|
protected static int |
UNKNOWN_SUBSCRIPTION
|
Fields inherited from class jimm.twice.ice.IceMachine |
DEFAULT_LOGGER_PREFIX, domain, loggerPrefix, party, PING_RESPONSE_STRING |
Constructor Summary | |
Syndicator(java.lang.String domain,
Party party)
Constructor. |
Method Summary | |
abstract Cancellation |
cancel(Cancel cancelReq)
|
protected abstract PackageType |
generateItems(java.lang.String subscriptionId,
java.lang.String currentState)
Generates the ice item(s) and/or item ref(s) that satisfy the specified subscription id and builds a package containing them. |
protected abstract OfferType[] |
generateOffers(java.lang.String subscriberId)
Generates the ice-offer(s) that fill a catalog |
protected abstract java.lang.String |
getCatalogName()
Returns the name of the catalog sent in response to an get-catalog request. |
abstract PackageType |
getPackage(GetPackageType getPackageReq)
|
abstract Packages |
getPackages(GetPackages getPackagesReq)
|
abstract StatusType |
getStatus(GetStatus getStatusReq)
|
protected abstract java.lang.String |
getSubscriberURL(java.lang.String subscriberId)
Returns the URL of the specified subscriber (or null
if it is unknown). |
abstract void |
handlePing()
|
protected abstract boolean |
hasSubscriber(java.lang.String subscriberId)
Returns true if subscriberId is known. |
abstract void |
packageConfirmations(PackageConfirmationsType packageConfirmationReq)
|
abstract SubscriptionType |
subscribe(Subscribe subscribeReq)
|
Methods inherited from class jimm.twice.ice.IceMachine |
createIceHeader, getDomain, getLocationURL, getName, getParty, getRole, getUuid |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String LOG_FILE_PREFIX
protected static final int UNKNOWN_SUBSCRIPTION
protected static final java.lang.String OFFER_SUBSCRIPTION_ID
protected int packageItemId
Constructor Detail |
public Syndicator(java.lang.String domain, Party party)
LOG_FILE_PREFIX
.
domain
- the machine's domain, used for generating ids 'n stuffparty
- this machine's syndicator or subscriber informationMethod Detail |
protected abstract boolean hasSubscriber(java.lang.String subscriberId)
true
if subscriberId is known. This
method is abstract because we have ... er ... abstracted the persistence
mechanism out of this layer.
subscriberId
- a subscriber's UUIDprotected abstract java.lang.String getSubscriberURL(java.lang.String subscriberId)
null
if it is unknown). This method is abstract because we have abstracted
the persistence mechanism out of this layer.
subscriberId
- a subscriber's UUID
public abstract void handlePing() throws StatusCode
StatusCode
public abstract SubscriptionType subscribe(Subscribe subscribeReq) throws SubscriptionFault
SubscriptionFault
public abstract Cancellation cancel(Cancel cancelReq) throws StatusCode
StatusCode
public abstract StatusType getStatus(GetStatus getStatusReq) throws StatusCode
StatusCode
public abstract void packageConfirmations(PackageConfirmationsType packageConfirmationReq) throws StatusCode
StatusCode
public abstract Packages getPackages(GetPackages getPackagesReq) throws StatusCode
StatusCode
public abstract PackageType getPackage(GetPackageType getPackageReq) throws StatusCode
StatusCode
protected abstract PackageType generateItems(java.lang.String subscriptionId, java.lang.String currentState) throws StatusCode
subscriptionId
- the subscription idcurrentState
- the sender's subscription's current state
StatusCode
protected abstract java.lang.String getCatalogName()
protected abstract OfferType[] generateOffers(java.lang.String subscriberId) throws StatusCode
subscriberId
- the subscriber's UUID
StatusCode
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |