|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IResourceSubscription
The IResourceSubscription is an interface for the subscription
to attach to the IResourcePublisher.
To subscribe to resource events,
ResourceSubscription, and override
the notifySubscriber(com.ibm.ftt.resources.core.events.IResourceSubscriptionEvent)setSubscriber(java.lang.Object) to set subscriber.IResourceSubscription object to
IResourcePublisher.subscribe(com.ibm.ftt.resources.core.IResourceSubscription) methodnotifySubscriber(com.ibm.ftt.resources.core.events.IResourceSubscriptionEvent) will be
called by the IResourcePublisher.
ResourceSubscription.
IResourcePublisher,
ResourceSubscription| Field Summary | |
|---|---|
static String |
COPY_RIGHT
|
| Method Summary | |
|---|---|
Object |
getSubscriber()
Returns the subscriber that owns this subscription. |
void |
notifySubscriber(IResourceSubscriptionEvent event)
This method is called by the IResourcePublisher when an event
is published. |
void |
setSubscriber(Object subscriber)
Sets the subscriber that owns this subscription. |
| Field Detail |
|---|
static final String COPY_RIGHT
| Method Detail |
|---|
Object getSubscriber()
IResourceSubscription will update the
status of the subscriber based on information contained in the event.
null.void setSubscriber(Object subscriber)
null. A typical implementation of
IResourceSubscription will update the status of the
subscriber based on information contained in the event.
subscriber - the subscriber who attached this subscriptionvoid notifySubscriber(IResourceSubscriptionEvent event)
IResourcePublisher when an event
is published. A typical implementation of
IResourceSubscription will update the status of the
subscriber based on information contained in the event.
To create an implementation of this IResourceSubscription,
you can extend an abstract base class ResourceSubscription and
implement this method. The following is a sample template of this method:
public void notifySubscriber(IResourceSubscriptionEvent event) {
Object subscriber = getSubscriber();
if (subscriber == null) {
return;
}
switch (event.getEventType()) {
case IResourceSubscriptionEvent.DELETE:
// Your code for DELETE event here ...
break;
case IResourceSubscriptionEvent.RENAME:
break;
case IResourceSubscriptionEvent.ADD_MEMBER:
break;
case IResourceSubscriptionEvent.REMOVE_MEMBER:
break;
case IResourceSubscriptionEvent.REMOVE:
break;
case IResourceSubscriptionEvent.MIGRATE:
break;
case IResourceSubscriptionEvent.RECALL:
break;
case IResourceSubscriptionEvent.STALE:
break;
case IResourceSubscriptionEvent.REFRESH:
break;
default:
ResourcesCorePlugin.getDefault().writeMsg(Level.FINEST, "Received unknown event " + event);
break;
}
}
event - the published eventResourceSubscription
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||