Module ocs_event

This gen_event behaviour callback module implements an event handler of the ocs application.

Copyright © 2020 - 2026 SigScale Global Inc.

Behaviours: gen_event.

Description

This gen_event behaviour callback module implements an event handler of the ocs application.

Data Types

aka_cred()

aka_cred() = #aka_cred{k = binary(), opc = binary(), dif = integer()}

bucket_attributes()

bucket_attributes() = #{bucket_type := normal | session, from_bucket => [bucket_source()], reservations => reservations()}

bucket_source()

bucket_source() = #{id := string(), amount := pos_integer(), unit_size := pos_integer(), unit_price := pos_integer(), expire := pos_integer() | undefined}

bucket_status()

bucket_status() = active | expired | suspended

offer_status()

offer_status() = in_study | in_design | in_test | active | rejected | launched | retired | obsolete

pla_ref()

pla_ref() = #pla_ref{id = string() | undefined | '_', href = string() | undefined | '_', name = string() | undefined | '_', class_type = string() | undefined | '_', base_type = string() | undefined | '_', schema = string() | undefined | '_', ref_type = string() | undefined | '_'}

product_price_type()

product_price_type() = recurring | one_time | usage | tariff | pla_ref()

product_status()

product_status() = created | pending_active | aborted | cancelled | active | suspended | pending_terminate | terminated

quantity()

quantity() = #quantity{amount = integer(), units = atom() | string()}

range()

range() = #range{lower = quantity(), upper = quantity()}

rate()

rate() = #rate{numerator = quantity(), denominator = quantity()}

recur_period()

recur_period() = hourly | daily | weekly | monthly | yearly

reservation()

reservation() = #{ts := pos_integer(), debit := non_neg_integer(), reserve := non_neg_integer(), service_id => non_neg_integer(), charging_key => non_neg_integer()}

reservations()

reservations() = #{SesssionID::list() => reservation()}

resource_char()

resource_char() = #resource_char{name = string() | undefined | '_', class_type = string() | undefined | '_', schema = string() | undefined | '_', value = term() | undefined | '_'}

resource_rel()

resource_rel() = #resource_rel{id = string() | undefined | '_', href = string() | undefined | '_', name = string() | undefined | '$4' | '_', type = string() | undefined | '_', referred_type = string() | undefined | '_'}

service_status()

service_status() = feasibilityChecked | designed | reserved | active | inactive | terminated

specification_ref()

specification_ref() = #specification_ref{id = string() | undefined | '_' | '$3', href = string() | undefined | '_', name = string() | undefined | '_', version = string() | undefined | '_'}

state()

state() = #state{fsm = pid(), id = string(), category = atom()}

Function Index

notify/3Send a notification event.
init/1Initialize the ocs_event server.
handle_event/2Handle a request sent using gen_event:notify/2, gen_event:sync_notify/2.
handle_call/2Handle a request sent using gen_event:call/3,4.
handle_info/2Handle a received message.
terminate/2Cleanup and exit.
code_change/3Update internal state data during a release upgrade/downgrade.

Function Details

notify/3

notify(EventType, EventPayLoad, Category) -> ok

Send a notification event.

The EventPayload should contain the entire new resource (create), the updated attributes only (attributeValueChange) or only id and href (remove).

init/1

init(Args) -> Result

Initialize the ocs_event server.

See also: //stdlib/gen_event:init/1.

handle_event/2

handle_event(Event, State) -> Result

Handle a request sent using gen_event:notify/2, gen_event:sync_notify/2.

handle_call/2

handle_call(Request, Fsm) -> Result

Handle a request sent using gen_event:call/3,4.

See also: //stdlib/gen_event:handle_call/3.

handle_info/2

handle_info(Info, Fsm) -> Result

Handle a received message.

See also: //stdlib/gen_event:handle_info/2.

terminate/2

terminate(Arg, Fsm) -> term()

Cleanup and exit.

See also: //stdlib/gen_event:terminate/3.

code_change/3

code_change(OldVsn, State, Extra) -> Result

Update internal state data during a release upgrade/downgrade.

See also: //stdlib/gen_event:code_change/3.


Generated by EDoc