com.ibm.ftt.resources.core
Class ResourceSubscription
java.lang.Object
com.ibm.ftt.resources.core.ResourceSubscription
- All Implemented Interfaces:
- IResourceSubscription
public abstract class ResourceSubscription
- extends Object
- implements IResourceSubscription
The default implementation of the IResourceSubscription.
To create an implementation of IResourceSubscription,
you can extend this class and then implement
IResourceSubscription.notifySubscriber(com.ibm.ftt.resources.core.events.IResourceSubscriptionEvent) 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;
}
}
COPY_RIGHT
public static final String COPY_RIGHT
- See Also:
- Constant Field Values
ResourceSubscription
public ResourceSubscription(Object subscriber)
- Creates a new ResourceSubscription and sets the given subscriber.
- Parameters:
subscriber - the subscriber who attached this subscription
getSubscriber
public Object getSubscriber()
- Description copied from interface:
IResourceSubscription
- Returns the subscriber that owns this subscription. A typical
implementation of
IResourceSubscription will update the
status of the subscriber based on information contained in the event.
- Specified by:
getSubscriber in interface IResourceSubscription
- Returns:
- the subscriber object or
null.
setSubscriber
public void setSubscriber(Object subscriber)
- Description copied from interface:
IResourceSubscription
- Sets the subscriber that owns this subscription. Subscriber should not
be
null. A typical implementation of
IResourceSubscription will update the status of the
subscriber based on information contained in the event.
- Specified by:
setSubscriber in interface IResourceSubscription
- Parameters:
subscriber - the subscriber who attached this subscription