|
|
@ -43,9 +43,12 @@ public class DeviceSessionSubscriptionEndpoint extends SubscriptionEndpoint {
|
|
|
|
private static final Log log = LogFactory.getLog(DeviceSessionSubscriptionEndpoint.class);
|
|
|
|
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
|
|
|
|
@OnOpen
|
|
|
|
public void onOpen(Session session, @PathParam("deviceType") String deviceType, @PathParam("deviceId") String
|
|
|
|
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 message - Status code for web-socket close.
|
|
|
|
|
|
|
|
* @param deviceType - DeviceType
|
|
|
|
|
|
|
|
* @param deviceId - Device Identifier
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@OnMessage
|
|
|
|
@OnMessage
|
|
|
|
public void onMessage(Session session, String message, @PathParam("deviceType") String deviceType, @PathParam
|
|
|
|
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 session - Registered session.
|
|
|
|
* @param message - Message which needs to send to peer
|
|
|
|
* @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
|
|
|
|
@OnMessage
|
|
|
|
public void onMessage(Session session, byte[] message, @PathParam("deviceType") String deviceType, @PathParam
|
|
|
|
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 session - Registered session.
|
|
|
|
* @param reason - Status code for web-socket close.
|
|
|
|
* @param deviceType - DeviceType
|
|
|
|
|
|
|
|
* @param deviceId - Device Identifier
|
|
|
|
|
|
|
|
* @param reason - Status code for web-socket close.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@OnClose
|
|
|
|
@OnClose
|
|
|
|
public void onClose(Session session, CloseReason reason, @PathParam("deviceType") String deviceType, @PathParam
|
|
|
|
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 session - Registered session.
|
|
|
|
* @param throwable - Status code for web-socket close.
|
|
|
|
* @param deviceType - DeviceType
|
|
|
|
|
|
|
|
* @param deviceId - Device Identifier
|
|
|
|
|
|
|
|
* @param throwable - Status code for web-socket close.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@OnError
|
|
|
|
@OnError
|
|
|
|
public void onError(Session session, Throwable throwable, @PathParam("deviceType") String deviceType, @PathParam
|
|
|
|
public void onError(Session session, Throwable throwable, @PathParam("deviceType") String deviceType, @PathParam
|
|
|
|