The GEOSS Discovery And Access Broker APIs
Authors: Fabrizio Papeschi, Mattia Santoro, Stefano Nativi
API version: 1.4.3-beta

Subscription

Module: PubSub

This object allows to make a subscription to the PubSubManager.
A subscription can be made with the same set of constraints and options of a discover; after its creation, the subscription expires in 1 hour. Once expired, the subscription can optionally be Subscription/renew:method and subscribed again to the PubSubManager.

Each subscription must be associated to the same "client identifier"; this way each API client can retrieve from the PubSubManager only its own subscriptions (and it will not be able to retrieve subscriptions made by other clients).
Note: if a subscription with the specified label and clientID is already subscribed, this subscription will be rejected. See also SUBSCRIPTION_REJECTED error

   var constraints = {
"where": { "south": -10, "west": -20, "north": 10, "east": 20 }, "when": { "from" : "2000-01-01", "to": "2013-01-01" }, "what": "water" }
var clientID = 'example-client-ID'; var subscription = GIAPI.Subscription('example-label',constraints,clientID);
var creDate = subscription.creation(); var expDate = subscription.expiration();

Constructor

Subscription

(
  • label
  • constraints
  • clientID
)

Parameters:

  • label String

    a label to describe this subscription. If a subscription with the specified label and clientID is already subscribed, this subscription will be rejected. See also SUBSCRIPTION_REJECTED error

  • constraints Object

    an object with the constraints of this subscription (see also DAB discover constraints)

  • clientID String

    a string which identifies this API client. If a subscription with the specified label and clientID is already subscribed, this subscription will be rejected. See also SUBSCRIPTION_REJECTED error

Methods

clientID

(
  • clientID
)
String

Returns and/or set the client ID associated to this subscription.

Parameters:

  • clientID String

    a string to which identifies this API client

Returns:

String:

the client ID associated to this subscription

constraints

(
  • constraints
)
Object

Returns and/or set the constraints of this subscription.

Parameters:

Returns:

Object:

the constraints of this subscription

creation

() Date

Returns the creation date of this subscription.

Returns:

Date:

the creation date of this subscription

expiration

() Date

Returns the expiration date of this subscription; the expiration takes place 1 hour after the creation.

See also Subscription/renew:method

Returns:

Date:

the creation date of this subscription

id

() String

Returns the unique identifier of this subscription.

Returns:

String:

the unique identifier of this subscription

label

(
  • label
)
String

Returns and/or set the label of this subscription.

Parameters:

  • label String

    a label to describe this subscription

Returns:

String:

the label of this subscription

options

(
  • options
)
Object

Returns and/or set the options of this subscription.

Parameters:

Returns:

Object:

the options of this subscription