org.omg.CosNotifyFilter
Class _FilterStub

java.lang.Object
  extended by org.omg.CORBA.portable.ObjectImpl
      extended by org.omg.CosNotifyFilter._FilterStub
All Implemented Interfaces:
java.io.Serializable, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity, Filter, FilterOperations

public class _FilterStub
extends org.omg.CORBA.portable.ObjectImpl
implements Filter

The Filter interface defines the behaviors supported by objects which encapsulate constraints used by the proxy objects associated with an event channel in order to determine which events they receive will be forwarded, and which will be discarded. Each object supporting the Filter interface can encapsulate a sequence of any number of constraints. Each event received by a proxy object which has one or more objects supporting the Filter interface associated with it must satisfy at least one of the constraints associated with one of its associated Filter objects in order to be forwarded (either to another proxy object or to the consumer, depending on the type of proxy the filter is associated with), otherwise it will be discarded. Each constraint encapsulated by a filter object is a structure comprised of two main components. The first component is a sequence of data structures, each of which indicates an event type comprised of a domain and a type name. The second component is a boolean expression over the properties of an event, expressed in some constraint grammar (more on this below). For a given constraint, the sequence of event type structures in the first component nominates a set of event types to which the constraint expression in the second component applies. Each element of the sequence can contain strings which will be matched for equality against the domain_name and type_name fields of each event being evaluated by the filter object, or it could contain strings with wildcard symbols (), indicating a pattern match should be performed against the type contained in each event, rather than a comparison for equality when determining if the boolean expression should be applied to the event, or the event should simply be discarded without even attempting to apply the boolean expression. Note that an empty sequence included as the first component of a constraint implies that the associated expression applies to all types of events, as does a sequence comprised of a single element whose domain and type name are both set to either the empty string or else the wildcard symbol alone contained in quotes. The constraint expressions associated with a particular object supporting the Filter interface are expressed as strings which obey the syntax of a particular constraint grammar. As long as such user-defined filter objects support the Filter interface, they can be attached to Proxy or Admin objects in the same fashion as the default Filter objects supported by the implementation of the service are, and the channel should be able to use them to filter events in the same fashion. The Filter interface supports the operations required to manage the constraints associated with an object instance which supports the interface, along with a readonly attribute which identifies the particular constraint grammar in which the constraints encapsulated by this object have meaning. In addition, the Filter interface supports three variants of the match operation which can be invoked by an associated proxy object upon receipt of an event (the specific variant selected depends upon whether the event is received in the form of an Any, a Structured Event, or a Typed Event), to determine if the event should be forwarded or discarded, based on whether or not the event satisfies at least one criteria encapsulated by the filter object. The Filter interface also supports operations which enable a client to associate with the target filter object any number of ?callbacks? which are notified each time there is a change to the list of event types which the constraints encapsulated by the filter object could potentially cause proxies to which the filter is attached to receive. Operations are also defined to support administration of this callback list by unique identifier.

See Also:
Serialized Form

Constructor Summary
_FilterStub()
           
 
Method Summary
 java.lang.String[] _ids()
           
 ConstraintInfo[] add_constraints(ConstraintExp[] constraint_list)
          Operation add_constraints
 int attach_callback(NotifySubscribe callback)
          Operation attach_callback
 java.lang.String constraint_grammar()
          Read accessor for constraint_grammar attribute
 void destroy()
          Operation destroy
 void detach_callback(int callback)
          Operation detach_callback
 ConstraintInfo[] get_all_constraints()
          Operation get_all_constraints
 int[] get_callbacks()
          Operation get_callbacks
 ConstraintInfo[] get_constraints(int[] id_list)
          Operation get_constraints
 boolean match_structured(StructuredEvent filterable_data)
          Operation match_structured
 boolean match_typed(Property[] filterable_data)
          Operation match_typed
 boolean match(org.omg.CORBA.Any filterable_data)
          Operation match
 void modify_constraints(int[] del_list, ConstraintInfo[] modify_list)
          Operation modify_constraints
 void remove_all_constraints()
          Operation remove_all_constraints
 
