<?xml version="1.0" encoding="latin1" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<erlref>
  <header>
    <copyright>
      <year>2000</year><year>2009</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      The contents of this file are subject to the Erlang Public License,
      Version 1.1, (the "License"); you may not use this file except in
      compliance with the License. You should have received a copy of the
      Erlang Public License along with this software. If not, it can be
      retrieved online at http://www.erlang.org/.
    
      Software distributed under the License is distributed on an "AS IS"
      basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
      the License for the specific language governing rights and limitations
      under the License.
    
    </legalnotice>

    <title>CosNotifyFilter_MappingFilter</title>
    <prepared></prepared>
    <docno></docno>
    <checked></checked>
    <date>2000-02-01</date>
    <rev>1.0</rev>
  </header>
  <module>CosNotifyFilter_MappingFilter</module>
  <modulesummary>This module implements the OMG CosNotifyFilter::MappingFilter interface.</modulesummary>
  <description>
    <p>The main purpose of this module is to match events against associated
      constraints and return the value for the first constraint that returns
      true for the given event. If all constraints return false the default value
      will be returned.</p>
    <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(MappingFilter) -> Grammar</name>
      <fsummary>Return which type of Grammar the MappingFilter uses</fsummary>
      <type>
        <v>MappingFilter = #objref</v>
        <v>Grammar = string()</v>
      </type>
      <desc>
        <p>This operation returns which type of Grammar the MappingFilter uses. 
          Currently, only <c>"EXTENDED_TCL"</c> is supported.</p>
      </desc>
    </func>
    <func>
      <name>_get_value_type(MappingFilter) -> CORBA::TypeCode</name>
      <fsummary>Return the <c>CORBA::TypeCode</c>of the default value associated  with the target object</fsummary>
      <type>
        <v>MappingFilter = #objref</v>
      </type>
      <desc>
        <p>This readonly attribute maintains the <c>CORBA::TypeCode</c> of the default value
          associated with the target object.</p>
      </desc>
    </func>
    <func>
      <name>_get_default_value(MappingFilter) -> #any</name>
      <fsummary>Return the <c>#any{}</c> default value associated with  the target object</fsummary>
      <type>
        <v>MappingFilter = #objref</v>
      </type>
      <desc>
        <p>This readonly attribute maintains the <c>#any{}</c> default value associated with 
          the target object.</p>
      </desc>
    </func>
    <func>
      <name>add_mapping_constraints(MappingFilter, MappingConstraintPairSeq) -> Reply</name>
      <fsummary>Add new mapping constraints</fsummary>
      <type>
        <v>MappingFilter = #objref</v>
        <v>MappingConstraintPairSeq = [MappingConstraintPair]</v>
        <v>MappingConstraintPair = #'CosNotifyFilter_MappingConstraintPair'{constraint_expression, result_to_set}</v>
        <v>constraint_expression = #'CosNotifyFilter_ConstraintExp'{event_types, constraint_expr}</v>
        <v>event_types = #'CosNotification_EventTypeSeq'{}</v>
        <v>constraint_expr = string()</v>
        <v>result_to_set = #any</v>
        <v>Reply = MappingConstraintInfoSeq | {'EXCEPTION', #'CosNotifyFilter_InvalidConstraint'{constr}} | {'EXCEPTION', #'CosNotifyFilter_InvalidValue'{constr, value}}</v>
        <v>constr = ConstraintExp</v>
        <v>ConstraintExp = #'CosNotifyFilter_ConstraintExp'{event_types, constraint_expr}</v>
        <v>event_types = #'CosNotification_EventTypeSeq'{}</v>
        <v>constraint_expr = string()</v>
        <v>MappingConstraintInfoSeq = [MappingConstraintInfo]</v>
        <v>MappingConstraintInfo = #'CosNotifyFilter_MappingConstraintInfo'{constraint_expression, constraint_id, value}</v>
        <v>constraint_expression = ConstraintExp</v>
        <v>constraint_id = long()</v>
        <v>value = #any</v>
      </type>
      <desc>
        <p>This operation add new mapping constraints, which will be used when trying to override
          Quality of Service settings defined in the given event. If a constraint return true the
          associated value will be returned, otherwise the default value.</p>
      </desc>
    </func>
    <func>
      <name>modify_constraints(MappingFilter, ConstraintIDSeq, MappingConstraintInfoSeq) -> Reply</name>
      <fsummary>Modify the constraints associated with the target object</fsummary>
      <type>
        <v>MappingFilter = #objref</v>
        <v>ConstraintIDSeq = [ConstraintID]</v>
        <v>ConstraintID = long()</v>
        <v>MappingConstraintInfoSeq = [MappingConstraintInfo]</v>
        <v>MappingConstraintInfo = #'CosNotifyFilter_MappingConstraintInfo'{constraint_expression, constraint_id, value}</v>
        <v>constraint_expression = ConstraintExp</v>
        <v>constraint_id = long()</v>
        <v>value = #any</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}} | {'EXCEPTION', #'CosNotifyFilter_InvalidValue'{constr, value}}</v>
        <v>constr = ConstraintExp</v>
        <v>id = long()</v>
        <v>value = #any</v>
        <v>ConstraintExp = #'CosNotifyFilter_ConstraintExp'{event_types, constraint_expr}</v>
        <v>event_types = #'CosNotification_EventTypeSeq'{}</v>
        <v>constraint_expr = string()</v>
      </type>
      <desc>
        <p>The <c>ConstraintIDSeq</c> supplied should relate to constraints the caller wishes to
          remove. If any of the supplied Id's are not found an exception will be raised. This 
          operation also accepts a sequence of <c>MappingConstraintInfo</c> which will be added.
          If the target object cannot modify the constraints as requested an exception is raised
          describing which constraint, and why, could not be updated.</p>
      </desc>
    </func>
    <func>
      <name>get_mapping_constraints(MappingFilter, ConstraintIDSeq) -> Reply</name>
      <fsummary>Return the target object's associated constraints with given ID:s</fsummary>
      <type>
        <v>MappingFilter = #objref</v>
        <v>ConstraintIDSeq = [ConstraintID]</v>
        <v>ConstraintID = long()</v>
        <v>Reply = MappingConstraintInfoSeq | {'EXCEPTION', #'CosNotifyFilter_ConstraintNotFound'{id}}</v>
        <v>MappingConstraintInfoSeq = [MappingConstraintInfo]</v>
        <v>MappingConstraintInfo = #'CosNotifyFilter_MappingConstraintInfo'{constraint_expression, constraint_id, value}</v>
        <v>constraint_expression = ConstraintExp</v>
        <v>ConstraintExp = #'CosNotifyFilter_ConstraintExp'{event_types, constraint_expr}</v>
        <v>event_types = #'CosNotification_EventTypeSeq'{}</v>
        <v>constraint_expr = string()</v>
        <v>constraint_id = id = long()</v>
        <v>value = #any</v>
      </type>
      <desc>
        <p>When adding a new constraint a unique Id is returned, which is accepted as input for this
          operation. The associated constraint is returned, but if no such Id exists an exception is raised.          </p>
      </desc>
    </func>
    <func>
      <name>get_all_mapping_constraints(MappingFilter) -> MappingConstraintInfoSeq</name>
      <fsummary>Return the target object's all associated constraints</fsummary>
      <type>
        <v>MappingFilter = #objref</v>
        <v>MappingConstraintInfoSeq = [MappingConstraintInfo]</v>
        <v>MappingConstraintInfo = #'CosNotifyFilter_MappingConstraintInfo'{constraint_expression, constraint_id, value}</v>
        <v>constraint_expression = ConstraintExp</v>
        <v>ConstraintExp = #'CosNotifyFilter_ConstraintExp'{event_types, constraint_expr}</v>
        <v>event_types = #'CosNotification_EventTypeSeq'{}</v>
        <v>constraint_expr = string()</v>
        <v>constraint_id = long()</v>
        <v>value = #any</v>
      </type>
      <desc>
        <p>This operation returns a sequence of all unique Id's associated with the target object.
          If no constraint have been added the sequence will be empty.</p>
      </desc>
    </func>
    <func>
      <name>remove_all_mapping_constraints(MappingFilter) -> ok</name>
      <fsummary>Remove all constraints associated with the target object</fsummary>
      <type>
        <v>MappingFilter = #objref</v>
      </type>
      <desc>
        <p>This operation removes all constraints associated with the target object.</p>
      </desc>
    </func>
    <func>
      <name>destroy(MappingFilter) -> ok</name>
      <fsummary>Terminate the target object</fsummary>
      <type>
        <v>MappingFilter = #objref</v>
      </type>
      <desc>
        <p>This operation terminates the target object. Remember to remove
          this Filter from the objects it have been associated with.</p>
      </desc>
    </func>
    <func>
      <name>match(MappingFilter, Event) -> Reply</name>
      <fsummary>Evaluate the given Any event with the Filter's constraints</fsummary>
      <type>
        <v>MappingFilter = #objref</v>
        <v>Event = #any</v>
        <v>Reply = {boolean(), #any} | {'EXCEPTION', #'CosNotifyFilter_UnsupportedFilterableData'{}}</v>
      </type>
      <desc>
        <p>This operation evaluates <c>Any</c> events with the Filter's constraints, 
          and returns the value to use. The value is the default value if all constraints
          returns false and the value associated with the first constraint returning true.</p>
      </desc>
    </func>
    <func>
      <name>match_structured(MappingFilter, Event) -> Reply</name>
      <fsummary>Evaluate the given structured event with the Filter's constraints</fsummary>
      <type>
        <v>MappingFilter = #objref</v>
        <v>Event = #'CosNotification_StructuredEvent'{}</v>
        <v>Reply = {boolean(), #any} | {'EXCEPTION', #'CosNotifyFilter_UnsupportedFilterableData'{}}</v>
      </type>
      <desc>
        <p>Similar to <c>match/2</c> but accepts a structured event as input.</p>
      </desc>
    </func>
  </funcs>
  
</erlref>

