Using the CORBA Notification Service
Sets the domain, type, and data filter parameters on the filter object.
ConstraintInfoSeq
add_constraints
(
in ConstraintExpSeq constraint)
raises (InvalidConstraint);
Note: For more information on exceptions and corresponding minor codes, see "Exception Minor Codes" on page -59.
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.
Returns an empty list
, which we recommend that the caller ignores.
Note: Code examples shown here are abbreviated. For complete code examples, see "Creating a Subscription" on page -11.
// 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);