CosNotifyFilter_Filter(3)

πŸ“¦
version 5.2.2 Β· 2 versions
, in fedora 43, fedora 44

πŸŽ€ CosNotifyFilter_Filter β€” the manual page, but make it cute πŸŽ€

okay bestie, we're in CosNotifyFilter_Filter(3) territory, from the Erlang Module Definition family, and it's giving interface energy. Sit down, grab a boba, we're doing this together. πŸ’–


✨ NAME ✨

CosNotifyFilter_Filter β€” this module implements the OMG CosNotifyFilter::Filter interface. that's it, that's the whole vibe check. πŸ‘‘


🌸 DESCRIPTION 🌸

so like, if you wanna get access to the record definitions for the structures, you do this:

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

that's the doorway, bestie. walk through it. πŸšͺ✨


πŸ’… EXPORTS πŸ’…

πŸ¦‹ _get_constraint_grammar(Filter) -> Grammar

Types:

Filter = #objref
Grammar = string()

this operation tells you which type of Grammar the Filter is using. and rn, currently, only "EXTENDED_TCL" is supported. so yeah, that's the one. no cap. πŸ’β€β™€οΈ


πŸ“ add_constraints(Filter, ConstraintExpSeq) -> Reply

Types:

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()

okay so listen β€” initially, Filters do not contain any constraints, which means literally all events get forwarded. everything. the whole party. πŸŽ‰ and the add_constraints/2 operation is what lets us add constraints to the target object. so now you're the one deciding who gets in. main character energy fr. 🫢


πŸ’œ modify_constraints(Filter, ConstraintIDSeq, ConstraintInfoSeq) -> Reply

Types:

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()

a client invokes this operation to modify the constraints hanging out with the target object. here's the tea β˜•: the constraints related to the Id's in the parameter sequence ConstraintIDSeq will β€” if all values are valid β€” be deleted. the ConstraintInfoSeq parameter contains Id-Expression pairs, and a constraint matching one of the unique Id's will β€” if all input values are correct β€” be updated. and if the parameters contain incorrect data? an exception gets raised. no vibes. only consequences. 😭


🧚 get_constraints(Filter, ConstraintIDSeq) -> Reply

Types:

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 one returns a sequence of ConstraintInfo's β€” the ones related to the given ConstraintID's β€” associated with the target object. it's like asking "hey, show me what you've got" and it actually shows you. obsessed. πŸ’–


🌈 get_all_constraints(Filter) -> ConstraintInfoSeq

Types:

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? returned by this operation. every single one. the whole roster. πŸ“‹βœ¨


πŸ”₯ remove_all_constraints(Filter) -> ok

Types:

Filter = #objref

all constraints associated with the target object get removed by this operation. and since the target object no longer contains any constraints, true will always be the result of any match operation. it's a fresh start, a clean slate, a glow-up. πŸ’…


πŸ’€ destroy(Filter) -> ok

Types:

Filter = #objref

this operation terminates the target object. rip bozo. πŸͺ¦ not me being dramatic about it, it's literally what it says.


⭐ match(Filter, Event) -> Reply

Types:

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. but listen β€” if the event contains data of the wrong type, like, say it should be a string() but is actually a short(), then an exception is raised. wrong type, no entry, sorry babe. πŸ™ˆ


πŸŽ€ match_structured(Filter, Event) -> Reply

Types:

Filter = #objref
Event = #'CosNotification_StructuredEvent'{}
Reply = boolean() | {'EXCEPTION',
#'CosNotifyFilter_UnsupportedFilterableData'{}}

same energy as the match operation, but it accepts structured events instead. same rules, different outfit. πŸ‘‘


🌸 attach_callback(Filter, NotifySubscribe) -> CallbackID

Types:

Filter = #objref
NotifySubscribe = #objref
CallbackID = long()

this operation connects a NotifySubscribe object, which should be informed when the target object's constraints get updated. a unique Id is returned, and you must store it if you ever wanna detach the callback object later. save the Id, bestie. write it down. screenshot it. iykyk. πŸ“ΈπŸ’–


πŸ’œ detach_callback(Filter, CallbackID) -> Reply

Types:

Filter = #objref
CallbackID = long()
Reply = ok | {'EXCEPTION',
#'CosNotifyFilter_CallbackNotFound'{}}

if the target object has an associated callback that matches the supplied Id, it gets removed and it's no longer informed of any updates. byeee πŸ‘‹. but if no object with a matching Id is found, an exception is raised. no ghost callbacks allowed in this house. 🚫


πŸ¦‹ get_callbacks(Filter) -> CallbackIDSeq

Types:

Filter = #objref
CallbackIDSeq = [CallbackID]
CallbackID = long()

this operation returns a sequence of all the connected NotifySubscribe object Id's. and if no callbacks are associated with the target object? the list is just empty. no callbacks, no problem, no drama. ✨


πŸ’‘ friendly reminder: keep your Id's safe, keep your types correct, and never send a short() where a string() belongs. the Filter will notice. 😌

mwah πŸ’‹ that's the whole page, bestie β€” brought to you by the lovely people at Ericsson AB, from the cosNotification 5.2.2 era, and this little gem lives at CosNotifyFilter_Filter(3). go forth and filter responsibly. πŸ«ΆπŸŒˆπŸ’–

πŸ“¦ where this page comes from