<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<erlref>
  <header>
    <copyright>
      <year>2000</year><year>2013</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      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.
    
    </legalnotice>

    <title>CosNotifyFilter_Filter</title>
    <prepared></prepared>
    <docno></docno>
    <checked></checked>
    <date>2000-02-01</date>
    <rev>1.0</rev>
  </header>
  <module>CosNotifyFilter_Filter</module>
  <modulesummary>This module implements the OMG CosNotifyFilter::Filter interface.</modulesummary>
  <description>
    <p>To get access to the record definitions for the structures use:      <br></br>
<c>-include_lib("cosNotification/include/*.hrl").</c></p>
  </description>
  <funcs>
    <func>
      <name>_get_constraint_grammar(Filter) -> Grammar</name>
      <fsummary>Return which type of Grammar the Filter uses</fsummary>
      <type>
        <v>Filter = #objref</v>
        <v>Grammar = string()</v>
      </type>
      <desc>
        <p>This operation returns which type of Grammar the Filter uses. Currently, only <c>"EXTENDED_TCL"</c> is supported.</p>
      </desc>
    </func>
    <func>
      <name>add_constraints(Filter, ConstraintExpSeq) -> Reply</name>
      <fsummary>Add new constraints to the filter</fsummary>
      <type>
        <v>Filter = #objref</v>
        <v>ConstraintExpSeq = [Constraint]</v>
        <v>ConstraintExp = #'CosNotifyFilter_ConstraintExp'{event_types, constraint_expr}</v>
        <v>event_types = #'CosNotification_EventTypeSeq'{}</v>
        <v>constraint_expr = string()</v>
        <v>Reply = ConstraintInfoSeq | {'EXCEPTION', #'CosNotifyFilter_InvalidConstraint'{constr}}</v>
        <v>constr = ConstraintExp</v>
        <v>ConstraintInfoSeq = [ConstraintInfo]</v>
        <v>ConstraintInfo = #'CosNotifyFilter_ConstraintInfo'{constraint_expression, constraint_id}</v>
        <v>constraint_expression = ConstraintExp</v>
        <v>constraint_id = long()</v>
      </type>
      <desc>
        <p>Initially, Filters do not contain any constraints, hence, all events will be forwarded.
          The <c>add_constraints/2</c> operation allow us to add constraints to the target object.</p>
      </desc>
    </func>
    <func>
      <name>modify_constraints(Filter, ConstraintIDSeq, ConstraintInfoSeq) -> Reply</name>
      <fsummary>Modify existing constraints</fsummary>
      <type>
        <v>Filter = #objref</v>
        <v>ConstraintIDSeq = [ConstraintID]</v>
        <v>ConstraintID = long()</v>
        <v>ConstraintInfoSeq = [ConstraintInfo]</v>
        <v>ConstraintInfo = #'CosNotifyFilter_ConstraintInfo'{constraint_expression, constraint_id}</v>
        <v>constraint_expression = ConstraintExp</v>
        <v>constraint_id = long()</v>
        <v>Reply = ok | {'EXCEPTION', #'CosNotifyFilter_InvalidConstraint'{constr}} | {'EXCEPTION', #'CosNotifyFilter_ConstraintNotFound'{id}}</v>
        <v>constr = ConstraintExp</v>
        <v>id = long()</v>
        <v>ConstraintExp = #'CosNotifyFilter_ConstraintExp'{event_types, constraint_expr}</v>
        <v>event_types = #'CosNotification_EventTypeSeq'{}</v>
        <v>constraint_expr = string()</v>
      </type>
      <desc>
        <p>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
          <c>ConstraintIDSeq</c> will, if all values are valid, be deleted. The <c>ConstraintInfoSeq</c>
          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.</p>
      </desc>
    </func>
    <func>
      <name>get_constraints(Filter, ConstraintIDSeq) -> Reply</name>
      <fsummary>Return all constraints which match the supplied Ids</fsummary>
      <type>
        <v>Filter = #objref</v>
        <v>ConstraintIDSeq = [ConstraintID]</v>
        <v>ConstraintID = long()</v>
        <v>Reply = ConstraintInfoSeq | {'EXCEPTION', #'CosNotifyFilter_ConstraintNotFound'{id}}</v>
        <v>ConstraintInfoSeq = [ConstraintInfo]</v>
        <v>ConstraintInfo = #'CosNotifyFilter_ConstraintInfo'{constraint_expression, constraint_id}</v>
        <v>constraint_expression = ConstraintExp</v>
        <v>constraint_id = id = long()</v>
      </type>
      <desc>
        <p>This operation return a sequence of ConstraintInfo's, related to the given ConstraintID's,
          associated with the target object.</p>
      </desc>
    </func>
    <func>
      <name>get_all_constraints(Filter) -> ConstraintInfoSeq</name>
      <fsummary>Return all constraints associated with the target object</fsummary>
      <type>
        <v>Filter = #objref</v>
        <v>ConstraintInfoSeq = [ConstraintInfo]</v>
        <v>ConstraintInfo = #'CosNotifyFilter_ConstraintInfo'{constraint_expression, constraint_id}</v>
        <v>constraint_expression = ConstraintExp</v>
        <v>constraint_id = long()</v>
      </type>
      <desc>
        <p>All constraints, and their unique Id, associated with the target object will be returned by this operation.</p>
      </desc>
    </func>
    <func>
      <name>remove_all_constraints(Filter) -> ok</name>
      <fsummary>Remove all constraints associated with the target object</fsummary>
      <type>
        <v>Filter = #objref</v>
      </type>
      <desc>
        <p>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.</p>
      </desc>
    </func>
    <func>
      <name>destroy(Filter) -> ok</name>
      <fsummary>Terminate the target object</fsummary>
      <type>
        <v>Filter = #objref</v>
      </type>
      <desc>
        <p>This operation terminates the target object.</p>
      </desc>
    </func>
    <func>
      <name>match(Filter, Event) -> Reply</name>
      <fsummary>Match the Any event if it satisfies at least one constraint</fsummary>
      <type>
        <v>Filter = #objref</v>
        <v>Event = #any</v>
        <v>Reply = boolean() | {'EXCEPTION', #'CosNotifyFilter_UnsupportedFilterableData'{}}</v>
      </type>
      <desc>
        <p>This operation accepts an <c>#any{}</c> event and returns <c>true</c> 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.</p>
      </desc>
    </func>
    <func>
      <name>match_structured(Filter, Event) -> Reply</name>
      <fsummary>Match the structured event if it satisfies at least one constraint</fsummary>
      <type>
        <v>Filter = #objref</v>
        <v>Event = #'CosNotification_StructuredEvent'{}</v>
        <v>Reply = boolean() | {'EXCEPTION', #'CosNotifyFilter_UnsupportedFilterableData'{}}</v>
      </type>
      <desc>
        <p>This operation is similar to the <c>match</c> operation but accepts structured
          events instead.</p>
      </desc>
    </func>
    <func>
      <name>attach_callback(Filter, NotifySubscribe) -> CallbackID</name>
      <fsummary>Connect NotifySubscribe object, which should be informed when the target object's constraints are updated</fsummary>
      <type>
        <v>Filter = #objref</v>
        <v>NotifySubscribe = #objref</v>
        <v>CallbackID = long()</v>
      </type>
      <desc>
        <p>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.</p>
      </desc>
    </func>
    <func>
      <name>detach_callback(Filter, CallbackID) -> Reply</name>
      <fsummary>Disconnect the NotifySubscribe object with the given Id</fsummary>
      <type>
        <v>Filter = #objref</v>
        <v>CallbackID = long()</v>
        <v>Reply = ok | {'EXCEPTION', #'CosNotifyFilter_CallbackNotFound'{}}</v>
      </type>
      <desc>
        <p>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.</p>
      </desc>
    </func>
    <func>
      <name>get_callbacks(Filter) -> CallbackIDSeq</name>
      <fsummary>Return all NotifySubscribe Id's associated with the target object</fsummary>
      <type>
        <v>Filter = #objref</v>
        <v>CallbackIDSeq = [CallbackID]</v>
        <v>CallbackID = long()</v>
      </type>
      <desc>
        <p>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.</p>
      </desc>
    </func>
  </funcs>
  
</erlref>

