TPUNSUBSCRIBE-unsubscribe to an event
01 TPEVTDEF-REC.TPSTATUS-REC
COPY TPEVTDEF.
01 .TPEVTDEF-REC
COPY TPSTATUS.
CALL "TPUNSUBSCRIBE" USING TPSTATUS-REC.
The caller uses TPUNSUBSCRIBE to remove an event subscription or a set of event subscriptions from the BEA TUXEDO System Event Broker's list of active subscriptions. SUBSCRIPTION-HANDLE in TPEVTDEF-REC is an event subscription handle returned by TPSUBSCRIBE(). Setting SUBSCRIPTION-HANDLE to the wildcard value, -1, directs TPUNSUBSCRIBE to unsubscribe to all non-persistent subscriptions previously made by the calling process. Non-persistent subscriptions are those made with TPEVNOPERSIST set when TPSUBSCRIBE() was called. Persistent subscriptions can be deleted only by using the handle returned by TPSUBSCRIBE().
Note that the -1 handle removes only those subscriptions made by the calling process and not any made by previous instantiations of the caller (for example, a server that dies and restarts cannot use the wildcard to unsubscribe to any subscriptions made by the original server).
Following is a list of valid settings in TPEVTDEF-REC.
TPNOBLOCK
TP-STATUS to [TPEBLOCK]. Either TPNOBLOCK or TPBLOCK must be set.
TPBLOCK
TPBLOCK is specified and a blocking condition exists, the caller blocks until the condition subsides or a timeout occurs (either transaction or blocking timeout). Either \%TPNOBLOCK or TPBLOCK must be set.
TPNOTIME
TPNOTIME or TPTIME must be set.
TPTIME
TPNOTIME or TPTIME must be set.
TPSIGRSTRT
TPNOSIGRSTRT or TPSIGRSTRT must be set.
TPNOSIGRSTRT
TP-STATUS to [TPGOTSIG]. Either TPNOSIGRSTRT or TPSIGRSTRT must be set.
Upon successful completion, TPUNSUBSCRIBE sets TP-STATUS to [TPOK]. In addition, TPUNSUBSCRIBE sets EVENT-COUNT in TPEVTDEF-REC to the number of subscriptions deleted (zero or greater) from the event broker's list of active subscriptions. EVENT-COUNT may contain a number greater than 1 only when the wildcard handle, -1, is used. Also, EVENT-COUNT may contain a number greater than 0 even when TPUNSUBSCRIBE completes unsuccessfully (that is, when the wildcard handle is used, the event broker may have successfully removed some subscriptions before it encountered an error deleting others).
Under the following conditions, TPUNSUBSCRIBE fails and sets TP-STATUS to one of the following values. (Unless otherwise noted, failure does not affect the caller's transaction, if one exists.)
TPEINVAL]
SUBSCRIPTION-HANDLE is an invalid subscription handle).
TPENOENT]
TPETIME]
TPBLOCK and TPTIME were specified. If a transaction timeout occurred, any attempts to do new work will fail with [TPETIME] until the transaction has been aborted.
TPEBLOCK]
TPNOBLOCK was specified.
TPGOTSIG]
TPNOSIGRSTRT was specified.
TPEPROTO]
TPUNSUBSCRIBE was called in an improper context.
TPESYSTEM]
TPEOS]
EVENTS(5), EVENT_MIB(5), TMSYSEVT(5), TMUSREVT(5), TPPOST(), TPSUBSCRIBE()