Loading...
Searching...
No Matches
MewsRestClient::MewsRestConnection Class Reference

Class for Mews REST connections; returns MewsRestClient objects. More...

## Public Member Functions

| constructor (hash< auto > config, *hash< auto > attr)
| creates the MewsRestConnection object
*string | getAppName ()
| Returns the data provider application name this connection serves, if any.
DataProvider::AbstractDataProvider | getDataProvider (*hash< auto > constructor_options)
| returns a data provider object for this connection
string | getType ()
| returns `"mewsrest"`
bool | hasDataProvider ()
| returns True as this connection returns a data provider with the getDataProvider() method
Qore::AbstractPollOperation | startPollConnect (*Logger::LoggerInterface logger)
| Called to start a non-blocking polling ping operation on the remote REST server.

## Public Attributes

const | ConnectionScheme = ...
| Connection entry info.
const | DefaultMewsPingBody = "auto"
| Default Mews ping body.
const | DefaultMewsPingHeaders = ...
| Default Mews ping headers.
const | DefaultMewsPingMethod = "POST"
| Default Mews ping method.
const | DefaultMewsPingPath = "configuration/get"
| Defualt Mews ping path.
const | MewsUnsupportedRestOptions = ...
| REST options not supported by this class.

## Protected Member Functions

hash< ConnectionSchemeInfo > | getConnectionSchemeInfoImpl ()
| Returns the ConnectionSchemeInfo hash for this object.
MewsRestClient | getImpl (bool connect=True, *hash< auto > rtopts)
| returns a MewsRestClient object
*string | getPingPath ()
| Returns the ping path from the `ping_path` option.
| setChildCapabilities ()
| Sets child data provider capabilities.

## Detailed Description

Class for Mews REST connections; returns MewsRestClient objects.

This class implements a subset of RestClientConnection; in addition, this class requires values for the following options:

- `client_token`
- `access_token`

See also
  MewsRestClient::MewsRestClient::constructor() for more information on the above options

## Member Function Documentation

## constructor()

MewsRestClient::MewsRestConnection::constructor | ( | hash< auto > | config,
|  | *hash< auto > | attr )

creates the MewsRestConnection object

Parameters

  config

  with the following keys:
  - name (required string): the connection name
  - display_name (optional string): the display name
  - short_desc (optional string): a short description in plain text
  - desc (optional string): a long description with markdown formatting
  - url (required string): the connection URL
  - opts (optional hash): connection options
  - logger (optional LoggerInterface object): logger for the connection

  attr

  optional connection attributes
  - monitor (optional bool): should the connection be monitored? Default: True
  - enabled (optional bool): is the connection enabled? Default: True
  - locked (optional bool): is the connection locked? Default: False
  - debug_data (optional bool): debug data? Default: False
  - tags (optional hash): tags for the connection; no default value

Exceptions

  CONNECTION-OPTION-ERROR | missing or invalid connection option or attribute

## getAppName()

*string MewsRestClient::MewsRestConnection::getAppName | ( |  | ) |

Returns the data provider application name this connection serves, if any.

Returns
  the data provider application name this connection serves, if any

## getDataProvider()

DataProvider::AbstractDataProvider MewsRestClient::MewsRestConnection::getDataProvider | ( | *hash< auto > | constructor_options | ) |

returns a data provider object for this connection

Parameters

  constructor_options | any additional constructor options for the data provider

Returns
  a data provider object for this connection

## getImpl()

MewsRestClient MewsRestClient::MewsRestConnection::getImpl | ( | bool | connect = True,
|  | *hash< auto > | rtopts )

protected

returns a MewsRestClient object

Parameters

  connect | if True, then the connection is returned already connected
  rtopts | this connection type does not accept any runtime options, so this parameter is ignored

Returns
  a MewsRestClient object

## hasDataProvider()

bool MewsRestClient::MewsRestConnection::hasDataProvider | ( |  | ) |

returns True as this connection returns a data provider with the getDataProvider() method

Returns
  True as this connection returns a data provider with the getDataProvider() method

See also
  getDataProvider()

## startPollConnect()

Qore::AbstractPollOperation MewsRestClient::MewsRestConnection::startPollConnect | ( | *Logger::LoggerInterface | logger | ) |

Called to start a non-blocking polling ping operation on the remote REST server.

Returns
  a socket poll operation object that will allow the connection goal to be reached with polling

See also
  supportsPollingApi()