Class

cloud.artik.cloudconnector.api_v1

CloudConnector

Related Doc: package api_v1

Permalink

abstract class CloudConnector extends AnyRef

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. CloudConnector
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CloudConnector()

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def fetch(ctx: Context, req: RequestDef, info: DeviceInfo): Or[RequestDef, Failure]

    Permalink

    Callback_2: Optional completion of each data request of each notification with info from the Device Default impl: (keep as is)

    Callback_2: Optional completion of each data request of each notification with info from the Device Default impl: (keep as is)

    Good(req)
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def generateWelcomeMessage(ctx: Context, info: DeviceInfo, req: Option[RequestDef], res: Option[Response]): Or[WelcomeTask, Failure]

    Permalink

    Override this method if you want to display a message after the subscription phase.

    Override this method if you want to display a message after the subscription phase. You can use this method to list devices and let the user knows some devices will be created. Default impl: No welcome message is displayed

    Good(NoWelcomePage)
    ctx

    the Context of execution

    info

    the DeviceInfo of the target device

    req

    the RequestDef that produce the res (None if no res is None)

    res

    the Response produced by the RequestDef returns by a previous call to generateWelcomePage

  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  13. def initialize(ctx: Context): Or[List[RequestDef], Failure]

    Permalink

    Override this method if CloudConnector require to do some requests to complete the setup of the CloudConnector on the third party (the method is called at least once after approbation/activation) (e.g.

    Override this method if CloudConnector require to do some requests to complete the setup of the CloudConnector on the third party (the method is called at least once after approbation/activation) (e.g. to register/validate a notification url)

    Default impl:

    Good(Empty.list())
    returns

    an list of Request that will be called in order to complete setup on third party.

  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. def normalizeOauth2Code(ctx: Context, req: RequestDef): Or[RequestDef, Failure]

    Permalink

    Sometimes the third-party cloud doesn't follow the OAuth2 RFC This method allow to "normalize" the incoming request with OAuth2 code.

    Sometimes the third-party cloud doesn't follow the OAuth2 RFC This method allow to "normalize" the incoming request with OAuth2 code.

    Default impl: (keep as is)

    Good(req)
    ctx

    the Context for the current Cloud Connector

    req

    the http request received by the server from the client with the oauth2's code, the request to normalize

    returns

    a RequestDef with the oauth2's code as query parameter

  17. def normalizeOauth2Token(ctx: Context, resp: Response, phase: Phase): Or[Response, Failure]

    Permalink

    Sometimes the third-party cloud doesn't follow the OAuth2 RFC This method allow to "normalize" the response to the request for accessToken (phase == getOauth2Token) or to the request to refreshToken (phase == refreshToken).

    Sometimes the third-party cloud doesn't follow the OAuth2 RFC This method allow to "normalize" the response to the request for accessToken (phase == getOauth2Token) or to the request to refreshToken (phase == refreshToken). (this function is called before applying the mapping define in accessTokenUrlMapper if it is defined)

    Default impl: (keep as is)

    Good(resp)
    ctx

    the Context for the current Cloud Connector

    resp

    the http response from the 3rd party cloud to the access token request (first time or refresh), the request to normalize

    phase

    the Phase where the response is read (getOauth2Token or refreshToken)

    returns

    a Response with the oauth2's parameter normalized

  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. def onAction(ctx: Context, action: ActionDef, info: DeviceInfo): Or[ActionResponse, Failure]

    Permalink

    Callback_5: Called for each action received.

    Callback_5: Called for each action received. The request targets 1 device. Optionally build data request with info from the Device. Fetch function will be called with the RequestDef included in. Default impl:

    Bad(Failure("unsupported: method onAction should be implemented"))
  21. def onActionData(ctx: Context, info: DeviceInfo, data: String): Or[List[Task], Failure]

    Permalink

    Callback_6: Called for each pushed data generated by onAction

  22. def onCustomAuthentication(ctx: Context, req: RequestDef, res: Option[Response]): Or[CustomAuthenticationTask, Failure]

    Permalink

    Override this method if your CloudConnector authentication type is CUSTOM_AUTH.

    Override this method if your CloudConnector authentication type is CUSTOM_AUTH. Default impl:

    Bad(Failure("unsupported: method onCustomAuthentication should be implemented"))
  23. def onFetchResponse(ctx: Context, req: RequestDef, info: DeviceInfo, res: Response): Or[List[Task], Failure]

    Permalink

    Callback_3: Parse Response from req to extract, filter, transform data for the device (only response with http status 200 - 299, other status are managed by CloudConnector Container) Default impl:

    Callback_3: Parse Response from req to extract, filter, transform data for the device (only response with http status 200 - 299, other status are managed by CloudConnector Container) Default impl:

    Bad(Failure("unsupported : method onFetchResponse should be implemented"))
  24. def onInitializeResponse(ctx: Context, req: RequestDef, res: Response): Or[Map[String, String], Failure]

    Permalink

    to process the response of the request send on initialize.

    to process the response of the request send on initialize.

    Default impl:

    Good(Empty.map())
    returns

    ignored (TODAY)

  25. def onNotification(ctx: Context, req: RequestDef): Or[NotificationResponse, Failure]

    Permalink

    Callback_1: Ask CloudConnector to parse the notification request from third party cloud to extract all notifications.

    Callback_1: Ask CloudConnector to parse the notification request from third party cloud to extract all notifications. The request can target 0+ devices and can notify about 1+ data feed. Default impl:

    Bad(Failure("unsupported : method onNotification should be implemented"))

    Failure("unsupported : method onNotification should be implemented")

  26. def onNotificationData(ctx: Context, info: DeviceInfo, data: String): Or[List[Task], Failure]

    Permalink

    Callback_4: Parse and check (authorisation) pushed data (data come from Notification and can be transformed) Default impl:

    Callback_4: Parse and check (authorisation) pushed data (data come from Notification and can be transformed) Default impl:

    Bad(Failure("unsupported: method onNotificationData should be implemented"))
  27. def onSubscribeResponse(ctx: Context, req: RequestDef, info: DeviceInfo, res: Response): Or[Option[DeviceInfo], Failure]

    Permalink

    Procress the response of the request defined by subscribe(...).

    Procress the response of the request defined by subscribe(...). The subscription can store/update the deviceInfo. Default impl:

    Good(None)
    returns

    an updated DeviceInfo (or None / Option.apply(null) if nothing to store)

  28. def onUnsubscribeResponse(ctx: Context, req: RequestDef, info: DeviceInfo, res: Response): Or[Option[DeviceInfo], Failure]

    Permalink

    Procress the response of the request defined by unsubscribe(...).

    Procress the response of the request defined by unsubscribe(...). Default impl:

    Good(None)
    returns

    an updated DeviceInfo (or None / Option.apply(null) if nothing to store)

  29. def signAndPrepare(ctx: Context, req: RequestDef, info: DeviceInfo, phase: Phase): Or[RequestDef, Failure]

    Permalink

    This will be call automatically on every API request to the 3rd party cloud.

    This will be call automatically on every API request to the 3rd party cloud. You can use this method to complete request with authorisation data, ...

    Default impl: (keep as is)

    Good(req)

    This method is also the only way to customize request to refresh token.

    if (phase == Phase.refreshToken) {
      ...
    }
  30. def subscribe(ctx: Context, info: DeviceInfo): Or[List[RequestDef], Failure]

    Permalink

    Override this method if CloudConnector require to do some request to complete the subscription after authentication (eg: to retreive user's timezone use in notification, to request subscriptionId on 3rd party cloud).

    Override this method if CloudConnector require to do some request to complete the subscription after authentication (eg: to retreive user's timezone use in notification, to request subscriptionId on 3rd party cloud).

    The function could be called several times for a remote device: * several ARTIK Cloud device are linked to the same remote account/device * re-subscription is called explicitly

    phase: subscribe Default impl:

    Good(Empty.list)
    returns

    a list of Requests that will be called in order to subscribe to notifications for a given device.

  31. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  32. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  33. def unsubscribe(ctx: Context, info: DeviceInfo): Or[List[RequestDef], Failure]

    Permalink

    Override this method if CloudConnector require to do some request to complete the unsubscription.

    Override this method if CloudConnector require to do some request to complete the unsubscription. If several ARTIK Cloud device share the same external Id, then the function will be called, only when the last device will be removed. To avoid remove notification on external Id shared by several devices.

    phase: unsubscribe Default impl:

    Good(Empty.list)
    returns

    a list of Requests that will be called in order to remove notifications/subscription on third party for a given device.

  34. def unsubscribeLast(ctx: Context, info: DeviceInfo): Or[List[RequestDef], Failure]

    Permalink

    Override this method if CloudConnector requires to do some request to complete the unsubscription for the last connected device of a user.

    Override this method if CloudConnector requires to do some request to complete the unsubscription for the last connected device of a user. This method will be called only if the CloudConnector is using external Id. and if the device is the last device of the user for a given external Id. This method will be called once the unsubscribe method has been done successfully for this device. phase: unsubscribe Default impl:

    Good(Empty.list)
    returns

    a list of Requests that will be called in order to remove notifications/subscription on third party for a given device.

  35. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped