COSNOTIFYFILTER_MAPPINGFILTER(3erl)
β¨ CosNotifyFilter_MappingFilter β¨
okay bestie, so this is CosNotifyFilter_MappingFilter from the cosNotification manual (section 3erl), and it's literally the Erlang module that implements the OMG CosNotifyFilter::MappingFilter interface. yes we're doing CORBA today, get comfy π
π NAME π
CosNotifyFilter_MappingFilter β this module implements the OMG CosNotifyFilter::MappingFilter interface. no cap, that's the whole job description.
π¦ DESCRIPTION π¦
okay so the main character purpose of this module? it matches events against the constraints you've associated with it, and then it returns the value for the first constraint that returns true for the given event. if literally every constraint returns false, then the default value gets returned instead. periodt. π
and to get access to the record definitions for the structures, you do:
-include_lib("cosNotification/include/*.hrl").
iykyk πΈ
π EXPORTS π
π _get_constraint_grammar(MappingFilter) -> Grammar
Types:
MappingFilter = #objref
Grammar = string()
this operation returns which type of Grammar the MappingFilter uses. and currently? only "EXTENDED_TCL" is supported. that's the one, that's the vibe β¨
π _get_value_type(MappingFilter) -> CORBA::TypeCode
Types:
MappingFilter = #objref
this readonly attribute maintains the CORBA::TypeCode of the default value associated with the target object. read it and weep, but like, respectfully π«Ά
π _get_default_value(MappingFilter) -> #any
Types:
MappingFilter = #objref
this readonly attribute maintains the #any{} default value associated with the target object. it's giving "the fallback, but make it CORBA" π
π add_mapping_constraints(MappingFilter, MappingConstraintPairSeq) -> Reply
Types:
MappingFilter = #objref
MappingConstraintPairSeq = [MappingConstraintPair]
MappingConstraintPair = #'CosNotifyFilter_MappingConstraintPair'{constraint_expression, result_to_set}
constraint_expression = #'CosNotifyFilter_ConstraintExp'{event_types, constraint_expr}
event_types = #'CosNotification_EventTypeSeq'{}
constraint_expr = string()
result_to_set = #any
Reply = MappingConstraintInfoSeq | {'EXCEPTION', #'CosNotifyFilter_InvalidConstraint'{constr}} | {'EXCEPTION', #'CosNotifyFilter_InvalidValue'{constr, value}}
constr = ConstraintExp
ConstraintExp = #'CosNotifyFilter_ConstraintExp'{event_types, constraint_expr}
event_types = #'CosNotification_EventTypeSeq'{}
constraint_expr = string()
MappingConstraintInfoSeq = [MappingConstraintInfo]
MappingConstraintInfo = #'CosNotifyFilter_MappingConstraintInfo'{constraint_expression, constraint_id, value}
constraint_expression = ConstraintExp
constraint_id = long()
value = #any
this operation adds new mapping constraints, which will be used when trying to override Quality of Service settings defined in the given event. so if a constraint returns true, the associated value gets returned β otherwise you get the default value. simple as that π
π modify_constraints(MappingFilter, ConstraintIDSeq, MappingConstraintInfoSeq) -> Reply
Types:
MappingFilter = #objref
ConstraintIDSeq = [ConstraintID]
ConstraintID = long()
MappingConstraintInfoSeq = [MappingConstraintInfo]
MappingConstraintInfo = #'CosNotifyFilter_MappingConstraintInfo'{constraint_expression, constraint_id, value}
constraint_expression = ConstraintExp
constraint_id = long()
value = #any
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}} | {'EXCEPTION', #'CosNotifyFilter_InvalidValue'{constr, value}}
constr = ConstraintExp
id = long()
value = #any
ConstraintExp = #'CosNotifyFilter_ConstraintExp'{event_types, constraint_expr}
event_types = #'CosNotification_EventTypeSeq'{}
constraint_expr = string()
so the ConstraintIDSeq you supply should relate to the constraints the caller wants to remove. and if any of the supplied Id's aren't found? an exception gets raised. π this operation also accepts a sequence of MappingConstraintInfo which will be added. and if the target object can't modify the constraints as requested, an exception is raised describing which constraint β and why β could not be updated. receipts included π
π get_mapping_constraints(MappingFilter, ConstraintIDSeq) -> Reply
Types:
MappingFilter = #objref
ConstraintIDSeq = [ConstraintID]
ConstraintID = long()
Reply = MappingConstraintInfoSeq | {'EXCEPTION', #'CosNotifyFilter_ConstraintNotFound'{id}}
MappingConstraintInfoSeq = [MappingConstraintInfo]
MappingConstraintInfo = #'CosNotifyFilter_MappingConstraintInfo'{constraint_expression, constraint_id, value}
constraint_expression = ConstraintExp
ConstraintExp = #'CosNotifyFilter_ConstraintExp'{event_types, constraint_expr}
event_types = #'CosNotification_EventTypeSeq'{}
constraint_expr = string()
constraint_id = id = long()
value = #any
when you add a new constraint, a unique Id is returned, and that Id is accepted as input for this operation. the associated constraint gets returned β but if no such Id exists, an exception is raised. so keep track of your Ids bestie, they're your children now π
π get_all_mapping_constraints(MappingFilter) -> MappingConstraintInfoSeq
Types:
MappingFilter = #objref
MappingConstraintInfoSeq = [MappingConstraintInfo]
MappingConstraintInfo = #'CosNotifyFilter_MappingConstraintInfo'{constraint_expression, constraint_id, value}
constraint_expression = ConstraintExp
ConstraintExp = #'CosNotifyFilter_ConstraintExp'{event_types, constraint_expr}
event_types = #'CosNotification_EventTypeSeq'{}
constraint_expr = string()
constraint_id = long()
value = #any
this operation returns a sequence of all the unique Id's associated with the target object. and if no constraint has been added at all, the sequence will just be empty. empty. void. a little sad, honestly π
π remove_all_mapping_constraints(MappingFilter) -> ok
Types:
MappingFilter = #objref
this operation removes all constraints associated with the target object. all of them. gone. clean slate energy β¨
π destroy(MappingFilter) -> ok
Types:
MappingFilter = #objref
this operation terminates the target object. π and remember to remove this Filter from the objects it has been associated with β do not skip this step, it's important fr fr.
π match(MappingFilter, Event) -> Reply
Types:
MappingFilter = #objref
Event = #any
Reply = {boolean(), #any} | {'EXCEPTION', #'CosNotifyFilter_UnsupportedFilterableData'{}}
this operation evaluates Any events with the Filter's constraints, and returns the value to use. that value is the default value if all constraints return false, and the value associated with the first constraint returning true. first one wins, no negotiating π₯
π match_structured(MappingFilter, Event) -> Reply
Types:
MappingFilter = #objref
Event = #'CosNotification_StructuredEvent'{}
Reply = {boolean(), #any} | {'EXCEPTION', #'CosNotifyFilter_UnsupportedFilterableData'{}}
similar to match/2 but it accepts a structured event as input. same energy, fancier event π¦
and that's the whole page bestie, you ate it, you understood it, main character energy only π
Ericsson AB Β· cosNotification 5.2.2 Β· CosNotifyFilter_MappingFilter(3) β mwah, go forth and filter πππ«Ά
π¦ where this page comes from
- fedora 43: erlang-cosNotification 1:5.2.2-1.fc43 Β· Apache-2.0
- fedora 44: erlang-cosNotification 1:5.2.2-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms