Skip navigation.

Using the CORBA Notification Service

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents Index View as PDF   Get Adobe Reader

 


CosNotifyFilter::Filter::add_constraints

Synopsis

Sets the domain, type, and data filter parameters on the filter object.

OMG IDL

ConstraintInfoSeq add_constraints (
in ConstraintExpSeq constraint)
raises (InvalidConstraint);

Exceptions

CosNotifyFilter::InvalidConstraint

Never raised.

CORBA::BAD_PARAM

Indicates the following problem: Tobj_Events::SUB_INVALID_FILTER_EXPRESSION.

CORBA_IMP_LIMIT

Indicates one of the following problems:

Tobj_Notification::SUB_ADD_CONS_ON_TIMED_OUT_FILTER

Tobj_Notification::SUB_MULTIPLE_CALLS_TO_ADD_CONS

Tobj_Notification::SUB_MULTIPLE_CONSTRAINTS_IN_LIST

Tobj_Notification::SUB_MULTIPLE_TYPES_IN_CONSTRAINT

Tobj_Notification::SUB_SYSTEM_EVENTS_UNSUPPORTED

Tobj_Events::SUB_DOMAIN_BEGINS_WITH_SYSEV

Tobj_Events::SUB_EMPTY_DOMAIN

Tobj_Events::SUB_EMPTY_TYPE

Tobj_Events::SUB_FILTER_TOO_LONG

Note: For more information on exceptions and corresponding minor codes, see "Exception Minor Codes" on page -59.

Description

Used when subscribing. This operation is used in subscriber applications to define the kind of event to which you want to subscribe. You set the domain, type, and data filter parameters on the filter object. For a description of these parameters, see "Parameters Used When Creating Subscriptions" on page -11.

Note: The BEA Tuxedo implementation of the add_constraints operation (1) can only be called once, (2) must be called before the filter is added to the proxy object, and (3) must consist of only a single constraint that has a single event type.

Return Value

Returns an empty list, which we recommend that the caller ignores.

Examples

Note: Code examples shown here are abbreviated. For complete code examples, see "Creating a Subscription" on page -11.

C++ code example:

// set the filtering parameters
// (domain = "News", type, and no data filter)
CosNotifyFilter::ConstraintExpSeq constraints;
constraints.length(1);
constraints[0].event_types.length(1);
constraints[0].event_types[0].domain_name =
CORBA::string_dup("News");
constraints[0].event_types[0].type_name =
CORBA::string_dup ("Sports");
// no data filter
constraints[0].constraint_expr = CORBA::string_dup(""); CosNotifyFilter::ConstraintInfoSeq_var
add_constraints_results = // ignore this returned value
filter->add_constraints(constraints);

 

Skip navigation bar  Back to Top Previous Next