Methods inherited from class org.omg.CORBA.portable.ObjectImpl
_create_request, _create_request, _duplicate, _get_delegate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_delegate, _set_policy_override, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.omg.CORBA.Object
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
 

Constructor Detail

_FilterStub

public _FilterStub()
Method Detail

_ids

public java.lang.String[] _ids()
Specified by:
_ids in class org.omg.CORBA.portable.ObjectImpl

constraint_grammar

public java.lang.String constraint_grammar()
Read accessor for constraint_grammar attribute

Specified by:
constraint_grammar in interface FilterOperations
Returns:
the attribute value

add_constraints

public ConstraintInfo[] add_constraints(ConstraintExp[] constraint_list)
                                 throws InvalidConstraint
Operation add_constraints

Specified by:
add_constraints in interface FilterOperations
Parameters:
constraint_list - Constraint Expressions
Returns:
ConstraintInfo array. Each element contain constraint exp and ID associated
Throws:
InvalidConstraint - If an Constraint doesn't respect grammar

modify_constraints

public void modify_constraints(int[] del_list,
                               ConstraintInfo[] modify_list)
                        throws InvalidConstraint,
                               ConstraintNotFound
Operation modify_constraints

Specified by:
modify_constraints in interface FilterOperations
Parameters:
del_list - ID's of constraint exp to be delete
modify_list - ConstraintInfo containing all constraint to be modified
Throws:
InvalidConstraint - If a constraint doesn't respect grammar
ConstraintNotFound - Invalid ID's

get_constraints

public ConstraintInfo[] get_constraints(int[] id_list)
                                 throws ConstraintNotFound
Operation get_constraints

Specified by:
get_constraints in interface FilterOperations
Parameters:
id_list - Id of all constraints to get
Returns:
ConstraintInfo array
Throws:
ConstraintNotFound - If an ID is invalid. Exception contains this ID

get_all_constraints

public ConstraintInfo[] get_all_constraints()
Operation get_all_constraints

Specified by:
get_all_constraints in interface FilterOperations
Returns:
ConstraintInfo array

remove_all_constraints

public void remove_all_constraints()
Operation remove_all_constraints

Specified by:
remove_all_constraints in interface FilterOperations

destroy

public void destroy()
Operation destroy

Specified by:
destroy in interface FilterOperations

match

public boolean match(org.omg.CORBA.Any filterable_data)
              throws UnsupportedFilterableData
Operation match

Specified by:
match in interface FilterOperations
Parameters:
filterable_data - Event
Returns:
True if event must be throw, false otherwise
Throws:
UnsupportedFilterableData - Event can't be evaluate

match_structured

public boolean match_structured(StructuredEvent filterable_data)
                         throws UnsupportedFilterableData
Operation match_structured

Specified by:
match_structured in interface FilterOperations
Parameters:
filterable_data - Event
Returns:
True if event must be throw, false otherwise
Throws:
UnsupportedFilterableData - Event can't be evaluate

match_typed

public boolean match_typed(Property[] filterable_data)
                    throws UnsupportedFilterableData
Operation match_typed

Specified by:
match_typed in interface FilterOperations
Parameters:
filterable_data - Event
Returns:
True if event must be throw, false otherwise
Throws:
UnsupportedFilterableData - Event can't be evaluate

attach_callback

public int attach_callback(NotifySubscribe callback)
Operation attach_callback

Specified by:
attach_callback in interface FilterOperations
Returns:
CallBacK ID

detach_callback

public void detach_callback(int callback)
                     throws CallbackNotFound
Operation detach_callback

Specified by:
detach_callback in interface FilterOperations
Parameters:
callback - Callback ID
Throws:
CallbackNotFound - ID not exist

get_callbacks

public int[] get_callbacks()
Operation get_callbacks

Specified by:
get_callbacks in interface FilterOperations