20002016 Ericsson AB. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. CosNotifyFilter_Filter 2000-02-01 1.0
CosNotifyFilter_Filter This module implements the OMG CosNotifyFilter::Filter interface.

To get access to the record definitions for the structures use:

-include_lib("cosNotification/include/*.hrl").

_get_constraint_grammar(Filter) -> Grammar Return which type of Grammar the Filter uses Filter = #objref Grammar = string()

This operation returns which type of Grammar the Filter uses. Currently, only "EXTENDED_TCL" is supported.

add_constraints(Filter, ConstraintExpSeq) -> Reply Add new constraints to the filter Filter = #objref ConstraintExpSeq = [Constraint] ConstraintExp = #'CosNotifyFilter_ConstraintExp'{event_types, constraint_expr} event_types = #'CosNotification_EventTypeSeq'{} constraint_expr = string() Reply = ConstraintInfoSeq | {'EXCEPTION', #'CosNotifyFilter_InvalidConstraint'{constr}} constr = ConstraintExp ConstraintInfoSeq = [ConstraintInfo] ConstraintInfo = #'CosNotifyFilter_ConstraintInfo'{constraint_expression, constraint_id} constraint_expression = ConstraintExp constraint_id = long()

Initially, Filters do not contain any constraints, hence, all events will be forwarded. The add_constraints/2 operation allow us to add constraints to the target object.

modify_constraints(Filter, ConstraintIDSeq, ConstraintInfoSeq) -> Reply Modify existing constraints Filter = #objref ConstraintIDSeq = [ConstraintID] ConstraintID = long() ConstraintInfoSeq = [ConstraintInfo] ConstraintInfo = #'CosNotifyFilter_ConstraintInfo'{constraint_expression, constraint_id} constraint_expression = ConstraintExp constraint_id = long() Reply = ok | {'EXCEPTION', #'CosNotifyFilter_InvalidConstraint'{constr}} | {'EXCEPTION', #'CosNotifyFilter_ConstraintNotFound'{id}} constr = ConstraintExp id = long() ConstraintExp = #'CosNotifyFilter_ConstraintExp'{event_types, constraint_expr} event_types = #'CosNotification_EventTypeSeq'{} constraint_expr = string()

This operation is invoked by a client in order to modify the constraints associated with the target object. The constraints related to the Id's in the parameter sequence ConstraintIDSeq will, if all values are valid, be deleted. The ConstraintInfoSeq parameter contains of Id-Expression pairs and a constraint matching one of the unique Id's will, if all input values are correct, be updated. If the parameters contain incorrect data en exception will be raised.

get_constraints(Filter, ConstraintIDSeq) -> Reply Return all constraints which match the supplied Ids Filter = #objref ConstraintIDSeq = [ConstraintID] ConstraintID = long() Reply = ConstraintInfoSeq | {'EXCEPTION', #'CosNotifyFilter_ConstraintNotFound'{id}} ConstraintInfoSeq = [ConstraintInfo] ConstraintInfo = #'CosNotifyFilter_ConstraintInfo'{constraint_expression, constraint_id} constraint_expression = ConstraintExp constraint_id = id = long()

This operation return a sequence of ConstraintInfo's, related to the given ConstraintID's, associated with the target object.

get_all_constraints(Filter) -> ConstraintInfoSeq Return all constraints associated with the target object Filter = #objref ConstraintInfoSeq = [ConstraintInfo] ConstraintInfo = #'CosNotifyFilter_ConstraintInfo'{constraint_expression, constraint_id} constraint_expression = ConstraintExp constraint_id = long()

All constraints, and their unique Id, associated with the target object will be returned by this operation.

remove_all_constraints(Filter) -> ok Remove all constraints associated with the target object Filter = #objref

All constraints associated with the target object are removed by this operation and, since the the target object no longer contain any constraints, true will always be the result of any match operation.

destroy(Filter) -> ok Terminate the target object Filter = #objref

This operation terminates the target object.

match(Filter, Event) -> Reply Match the Any event if it satisfies at least one constraint Filter = #objref Event = #any Reply = boolean() | {'EXCEPTION', #'CosNotifyFilter_UnsupportedFilterableData'{}}

This operation accepts an #any{} event and returns true if it satisfies at least one constraint. If the event contains data of the wrong type, e.g., should be a string() but in fact i a short(), an exception is raised.

match_structured(Filter, Event) -> Reply Match the structured event if it satisfies at least one constraint Filter = #objref Event = #'CosNotification_StructuredEvent'{} Reply = boolean() | {'EXCEPTION', #'CosNotifyFilter_UnsupportedFilterableData'{}}

This operation is similar to the match operation but accepts structured events instead.

attach_callback(Filter, NotifySubscribe) -> CallbackID Connect NotifySubscribe object, which should be informed when the target object's constraints are updated Filter = #objref NotifySubscribe = #objref CallbackID = long()

This operation connects a NotifySubscribe object, which should be informed when the target object's constraints are updated. A unique Id is returned which must be stored if we ever want to detach the callback object in the future.

detach_callback(Filter, CallbackID) -> Reply Disconnect the NotifySubscribe object with the given Id Filter = #objref CallbackID = long() Reply = ok | {'EXCEPTION', #'CosNotifyFilter_CallbackNotFound'{}}

If the target object has an associated callback that matches the supplied Id it will be removed and longer informed of any updates. If no object with a matching Id is found an exception is raised.

get_callbacks(Filter) -> CallbackIDSeq Return all NotifySubscribe Id's associated with the target object Filter = #objref CallbackIDSeq = [CallbackID] CallbackID = long()

This operation returns a sequence of all connected NotifySubscribe object Id's. If no callbacks are associated with the target object the list will be empty.