Subscription Class
The subscription class encapsulates the information and operations necessary for registering a subscriber for notification.
Table 13-47 Enumerated Values Used by Subscription Class
| Attribute | Options |
|---|---|
Presentation |
|
Protocol |
|
Namespace |
|
Table 13-48 Summary of Subscription Methods
| Method | Summary |
|---|---|
|
|
|
|
Retrieves the callback context. |
|
|
Retrieves the number of database servers in which the client is interested for the registration. |
|
|
Returns the names of all the database servers where the client registered an interest for notification. |
|
|
Returns the pointer to the registered callback function. |
|
|
Retrieves the payload that has been set on the |
|
|
Retrieves the name of the |
|
|
Retrieves the namespace of the |
|
|
Retrieves the name of the |
|
|
Retrieves the notification presentation mode. |
|
|
Retrieves the notification protocol. |
|
|
Determines if the |
|
|
Assignment operator for |
|
|
Registers a callback function for OCI protocol. |
|
|
Specifies the database server distinguished names from which the client receives notifications. |
|
|
Specifies the context passed to user callbacks |
|
|
Specifies the |
|
|
Specifies the name of the subscription. |
|
|
Specifies the namespace in which the subscription is used. |
|
|
Specifies the buffer content of the notification. |
|
|
Specifies the name of the recipient of the notification. |
|
|
Specifies the presentation mode in which the client receives notifications. |
|
|
Specifies the protocol in which the client receives notifications. |
|
|
Specifies the name of the subscription. |
|
|
Specifies the namespace where the subscription is used. |
|
|
Specifies the name of the recipient of the notification. |
- Subscription()
- getCallbackContext()
- getDatabaseServersCount()
- getDatabaseServerNames()
- getNotifyCallback()
- getPayload()
- getSubscriptionName()
- getSubscriptionNamespace()
- getRecipientName()
- getPresentation()
- getProtocol()
- isNull()
- operator=()
- setCallbackContext()
- setDatabaseServerNames()
- setNotifyCallback()
- setNull()
- setPayload()
- setPresentation()
- setProtocol()
- setSubscriptionName()
- setSubscriptionNamespace()
- setRecipientName()
Parent topic: OCCI Application Programming Interface
Subscription()
Subscription class constructor.
| Syntax | Description |
|---|---|
Subscription ( const Environment *env ); |
Creates a |
Subscription( const Subscription& sub); |
Copy constructor. |
Syntax
Subscription(const Subscription& sub);
| Parameter | Description |
|---|---|
env |
The |
sub |
The original |
Parent topic: Subscription Class
getCallbackContext()
Retrieves the callback context.
Syntax
void* getCallbackContext() const;
Parent topic: Subscription Class
getDatabaseServersCount()
Returns the number of database servers in which the client is interested for the registration.
Syntax
unsigned int getDatabaseServersCount() const;
Parent topic: Subscription Class
getDatabaseServerNames()
Returns the names of all the database servers where the client registered an interest for notification.
Syntax
vector<string> getDatabaseServerNames() const;
Parent topic: Subscription Class
getNotifyCallback()
Returns the pointer to the callback function registered for this Subscription.
Syntax
unsigned int (*getNotifyCallback() const)( Subscription& sub, NotifyResult *nr);
| Parameter | Description |
|---|---|
sub |
The |
nr |
The |
Parent topic: Subscription Class
getPayload()
Retrieves the payload that has been set on the Subscription object before posting.
Syntax
Bytes getCPayload() const;
Parent topic: Subscription Class
getSubscriptionName()
Retrieves the name of the subscription.
Syntax
string getSubscriptionName() const;
Parent topic: Subscription Class
getSubscriptionNamespace()
Retrieves the namespace of the subscription. The subscription name must be consistent with its namespace. Valid Namespace values are NS_AQ and NS_ANONYMOUS, as defined in Table 13-47.
Syntax
Namespace getSubscriptionNamespace() const;
Parent topic: Subscription Class
getRecipientName()
Retrieves the name of the recipient of the notification. Possible return values are E-mail address, the HTTP url and the PL/SQL procedure, depending on the protocol.
Syntax
string getRecipientName() const;
Parent topic: Subscription Class
getPresentation()
Retrieves the presentation mode in which the client receives notifications. Valid Presentation values are defined in Table 13-47.
Syntax
Presentation getPresentation() const;
Parent topic: Subscription Class
getProtocol()
Retrieves the protocol in which the client receives notifications. Valid Protocol values are defined in Table 13-47.
Syntax
Protocol getProtocol() const;
Parent topic: Subscription Class
isNull()
Returns TRUE if Subscription is NULL or FALSE otherwise.
Syntax
bool isNull() const;
Parent topic: Subscription Class
operator=()
Assignment operator for Subscription.
Syntax
void operator=( const Subscription& sub);
| Parameter | Description |
|---|---|
sub |
The original |
Parent topic: Subscription Class
setCallbackContext()
Registers a notification callback function when the protocol is PROTO_CBK, as defined in Table 13-47. Context registration is also included in this call.
Syntax
void setCallbackContext( void *ctx);
| Parameter | Description |
|---|---|
ctx |
The context set. |
Parent topic: Subscription Class
setDatabaseServerNames()
Specifies the list of database server distinguished names from which the client receives notifications.
Syntax
void setDatabaseServerNames( const vector<string>& dbsrv);
| Parameter | Description |
|---|---|
dbsrv |
The list of database distinguished names |
Parent topic: Subscription Class
setNotifyCallback()
Sets the context that the client wants to get passed to the user callback. If the protocol is set to PROTO_CBK or not specified, this attribute must be set before registering the subscription handle.
Syntax
void setNotifyCallback( unsigned int (*callback)( Subscription& sub, NotifyResult *nr));
| Parameter | Description |
|---|---|
callback |
The user callback function. |
sub |
The |
nr |
The |
Parent topic: Subscription Class
setNull()
Sets the Subscription object to NULL and frees the memory associated with the object.
Syntax
void setNull();
Parent topic: Subscription Class
setPayload()
Sets the buffer content that corresponds to the payload to be posted to the Subscription.
Syntax
void setPayload( const Bytes& payload);
| Parameter | Description |
|---|---|
payload |
Content of the notification. |
Parent topic: Subscription Class
setPresentation()
Sets the presentation mode in which the client receives notifications.
Syntax
void setPresentation( Presentation pres);
| Parameter | Description |
|---|---|
pres |
Presentation mode, as defined in Table 13-47. |
Parent topic: Subscription Class
setProtocol()
Sets the Protocol in which the client receives event notifications, as defined in Table 13-47.
Syntax
void setProtocol( Protocol prot);
| Parameter | Description |
|---|---|
prot |
Protocol mode |
Parent topic: Subscription Class
setSubscriptionName()
Sets the name of the subscription. All subscriptions are identified by a subscription name, which consists of a sequence of bytes of specified length.
If the namespace is NS_AQ, the subscription name is:
-
SCHEMA.QUEUEwhen registering on a single consumer queue -
SCHEMA.QUEUE:CONSUMER_NAMEwhen registering on a multiconsumer queue
Syntax
void setSubscriptionName( const string& name);
| Parameter | Description |
|---|---|
name |
Subscription name. |
Parent topic: Subscription Class
setSubscriptionNamespace()
Sets the namespace where the subscription is used. The subscription name must be consistent with its namespace. Default value is NS_AQ.
Syntax
void setSubscriptionNamespace( Namespace nameSpace);
| Parameter | Description |
|---|---|
nameSpace |
Namespace in which the subscription is used, as defined in Table 13-47. |
Parent topic: Subscription Class
setRecipientName()
Sets the name of the recipient of the notification.
Syntax
void setRecipientName( const string& name);
| Parameter | Description |
|---|---|
name |
Name of the notification recipient. |
Parent topic: Subscription Class