Copyright © 2009 Francseco Cesarini and Simon Thompson
Authors: Francseco Cesarini (support@erlang-consulting.com), Simon Thompson (s.j.thompson@kent.ac.uk).
References
start/0
,
start/1
,
stop/0
add_usr/3
,
delete_usr/1
,
set_service/3
,
set_status/2
,
delete_disabled/0
,
lookup_id/1
lookup_msisdn/1
,
service_flag/2
instTime() = instance | timeout
Two different errors.
plan() = prepay | postpay
The two payment types for mobile subscribers.
service() = atom()
Services are specified by atoms, including
(but not limited to) data
, lbs
and sms
. Data
confirms the user
has subscribed to a data plan, sms
allows the user to send and receive
premium rated smses, while lbs
would allow third parties to execute
location lookups on this particular user.
status() = enabled | disabled
The status of a customer can be enabled or disabled.
usr() = #usr{msisdn = integer(), id = integer(), status = status(), plan = plan(), services = [service()]}
Record for users. The default value of status
is enabled
and of services
is []
.
add_usr/3 | Add a user with specified phone number, customer id and plan type. |
delete_disabled/0 | Traverses the table and deletes all users whose status is set to disabled . |
delete_usr/1 | Delete a user and all their associated entries. |
lookup_id/1 | Lookup a user based on their CustId and return a record of type usr . |
lookup_msisdn/1 | Lookup the usr record for a customer, specified by a PhoneNo . |
service_flag/2 | This function will check if a user exists and has an enabled status. |
set_service/3 | Set or unset a particular service for a particular customer. |
set_status/2 | Set the status of a customer to be enabled or disabled. |
start/0 | Start the system with the default filename. |
start/1 | Start the system with the given Filename . |
stop/0 | Stop the system. |
add_usr(PhoneNum::integer(), CustId::integer(), Plan::plan()) -> ok | {error, instTime()}
Add a user with specified phone number, customer id and plan type.
Returns ok
or an error
tuple.
delete_disabled() -> ok | {error, timeout}
Traverses the table and deletes all users whose status is set to disabled
.
delete_usr(CustId) -> any()
Delete a user and all their associated entries.
lookup_id(CustId::integer()) -> {ok, #usr{}} | {error, instance}
Lookup a user based on their CustId and return a record of type usr
. If the
customer does not exist, an error
tuple is returned.
lookup_msisdn(PhoneNo::integer()) -> {ok, #usr{}} | {error, instance}
Lookup the usr
record for a customer, specified by a PhoneNo
.
If successful return an ok
tuple with the record; otherwise
return an error
tuple.
service_flag(PhoneNo::integer(), Service::service()) -> bool() | {error, instance | disabled}
This function will check if a user exists and has an enabled status. If so, it will traverse the list of services to determine if the subscriber is allowed to use this Service in a particular request. This is a variant of the lookup_msisdn/1 function, where logical checks are done in this module.
set_service(CustId::integer(), Service::service(), Flag::bool()) -> ok | {error, instTime()}
Set or unset a particular service for a particular customer. A true
Flag
sets the service and false
unsets it.
set_status(CustId::integer(), Status::status()) -> ok | {error, instTime()}
Set the status of a customer to be enabled or disabled.
start() -> ok | {error, starting}
Start the system with the default filename.
Returns ok
or an error
tuple.
start(FileName::string()) -> ok | {error, starting}
Start the system with the given Filename
.
Returns ok
or an error
tuple.
stop() -> ok | {error, string()}
Stop the system.
Returns ok
or an error
tuple, containing the reason for failure.
Generated by EDoc, Feb 28 2009, 12:50:24.