diff --git a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/ClientSessionSubscriptionEndpoint.java b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/ClientSessionSubscriptionEndpoint.java index a8273cf32..65fbea12c 100644 --- a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/ClientSessionSubscriptionEndpoint.java +++ b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/ClientSessionSubscriptionEndpoint.java @@ -43,9 +43,11 @@ public class ClientSessionSubscriptionEndpoint extends SubscriptionEndpoint { private static final Log log = LogFactory.getLog(ClientSessionSubscriptionEndpoint.class); /** - * Web socket onOpen - When client sends a message + * Web socket onOpen use when client connect to web socket url * - * @param session - Users registered session.. + * @param session - Registered session. + * @param deviceType - DeviceType + * @param deviceId - Device Identifier */ @OnOpen public void onOpen(Session session, @PathParam("deviceType") String deviceType, @PathParam("deviceId") String @@ -66,10 +68,12 @@ public class ClientSessionSubscriptionEndpoint extends SubscriptionEndpoint { } /** - * Web socket onMessage - When client sends a message + * Web socket onMessage use when client sends a string message * - * @param session - Users registered session. - * @param message - Status code for web-socket close. + * @param session - Registered session. + * @param deviceType - DeviceType + * @param deviceId - Device Identifier + * @param message - Status code for web-socket close. */ @OnMessage public void onMessage(Session session, String message, @PathParam("deviceType") String deviceType, @PathParam @@ -78,10 +82,12 @@ public class ClientSessionSubscriptionEndpoint extends SubscriptionEndpoint { } /** - * Web socket onMessage - When client sends a message + * Web socket onMessage use when client sends a byte message * - * @param session - Users registered session. - * @param message - Message which needs to send to peer + * @param session - Registered session. + * @param deviceType - DeviceType + * @param deviceId - Device Identifier + * @param message - Message which needs to send to peer */ @OnMessage public void onMessage(Session session, byte[] message, @PathParam("deviceType") String deviceType, @PathParam @@ -90,10 +96,12 @@ public class ClientSessionSubscriptionEndpoint extends SubscriptionEndpoint { } /** - * Web socket onClose - Remove the registered sessions + * Web socket onClose - Handle socket connection close * - * @param session - Users registered session. - * @param reason - Status code for web-socket close. + * @param session - Registered session. + * @param deviceType - DeviceType + * @param deviceId - Device Identifier + * @param reason - Status code for web-socket close. */ @OnClose public void onClose(Session session, CloseReason reason, @PathParam("deviceType") String deviceType, @PathParam @@ -102,10 +110,12 @@ public class ClientSessionSubscriptionEndpoint extends SubscriptionEndpoint { } /** - * Web socket onError - Remove the registered sessions + * Web socket onError - Handle socket connection error * - * @param session - Users registered session. - * @param throwable - Status code for web-socket close. + * @param session - Registered session. + * @param deviceType - DeviceType + * @param deviceId - Device Identifier + * @param throwable - Status code for web-socket close. */ @OnError public void onError(Session session, Throwable throwable, @PathParam("deviceType") String deviceType, @PathParam diff --git a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/DeviceSessionSubscriptionEndpoint.java b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/DeviceSessionSubscriptionEndpoint.java index 342f64f39..405b74bda 100644 --- a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/DeviceSessionSubscriptionEndpoint.java +++ b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/DeviceSessionSubscriptionEndpoint.java @@ -43,9 +43,12 @@ public class DeviceSessionSubscriptionEndpoint extends SubscriptionEndpoint { private static final Log log = LogFactory.getLog(DeviceSessionSubscriptionEndpoint.class); /** - * Web socket onOpen - When client sends a message + * Web socket onOpen use when device connect to web socket url * - * @param session - Users registered session.. + * @param session - Web socket Session + * @param deviceType - DeviceType + * @param deviceId - Device Identifier + * @param operationId - Operations Id */ @OnOpen public void onOpen(Session session, @PathParam("deviceType") String deviceType, @PathParam("deviceId") String @@ -66,10 +69,12 @@ public class DeviceSessionSubscriptionEndpoint extends SubscriptionEndpoint { } /** - * Web socket onMessage - When client sends a message + * Web socket onMessage use when device sends a string message * - * @param session - Users registered session. - * @param message - Status code for web-socket close. + * @param session - Registered session. + * @param message - Status code for web-socket close. + * @param deviceType - DeviceType + * @param deviceId - Device Identifier */ @OnMessage public void onMessage(Session session, String message, @PathParam("deviceType") String deviceType, @PathParam @@ -78,10 +83,13 @@ public class DeviceSessionSubscriptionEndpoint extends SubscriptionEndpoint { } /** - * Web socket onMessage - When client sends a message + * Web socket onMessage use when device sends a byte message * - * @param session - Users registered session. - * @param message - Message which needs to send to peer + * @param session - Registered session. + * @param message - Status code for web-socket close. + * @param deviceType - DeviceType + * @param deviceId - Device Identifier + * @param message - Message which needs to send to peer */ @OnMessage public void onMessage(Session session, byte[] message, @PathParam("deviceType") String deviceType, @PathParam @@ -90,10 +98,12 @@ public class DeviceSessionSubscriptionEndpoint extends SubscriptionEndpoint { } /** - * Web socket onClose - Remove the registered sessions + * Web socket onClose - Handle socket connection close * - * @param session - Users registered session. - * @param reason - Status code for web-socket close. + * @param session - Registered session. + * @param deviceType - DeviceType + * @param deviceId - Device Identifier + * @param reason - Status code for web-socket close. */ @OnClose public void onClose(Session session, CloseReason reason, @PathParam("deviceType") String deviceType, @PathParam @@ -102,10 +112,12 @@ public class DeviceSessionSubscriptionEndpoint extends SubscriptionEndpoint { } /** - * Web socket onError - Remove the registered sessions + * Web socket onError - Handle socket connection error * - * @param session - Users registered session. - * @param throwable - Status code for web-socket close. + * @param session - Registered session. + * @param deviceType - DeviceType + * @param deviceId - Device Identifier + * @param throwable - Status code for web-socket close. */ @OnError public void onError(Session session, Throwable throwable, @PathParam("deviceType") String deviceType, @PathParam diff --git a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/SubscriptionEndpoint.java b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/SubscriptionEndpoint.java index dad5dc787..706af8bf2 100644 --- a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/SubscriptionEndpoint.java +++ b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/SubscriptionEndpoint.java @@ -38,7 +38,9 @@ public class SubscriptionEndpoint { /** * Web socket onMessage - When client sends a message * - * @param session - Users registered session. + * @param session - Registered session. + * @param deviceType - DeviceType + * @param deviceId - Device Identifier * @param message - Status code for web-socket close. */ public void onMessage(Session session, String message, @PathParam("deviceType") String deviceType, @PathParam @@ -64,9 +66,11 @@ public class SubscriptionEndpoint { } /** - * Web socket onMessage - When client sends a message + * Web socket onMessage use When client sends a message * - * @param session - Users registered session. + * @param session - Registered session. + * @param deviceType - DeviceType + * @param deviceId - Device Identifier * @param message - Message which needs to send to peer */ public void onMessage(Session session, byte[] message, @PathParam("deviceType") String deviceType, @PathParam @@ -92,9 +96,11 @@ public class SubscriptionEndpoint { } /** - * Web socket onClose - Remove the registered sessions + * Web socket onClose - Handle socket connection close * - * @param session - Users registered session. + * @param session - Registered session. + * @param deviceType - DeviceType + * @param deviceId - Device Identifier * @param reason - Status code for web-socket close. */ public void onClose(Session session, CloseReason reason, @PathParam("deviceType") String deviceType, @PathParam @@ -110,9 +116,11 @@ public class SubscriptionEndpoint { } /** - * Web socket onError - Remove the registered sessions + * Web socket onError - Handle socket connection error * - * @param session - Users registered session. + * @param session - Registered session. + * @param deviceType - DeviceType + * @param deviceId - Device Identifier * @param throwable - Status code for web-socket close. */ public void onError(Session session, Throwable throwable, @PathParam("deviceType") String deviceType, @PathParam diff --git a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/constants/Constants.java b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/constants/Constants.java index fc3dcdfbc..544b58d57 100644 --- a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/constants/Constants.java +++ b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/constants/Constants.java @@ -25,4 +25,7 @@ package org.wso2.carbon.device.mgt.extensions.remote.session.endpoint.constants; */ public class Constants { public static final String HTTP_HEADERS = "HttpHeaders"; + + private Constants() { + } } diff --git a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/utils/HttpSessionConfigurator.java b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/utils/HttpSessionConfigurator.java index 94b6bf3fd..6d5513f95 100644 --- a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/utils/HttpSessionConfigurator.java +++ b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/utils/HttpSessionConfigurator.java @@ -28,6 +28,9 @@ import javax.websocket.server.ServerEndpointConfig; import java.util.List; import java.util.Map; +/** + * Class for handle HTTP session + */ public class HttpSessionConfigurator extends ServerEndpointConfig.Configurator { public void modifyHandshake(ServerEndpointConfig config, HandshakeRequest request, HandshakeResponse response) { Map> httpHeaders = request.getHeaders(); diff --git a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/utils/ServiceHolder.java b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/utils/ServiceHolder.java index 9a579b688..570238bb8 100644 --- a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/utils/ServiceHolder.java +++ b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/src/main/java/org/wso2/carbon/device/mgt/extensions/remote/session/endpoint/utils/ServiceHolder.java @@ -23,6 +23,9 @@ import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.mgt.extensions.remote.session.RemoteSessionManagementService; +/** + * Class for store remote management service instances + */ public class ServiceHolder { private static ServiceHolder instance;