|
|||||||||||
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 jimm.twice.syndicator.TwICESyndicator
A syndicator that can deal with subscriptions, persistence, and HTTP.
Field Summary | |
protected static int |
INLINE
|
protected org.apache.axis.MessageContext |
msgContext
|
protected java.lang.String |
pstoreDir
|
protected static int |
REF
|
protected jimm.twice.syndicator.SynSubscriber |
subscriber
|
protected IceSubscriberPortType |
subscriberHandle
|
protected static java.lang.String |
TWICE_CATALOG_NAME
|
Fields inherited from class jimm.twice.ice.Syndicator |
LOG_FILE_PREFIX, OFFER_SUBSCRIPTION_ID, packageItemId, UNKNOWN_SUBSCRIPTION |
Fields inherited from class jimm.twice.ice.IceMachine |
DEFAULT_LOGGER_PREFIX, domain, loggerPrefix, party, PING_RESPONSE_STRING |
Constructor Summary | |
TwICESyndicator()
Constructor. |
Method Summary | |
Cancellation |
cancel(Cancel cancelReq)
|
protected 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 OfferType[] |
generateOffers(java.lang.String subscriberId)
Generates the ice-offer(s) that fill a catalog |
PackageType |
getCatalog(GetPackageType getPackageReq)
|
protected java.lang.String |
getCatalogName()
Returns the name of the catalog sent in response to an get-catalog request. |
PackageType |
getPackage(GetPackageType getPackageReq)
|
Packages |
getPackages(GetPackages getPackagesReq)
|
StatusType |
getStatus(GetStatus getStatusReq)
|
java.lang.String |
getSubscriberId()
|
java.lang.String[] |
getSubscriberIds()
|
java.lang.String |
getSubscriberName()
|
protected java.lang.String |
getSubscriberURL(java.lang.String subscriberId)
Returns the URL given to us by the specified subscriber, or null if we've never heard of this subscriber. |
void |
handlePing()
|
protected boolean |
hasSubscriber(java.lang.String subscriberId)
Returns true if the subscriber id is known to this
syndicator. |
boolean |
isNewSubscriber()
|
boolean |
loadSubscriber(java.lang.String subscriberId)
Creates subscriber and asks it to load its information; returns true if the info already exists in permanent storage. |
void |
packageConfirmations(PackageConfirmationsType packageConfirmationsReq)
|
java.lang.String |
pingSubscriber(java.lang.String pingSubscriberId)
Pings the subscriber with the specified id and returns the response as a string. |
java.lang.String |
pushAll()
Pushes "push" subscriptions to all subscribers. |
java.lang.String |
pushOfferTo(java.lang.String offerId,
java.lang.String subscriberId)
Pushes all subscriptions to the specified subscriber and offer. |
java.lang.String |
pushTo(java.lang.String subscriberId)
Pushes subscriptions to the specified subscriber. |
void |
removeSubscriber(java.lang.String subscriberId)
Removes a subscriber from persistent store. |
void |
setMessageContext(org.apache.axis.MessageContext msgContext)
|
protected void |
storeSubscriber()
Asks the subscriber to store its information. |
SubscriptionType |
subscribe(Subscribe subscribeReq)
|
java.util.Iterator |
subscribers()
Returns an iterator over the list of subscriber keys (UUIDs). |
java.util.Iterator |
subscriptions()
|
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 int INLINE
protected static final int REF
protected static final java.lang.String TWICE_CATALOG_NAME
protected jimm.twice.syndicator.SynSubscriber subscriber
protected java.lang.String pstoreDir
protected IceSubscriberPortType subscriberHandle
protected org.apache.axis.MessageContext msgContext
Constructor Detail |
public TwICESyndicator()
Method Detail |
public java.lang.String getSubscriberId()
public java.lang.String getSubscriberName()
public boolean isNewSubscriber()
public java.util.Iterator subscriptions()
public void setMessageContext(org.apache.axis.MessageContext msgContext)
public java.lang.String[] getSubscriberIds()
public java.util.Iterator subscribers()
protected boolean hasSubscriber(java.lang.String subscriberId)
true
if the subscriber id is known to this
syndicator.
hasSubscriber
in class Syndicator
subscriberId
- a subscriber's UUIDprotected java.lang.String getSubscriberURL(java.lang.String subscriberId)
null
if we've never heard of this subscriber.
getSubscriberURL
in class Syndicator
subscriberId
- a subscriber's UUID
null
public void removeSubscriber(java.lang.String subscriberId)
This method is only used for unit testing right now.
subscriberId
- the subscriber to removepublic java.lang.String pingSubscriber(java.lang.String pingSubscriberId)
protected PackageType generateItems(java.lang.String subscriptionId, java.lang.String currentState) throws StatusCode
Syndicator
generateItems
in class Syndicator
subscriptionId
- the subscription idcurrentState
- the sender's subscription's current state
StatusCode
protected java.lang.String getCatalogName()
Syndicator
getCatalogName
in class Syndicator
protected OfferType[] generateOffers(java.lang.String subscriberId) throws StatusCode
Syndicator
generateOffers
in class Syndicator
subscriberId
- the subscriber's UUID
StatusCode
public PackageType getCatalog(GetPackageType getPackageReq) throws StatusCode
StatusCode
public Packages getPackages(GetPackages getPackagesReq) throws StatusCode
getPackages
in class Syndicator
StatusCode
public PackageType getPackage(GetPackageType getPackageReq) throws StatusCode
getPackage
in class Syndicator
StatusCode
public StatusType getStatus(GetStatus getStatusReq) throws StatusCode
getStatus
in class Syndicator
StatusCode
public void packageConfirmations(PackageConfirmationsType packageConfirmationsReq) throws StatusCode
packageConfirmations
in class Syndicator
StatusCode
public void handlePing() throws StatusCode
handlePing
in class Syndicator
StatusCode
public SubscriptionType subscribe(Subscribe subscribeReq) throws SubscriptionFault
subscribe
in class Syndicator
SubscriptionFault
public Cancellation cancel(Cancel cancelReq) throws StatusCode
cancel
in class Syndicator
StatusCode
public java.lang.String pushAll()
public java.lang.String pushTo(java.lang.String subscriberId)
This method only pushes the subscriptions whose mode is "push".
subscriberId
- the subscriber id
public java.lang.String pushOfferTo(java.lang.String offerId, java.lang.String subscriberId)
This method only pushes the subscriptions whose mode is "push".
subscriberId
- the subscriber idofferId
- the offer id
public boolean loadSubscriber(java.lang.String subscriberId)
true
if the info already exists in permanent storage.
If subscriber does not already exist, returns false
.
Always sets our subscriber to the one that was created and (possibly)
loaded.
subscriberId
- the subscriber's UUID
true
if the subscriber's info already existed in
our permanent storeprotected void storeSubscriber()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |