Home Reference Source Test
import AddressAllocation from 'runtime-core/src/allocation/AddressAllocation.js'
public class | source

AddressAllocation

Class will ask to the message node for addresses

Static Member Summary

Static Public Members
public static get

Constructor Summary

Public Constructor
public

constructor(url: URL.URL, bus: MiniBus)

Create an Address Allocation

Member Summary

Public Members
public get

url: string: *

get the URL value

Method Summary

Public Methods
public

create(domain: Domain, number: Number, info: Descriptor, scheme: scheme, reuseURL: boolean | URL.HypertyURL): Promise<Object, Error>

Ask for creation of a number of Hyperty addresses, to the domain message node.

public

delete(domain: Domain, addresses: addresses): Promise

Send a request to the domain message node, to deallocate one or more addresses

Static Public Members

public static get instance: * source

Public Constructors

public constructor(url: URL.URL, bus: MiniBus) source

Create an Address Allocation

Params:

NameTypeAttributeDescription
url URL.URL

url from who is sending the message

bus MiniBus

MiniBus used for address allocation

Public Members

public get url: string: * source

get the URL value

Return:

string

The url value;

Public Methods

public create(domain: Domain, number: Number, info: Descriptor, scheme: scheme, reuseURL: boolean | URL.HypertyURL): Promise<Object, Error> source

Ask for creation of a number of Hyperty addresses, to the domain message node.

Params:

NameTypeAttributeDescription
domain Domain

domain of the message node

number Number

number of address to be allocated

info Descriptor

descriptor to search for the hyperty (TODO:// this should be confirmed)

scheme scheme

scheme of address to be created or reused, like: hyperty, comm, context, etc;

reuseURL boolean | URL.HypertyURL

reuseURL is used to reuse the hypertyURL previously registred;

Return:

Promise<Object, Error>

this is Promise and returns an object with the address information

See:

public delete(domain: Domain, addresses: addresses): Promise source

Send a request to the domain message node, to deallocate one or more addresses

Params:

NameTypeAttributeDescription
domain Domain

Domain of the message node.

addresses addresses

to request the deallocation

Return:

Promise

the response by the message node