Skip Headers
Oracle® C++ Call Interface Programmer's Guide,
11g Release 2 (11.2)

Part Number E10764-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub
LNCPP21800

Subscription Class

The subscription class encapsulates the information and operations necessary for registering a subscriber for notification.

LNCPP21801Table 13-47 Enumerated Values Used by Subscription Class

Attribute Options
Presentation
  • PRES_DEFAULT indicates that the event notification should be in default format.

  • PRES_XML indicates that the event notification should be in XML format.

Protocol
  • PROTO_CBK indicates that the client receives notifications through the default system protocol.

  • PROTO_MAIL indicates that the client receives notifications through e-mail, like xyz@oracle.com. The database does not check if the e-mail is valid.

  • PROTO_SERVER indicates that the client receives notifications through an invoked PL/SQL procedure in the database, like schema.procedure. The subscriber must have the appropriate permissions on the procedure.

  • PROTO_HTTP indicates that the client receives notifications through an HTTP URL, like http://www.oracle.com:80. The database does not check if the URL is valid.

Namespace
  • NS_ANONYMOUS indicates that the registrations are made in an anonymous namespace.

  • NS_AQ indicates that the registrations are made in the Oracle Streams Advanced Queuing namespace.


LNCPP21802Table 13-48 Summary of Subscription Methods

Method Summary

Subscription()

Subscription class constructor.

getCallbackContext()

Retrieves the callback context.

getDatabaseServersCount()

Retrieves the number of database servers in which the client is interested for the registration.

getDatabaseServerNames()

Returns the names of all the database servers where the client registered an interest for notification.

getNotifyCallback()

Returns the pointer to the registered callback function.

getPayload()

Retrieves the payload that has been set on the Subscription object before posting.

getSubscriptionName()

Retrieves the name of the Subscription.

getSubscriptionNamespace()

Retrieves the namespace of the Subscription.

getRecipientName()

Retrieves the name of the Subscription recipient.

getPresentation()

Retrieves the notification presentation mode.

getProtocol()

Retrieves the notification protocol.

isNull()

Determines if the Subscription is NULL.

operator=()

Assignment operator for Subscription.

setCallbackContext()

Registers a callback function for OCI protocol.

setDatabaseServerNames()

Specifies the database server distinguished names from which the client receives notifications.

setNotifyCallback()

Specifies the context passed to user callbacks

setNull()

Specifies the Subscription object to NULL and frees the memory associated with the object.

setSubscriptionName()

Specifies the name of the subscription.

setSubscriptionNamespace()

Specifies the namespace in which the subscription is used.

setPayload()

Specifies the buffer content of the notification.

setRecipientName()

Specifies the name of the recipient of the notification.

setPresentation()

Specifies the presentation mode in which the client receives notifications.

setProtocol()

Specifies the protocol in which the client receives notifications.

setSubscriptionName()

Specifies the name of the subscription.

setSubscriptionNamespace()

Specifies the namespace where the subscription is used.

setRecipientName()

Specifies the name of the recipient of the notification.


LNCPP21803

Subscription()

Subscription class constructor.

Syntax Description
Subscription (
   const Environment *env );
Creates a Subscription within a specified Environment.
Subscription(
   const Subscription& sub);
Copy constructor.

LNCPP21804Syntax

Subscription(const Subscription& sub);
Parameter Description
env
The Environment.
sub
The original Subscription.

LNCPP21805

getCallbackContext()

Retrieves the callback context.

LNCPP21806Syntax

void* getCallbackContext() const;
LNCPP21807

getDatabaseServersCount()

Returns the number of database servers in which the client is interested for the registration.

LNCPP21808Syntax

unsigned int getDatabaseServersCount() const;
LNCPP21809

getDatabaseServerNames()

Returns the names of all the database servers where the client registered an interest for notification.

LNCPP21810Syntax

vector<string> getDatabaseServerNames() const;
LNCPP21811

getNotifyCallback()

Returns the pointer to the callback function registered for this Subscription.

LNCPP21812Syntax

unsigned int (*getNotifyCallback() const)(
   Subscription& sub,
   NotifyResult *nr);
