|
|
|
@ -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 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,9 +83,12 @@ 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 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
|
|
|
|
@ -90,9 +98,11 @@ 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 session - Registered session.
|
|
|
|
|
* @param deviceType - DeviceType
|
|
|
|
|
* @param deviceId - Device Identifier
|
|
|
|
|
* @param reason - Status code for web-socket close.
|
|
|
|
|
*/
|
|
|
|
|
@OnClose
|
|
|
|
@ -102,9 +112,11 @@ 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 session - Registered session.
|
|
|
|
|
* @param deviceType - DeviceType
|
|
|
|
|
* @param deviceId - Device Identifier
|
|
|
|
|
* @param throwable - Status code for web-socket close.
|
|
|
|
|
*/
|
|
|
|
|
@OnError
|
|
|
|
|