Class: BaseEntity

(abstract) BaseEntity(connection, properties)

The base class for entities such as Job, Process Graph, Service etc.

Constructor

(abstract) new BaseEntity(connection, properties)

Creates an instance of this object.

Parameters:
Name Type Description
connection Connection

A Connection object representing an established connection to an openEO back-end.

properties Array

A mapping from the API property names to the JS client property names (usually to convert between snake_case and camelCase), e.g. ["id", "title", ["process_graph", "processGraph"]]

Source:

Members

(protected) apiToClientNames :object.<string, string>

Type:
  • object.<string, string>
Source:

(protected) clientToApiNames :object.<string, string>

Type:
  • object.<string, string>
Source:

(protected) connection :Connection

Type:
Source:

(protected) extra :object.<string, *>

Additional (non-standardized) properties received from the API.

Type:
  • object.<string, *>
Source:

(protected) lastRefreshTime :number

Type:
  • number
Source:

Methods

(protected) _convertToRequest(parameters) → {object.<string, *>}

Converts the object to a valid objects for API requests.

Parameters:
Name Type Description
parameters object.<string, *>
Source:
Returns:
Type
object.<string, *>

(protected) _supports(feature) → {boolean}

Checks whether a features is supported by the API.

Parameters:
Name Type Description
feature string
Source:
See:
Returns:
Type
boolean

get(name) → {*}

Get a value from the additional data that is not part of the core model, i.e. from proprietary extensions.

Parameters:
Name Type Description
name string

Name of the property.

Source:
Returns:

The value, which could be of any type.

Type
*

getAll() → {object.<string, *>}

Returns all data in the model.

Source:
Returns:
Type
object.<string, *>

getDataAge() → {number}

Returns the age of the data in seconds.

Source:
Returns:

Age of the data in seconds as integer.

Type
number

setAll(metadata) → {BaseEntity}

Converts the data from an API response into data suitable for our JS client models.

Parameters:
Name Type Description
metadata object.<string, *>

JSON object originating from an API response.

Source:
Returns:

Returns the object itself.

Type
BaseEntity

toJSON() → {object.<string, *>}

Returns a JSON serializable representation of the data that is API compliant.

Source:
Returns:
Type
object.<string, *>