Parameter Description
sub
The Subscription.
nr
The NotifyResult.

LNCPP21813

getPayload()

Retrieves the payload that has been set on the Subscription object before posting.

LNCPP21814Syntax

Bytes getCPayload() const;
LNCPP21815

getSubscriptionName()

Retrieves the name of the subscription.

LNCPP21816Syntax

string getSubscriptionName() const;
LNCPP21817

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.

LNCPP21818Syntax

Namespace getSubscriptionNamespace() const;
LNCPP21819

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.

LNCPP21820Syntax

string getRecipientName() const;
LNCPP21821

getPresentation()

Retrieves the presentation mode in which the client receives notifications. Valid Presentation values are defined in Table 13-47.

LNCPP21822Syntax

Presentation getPresentation() const;
LNCPP21823

getProtocol()

Retrieves the protocol in which the client receives notifications. Valid Protocol values are defined in Table 13-47.

LNCPP21824Syntax

Protocol getProtocol() const;
LNCPP21825

isNull()

Returns TRUE if Subscription is NULL or FALSE otherwise.

LNCPP21826Syntax

bool isNull() const;
LNCPP21827

operator=()

Assignment operator for Subscription.

LNCPP21828Syntax

void operator=(
   const Subscription& sub); 
Parameter Description
sub
The original Subscription.

LNCPP21829

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.

LNCPP21830Syntax

void setCallbackContext(
   void *ctx);
Parameter Description
ctx
The context set.

LNCPP21831

setDatabaseServerNames()

Specifies the list of database server distinguished names from which the client receives notifications.

LNCPP21832Syntax

void setDatabaseServerNames(
   const vector<string>& dbsrv);
Parameter Description
dbsrv
The list of database distinguished names

LNCPP21833

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.

LNCPP21834Syntax

void setNotifyCallback( 
   unsigned int (*callback)(
                    Subscription& sub,
                    NotifyResult *nr));
Parameter Description
callback
The user callback function.
sub
The Subscription object.
nr
The NotifyResult object.

LNCPP21835

setNull()

Sets the Subscription object to NULL and frees the memory associated with the object.

LNCPP21836Syntax

void setNull();
LNCPP21837

setPayload()

Sets the buffer content that corresponds to the payload to be posted to the Subscription.

LNCPP21838Syntax

void setPayload(
   const Bytes& payload);
Parameter Description
payload
Content of the notification.

LNCPP21839

setPresentation()

Sets the presentation mode in which the client receives notifications.

LNCPP21840Syntax

void setPresentation(
   Presentation pres);
Parameter Description
pres
Presentation mode, as defined in Table 13-47.

LNCPP21841

setProtocol()

Sets the Protocol in which the client receives event notifications, as defined in Table 13-47.

LNCPP21842Syntax

void setProtocol(
   Protocol prot);
Parameter Description
prot
Protocol mode

LNCPP21843

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:

LNCPP21844Syntax

void setSubscriptionName(
   const string& name);
Parameter Description
name
Subscription name.

LNCPP21845

setSubscriptionNamespace()

Sets the namespace where the subscription is used. The subscription name must be consistent with its namespace. Default value is NS_AQ.

LNCPP21846Syntax

void setSubscriptionNamespace(
   Namespace nameSpace);
Parameter Description
nameSpace
Namespace in which the subscription is used, as defined in Table 13-47.

LNCPP21847

setRecipientName()

Sets the name of the recipient of the notification.

LNCPP21848Syntax

void setRecipientName( 
   const string& name);
Parameter Description
name
Name of the notification recipient.

Reader Comment

   

Comments, corrections, and suggestions are forwarded to authors every week. By submitting, you confirm you agree to the terms and conditions. Use the OTN forums for product questions. For support or consulting, file a service request through My Oracle Support.

Hide Navigation

Quick Lookup

Database Library · Master Index · Master Glossary · Book List · Data Dictionary · SQL Keywords · Initialization Parameters · Advanced Search · Error Messages

Main Categories

This Page

This Document

New and changed documents:
RSS Feed HTML RSS Feed PDF