|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--com.ibm.pvc.we.ins.TriggerHandlerV2
| Field Summary | |
protected boolean |
pinned
Pin this trigger in memory and do not cache out |
| Constructor Summary | |
TriggerHandlerV2()
|
|
| Method Summary | |
void |
activate()
Calling this method tells the trigger handler controller to start initiate the pending subscriptions and begin to accept subscription events. |
protected void |
deleteContent(java.lang.String contentID)
Delete the content stored under the contentID. |
void |
doDelete(TriggerRequest treq)
Delete this trigger and return all resources that are currently held by this trigger. |
void |
doGet(TriggerRequest req,
TriggerResponse resp)
Query the current state of the trigger. |
void |
doPost(TriggerRequest req,
TriggerResponse resp)
Update the state of a trigger. |
void |
doPut(TriggerRequest treq)
Create a new trigger instance. |
void |
drop()
Drop all incoming and queued up subscription events. |
protected com.ibm.pvc.we.ins.iqueue.CContent |
fetchContent(java.lang.String contentID)
Fetch the content wrapper object CContent stored under the contentID. |
int |
getLastErrorCode()
Get the last error, for example, if pause() too long, the input queue
may overflow. |
protected ANotificationService |
getNotificationService()
Get the NotificationService object for this trigger mananger. |
protected java.lang.String |
getOwnerName()
Get the user name that created this trigger |
protected java.lang.String |
getOwnerRealm()
Get the owner's realm name. |
java.util.Timer |
getTimer()
Get a Timer object to schedule TimerTask events |
java.lang.String[] |
getTopicAndSelector(int n)
|
long |
getTriggerExpirationTimeMillis()
Get the current expiration time in milliseconds for this trigger |
protected TriggerID |
getTriggerID()
Get the TriggerID for this trigger |
void |
handleMatch(com.ibm.pvc.we.ins.iqueue.ContentMessage msg)
Trigger manager calls this method when a subscribed event occurred. |
void |
init(com.ibm.pvc.we.ins.iqueue.TriggerHandlerController c,
long ttl,
int size)
Called by the TriggerHandlerController to set up this trigger. |
boolean |
isPinned()
Return the pin state of this trigger |
void |
pause(int dropPolicy)
Queue up subscription events and do not call the handleMatch() method. |
protected void |
publish(com.ibm.pvc.we.ins.iqueue.ContentMessage msg)
Publish a ContentMessage object. |
void |
remove()
Trigger initiated delete action. |
void |
restore(com.ibm.pvc.we.ins.iqueue.TriggerHandlerController c)
Called by the TriggerHandlerController when the TriggerManager server startup and the triggers are retrieved from the trigger store. |
void |
resume()
Resume accepting subscription events. |
void |
save()
Save this the serialize form of this trigger to the trigger store. |
protected java.lang.String |
saveContent(com.ibm.pvc.we.ins.iqueue.CContent ccontent)
Save the content into the content store. |
void |
setController(com.ibm.pvc.we.ins.iqueue.TriggerHandlerController c)
Restore the trigger handler controller setting in case this trigger was cast out to trigger store by the trigger manager cache. |
long |
setTriggerExpirationTimeMillis(long expirationTimeMillis)
Set the expiration time in milliseconds for this trigger The expiration time cannot exceed a maximum allowed expiration time for this trigger. |
int |
size()
Returns the maximum number of subscriptions that this trigger is allow to have. |
protected int |
subscribe(java.lang.String cs,
java.lang.String selector)
Create a subscription base on the content source name and the selector string. |
void |
unsubscribe()
Unsubscribe all subscriptions. |
void |
unsubscribe(int id)
Unsubsribe a subscription base on the subscription index. |
void |
unsubscribe(java.lang.String cs,
java.lang.String selector)
Unsubscribe a subscription base on the content source name and selector string. |
void |
update(int id,
java.lang.String cs,
java.lang.String selector)
Update a previous subscription with a new content source name and/or a new selector string. |
protected boolean |
updateContent(java.lang.String contentID,
com.ibm.pvc.we.ins.iqueue.CContent ccontent)
Update the content that was stored at this contentID location. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected boolean pinned
| Constructor Detail |
public TriggerHandlerV2()
| Method Detail |
public void doPut(TriggerRequest treq)
throws TriggerException
activate() to activate the event listening. It is recommended
that the activate() method be called prior to the exiting of this method. Otherwise,
an event match could occurred and the handleMatch is called while the
trigger has not completed this doPut() method.
It is not required that the activate() method be called during this method.
treq - TriggerRequest contains application data that is passed to this trigger.IQueueException - TriggerException -
public void doGet(TriggerRequest req,
TriggerResponse resp)
throws TriggerException
req - Trigger request object contain information for the trigger.resp - Trigger response that goes back to the application. Any information that the
trigger wants to send back to the application should beIQueueException -
public void doPost(TriggerRequest req,
TriggerResponse resp)
throws TriggerException
TriggerManager.updateTrigger(java.lang.String, com.ibm.pvc.we.ins.TriggerID, com.ibm.pvc.we.ins.TriggerRequest)
method call by the application.req - Trigger request object from the applicationresp - Trigger response object to be pass back to the applicationTriggerException -
public void doDelete(TriggerRequest treq)
throws TriggerException
treq - Trigger request object from the applicationTriggerException - public void handleMatch(com.ibm.pvc.we.ins.iqueue.ContentMessage msg)
msg - Content message that represent the occurance of a subscription eventIQueueException -
public void init(com.ibm.pvc.we.ins.iqueue.TriggerHandlerController c,
long ttl,
int size)
<TO DO> Move to a super class and hide it from the trigger programmer
c - Contextttl - Time to live in seconds - set by the init parameter of this trigger classsize - max number of subscriptions
public void restore(com.ibm.pvc.we.ins.iqueue.TriggerHandlerController c)
throws IQueueException
<TO DO> Move to a super class and hide it from the trigger programmer
c - The controller object for this trigger handlerIQueueException -
public void activate()
throws IQueueException
IQueueException - public void setController(com.ibm.pvc.we.ins.iqueue.TriggerHandlerController c)
<TO DO> Move to a super class and hide it from the trigger programmer
c - Trigger handler controller object
protected int subscribe(java.lang.String cs,
java.lang.String selector)
throws IQueueException
activate() method is called.
No checking of duplicate subscription is performed. When duplicate
subscription happens, then the handleMatch() method
is call the same number of times as the number of duplicates
with same content message.
cs - Content source name, for example, "stocks", "news", or "weather"selector - SQL92 filter string, for example, (symbol = 'IBM') AND (last > 100) - IQueueException -
public void update(int id,
java.lang.String cs,
java.lang.String selector)
throws IQueueException
id - Subscription id that was returned during the subscribe() method callcs - Content source nameselector - SQL92 selector string - IQueueException -
public void unsubscribe(java.lang.String cs,
java.lang.String selector)
throws IQueueException
subscribe()
method call.cs - Content source nameselector - SQL92 selector string - IQueueException -
public void unsubscribe(int id)
throws IQueueException
id - Subscription id returned from a subscribe() call - IQueueException - public void unsubscribe()
-
protected void publish(com.ibm.pvc.we.ins.iqueue.ContentMessage msg)
throws IQueueException
ContentMessage object.
This message is published under the content source name defined by the
topicName of the content message.msg - ContentMessage to be publish - IQueueException -
public void save()
throws IQueueException
- IQueueException - public void pause(int dropPolicy)
handleMatch() method.
This call has no effect on any currently executing handleMatch().
The parameter dropPolicy tells the trigger handler controller what to
do with the incoming subscription events when the input queue fills up during
the pause period.dropPolicy - Set to TriggerHandlerController.DROP_FIRST_MSG to drop the ealiest message in the
queue and queue the latest incoming message. Set to TriggerHandlerController.DROP_LAST_MSG
to drop the incoming message.public void drop()
handleMatch() when a subscription event
occurs. Any queued up subscription events in the input queue are removed.public void resume()
- public int getLastErrorCode()
pause() too long, the input queue
may overflow. The error is cleared after this call.
protected java.lang.String saveContent(com.ibm.pvc.we.ins.iqueue.CContent ccontent)
throws IQueueException
ccontent - Content wrapper object that holds the {@linl UserIDList}, expiration time in milliseconds,
and the Serializable content. - IQueueException -
protected boolean updateContent(java.lang.String contentID,
com.ibm.pvc.we.ins.iqueue.CContent ccontent)
throws IQueueException
UserIDList or the expiration time or
the content or all of above.contentID - content id returned by the saveContent()ccontent - Content wrapper that contains UserIDList, expiration time in milliseconds
and the Serializable content - IQueueException -
protected com.ibm.pvc.we.ins.iqueue.CContent fetchContent(java.lang.String contentID)
throws IQueueException
CContent stored under the contentID.contentID - - IQueueException - protected void deleteContent(java.lang.String contentID)
contentID - - protected ANotificationService getNotificationService()
public java.lang.String[] getTopicAndSelector(int n)
public int size()
public void remove()
public long getTriggerExpirationTimeMillis()
public long setTriggerExpirationTimeMillis(long expirationTimeMillis)
expirationTimeMillis - expiration time in millisecondspublic java.util.Timer getTimer()
Timer object to schedule TimerTask eventsTimer object manage by the trigger managerprotected final java.lang.String getOwnerName()
protected final java.lang.String getOwnerRealm()
protected final TriggerID getTriggerID()
TriggerID for this triggerTriggerIDpublic final boolean isPinned()
TriggerID
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||