org.wso2.carbon.device.mgt.output.adapter.websocket.endpoint

## Class TenantSubscriptionEndpoint

- java.lang.Object
- - org.wso2.carbon.device.mgt.output.adapter.websocket.endpoint.SubscriptionEndpoint
  - - org.wso2.carbon.device.mgt.output.adapter.websocket.endpoint.TenantSubscriptionEndpoint

-     public class TenantSubscriptionEndpoint
      extends SubscriptionEndpoint

  Connect to web socket with a tenant

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TenantSubscriptionEndpoint()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `onClose(javax.websocket.Session session, javax.websocket.CloseReason reason, String streamName, String version, String tdomain)` Web socket onClose - Remove the registered sessions
    `void` | `onError(javax.websocket.Session session, Throwable throwable, String streamName, String version, String tdomain)` Web socket onError - Remove the registered sessions
    `void` | `onMessage(javax.websocket.Session session, String message, String streamName, String tdomain)` Web socket onMessage - When client sens a message
    `void` | `onOpen(javax.websocket.Session session, javax.websocket.EndpointConfig config, String streamName, String version, String tdomain)` Web socket onOpen - When client sends a message

    - ### Methods inherited from class org.wso2.carbon.device.mgt.output.adapter.websocket.endpoint.SubscriptionEndpoint

      `onClose, onError`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TenantSubscriptionEndpoint

          public TenantSubscriptionEndpoint()

  - ### Method Detail

    - #### onOpen

          public void onOpen(javax.websocket.Session session,
                    javax.websocket.EndpointConfig config,
                    String streamName,
                    String version,
                    String tdomain)

      Web socket onOpen - When client sends a message
      Parameters:
        `session` - - Users registered session.
        `streamName` - - StreamName extracted from the ws url.
        `version` - - Version extracted from the ws url.
        `tdomain` - - Tenant domain extracted from ws url.

    - #### onMessage

          public void onMessage(javax.websocket.Session session,
                       String message,
                       String streamName,
                       String tdomain)

      Web socket onMessage - When client sens a message
      Parameters:
        `session` - - Users registered session.
        `message` - - Status code for web-socket close.
        `streamName` - - StreamName extracted from the ws url.

    - #### onClose

          public void onClose(javax.websocket.Session session,
                     javax.websocket.CloseReason reason,
                     String streamName,
                     String version,
                     String tdomain)

      Web socket onClose - Remove the registered sessions
      Parameters:
        `session` - - Users registered session.
        `reason` - - Status code for web-socket close.
        `streamName` - - StreamName extracted from the ws url.
        `version` - - Version extracted from the ws url.

    - #### onError

          public void onError(javax.websocket.Session session,
                     Throwable throwable,
                     String streamName,
                     String version,
                     String tdomain)

      Web socket onError - Remove the registered sessions
      Parameters:
        `session` - - Users registered session.
        `throwable` - - Status code for web-socket close.
        `streamName` - - StreamName extracted from the ws url.
        `version` - - Version extracted from the ws url.

Copyright © 2017 WSO2. All rights reserved.