Reference Source
public class | source

ServiceProvider

Extends:

js/messaging/streams_provider.js~StreamsProvider → ServiceProvider

Service provider base class.

Example:

	API:
		->load():nothing - Load settings.

		->activate(arg_application, arg_server, arg_app_svc_cfg):nothing - Activate a service feature for an application.

		->produce():Promise - Produce service datas on request.

		->get_host():string - Get host name of service server.
		->get_port():number - Get host port of service server.

Constructor Summary

Public Constructor
public

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

Create a service provider.

Member Summary

Public Members
public
public
public
public

server: *

public

service: *

Method Summary

Public Methods
public

Get host name of service server.

public abstract

Get provider operations names.

public

Get host port of service server.

public abstract

load(): nothing

Load settings.

public

post_to_subscriber(arg_subscriber: object, arg_stream_name: string, arg_datas: object): nothing

Post streams values to one subscriber.

public

produce(arg_request: ServiceRequest): Promise

Produce service datas on request.

Public Constructors

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

Create a 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 application: * source

public application_server: * source

public is_service_provider: boolean source

public server: * source

public service: * source

Public Methods

public get_host(): string source

Get host name of service server.

Return:

string

service host name

public abstract get_operations_names(): array source

Get provider operations names.

Return:

array

public get_port(): number source

Get host port of service server.

Return:

number

service host port

public abstract load(): nothing source

Load settings.

Return:

nothing

public post_to_subscriber(arg_subscriber: object, arg_stream_name: string, arg_datas: object): nothing source

Post streams values to one subscriber.

Params:

NameTypeAttributeDescription
arg_subscriber object

subscriber object (Socket...).

arg_stream_name string

stream name.

arg_datas object

response values.

Return:

nothing

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.