Reference Source
public class | source

MessagesSvcProvider

Extends:

devapt-core-common/dist/js/services/service_provider~ServiceProvider → MessagesSvcProvider

Messages service provider class.

Example:

	API:
		this._msg_subscriptions = {
			sender name:{
				bus name:{
					channel name:{
						socket: server/browser socket,
						unsubscribe: function
					}
				}
			}
		}

Constructor Summary

Public Constructor
public

constructor(arg_provider_name: string, arg_service_instance: Service, arg_context: string): nothing

Create a messages gateway service provider.

Member Summary

Public Members
public

Class test flag.

Private Members
private

Messages subscriptions.

Method Summary

Public Methods
public abstract

Get provider operations names.

public

has_subscription(arg_sender: string, arg_bus: string, arg_channel: string): boolean

Test if a message subscription exists.

public

init_subscription(arg_sender: string, arg_bus: string, arg_channel: string, arg_socket: Socket): boolean

Test if a message subscription exists.

public

produce(arg_request: ServiceRequest): Promise

Produce service datas on request.

public

produce_send(arg_request: ServiceRequest): Promise

Produce service datas on send request.

public

produce_subscribe(arg_request: ServiceRequest): Promise

Produce service datas on subscribe request.

public

produce_unsubscribe(arg_request: ServiceRequest): Promise

Produce service datas on unsubscribe request.

Public Constructors

public constructor(arg_provider_name: string, arg_service_instance: Service, arg_context: string): nothing source

Create a messages gateway service provider.

Params:

NameTypeAttributeDescription
arg_provider_name string

consumer name.

arg_service_instance Service

service instance.

arg_context string

logging context label.

Return:

nothing

Public Members

public is_messages_svc_provider: boolean source

Class test flag.

Private Members

private _msg_subscriptions: object source

Messages subscriptions.

Public Methods

public abstract get_operations_names(): array source

Get provider operations names.

Return:

array

public has_subscription(arg_sender: string, arg_bus: string, arg_channel: string): boolean source

Test if a message subscription exists.

Params:

NameTypeAttributeDescription
arg_sender string

message sender name.

arg_bus string

message bus name.

arg_channel string

message channel name.

Return:

boolean

public init_subscription(arg_sender: string, arg_bus: string, arg_channel: string, arg_socket: Socket): boolean source

Test if a message subscription exists.

Params:

NameTypeAttributeDescription
arg_sender string

message sender name.

arg_bus string

message bus name.

arg_channel string

message channel name.

arg_socket Socket

subscription socket.

Return:

boolean

public produce(arg_request: ServiceRequest): Promise source

Produce service datas on request.

Params:

NameTypeAttributeDescription
arg_request ServiceRequest

service request instance.

Return:

Promise

promise of ServiceResponse instance.

public produce_send(arg_request: ServiceRequest): Promise source

Produce service datas on send request.

Params:

NameTypeAttributeDescription
arg_request ServiceRequest

service request instance.

Return:

Promise

promise of ServiceResponse instance.

public produce_subscribe(arg_request: ServiceRequest): Promise source

Produce service datas on subscribe request.

Params:

NameTypeAttributeDescription
arg_request ServiceRequest

service request instance.

Return:

Promise

promise of ServiceResponse instance.

public produce_unsubscribe(arg_request: ServiceRequest): Promise source

Produce service datas on unsubscribe request.

Params:

NameTypeAttributeDescription
arg_request ServiceRequest

service request instance.

Return:

Promise

promise of ServiceResponse instance.