Class WebSocketChannel
- java.lang.Object
-
- com.inductiveautomation.perspective.gateway.comm.WebSocketChannel
-
- All Implemented Interfaces:
MessageChannel
@WebSocket public class WebSocketChannel extends java.lang.Object implements MessageChannel
AWebSocketChannelconnection that is mounted for realtime messaging between a running web-client and the Ignition gateway's Perspective module.- Since:
- 8.0.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the message channelbooleanequals(java.lang.Object o)java.lang.StringgetPageId()Returns the view group identifier, which is used to differentiate between different instances of the same project .java.lang.StringgetProject()Returns the name of the project, which is unique.inthashCode()booleanisOpen()voidonClose(int statusCode, java.lang.String reason)voidonConnect(org.eclipse.jetty.websocket.api.Session socket)voidonMessage(org.eclipse.jetty.websocket.api.Session client, java.io.Reader reader)voidsend(java.lang.String protocol, java.lang.String payload)Sends a message to be handled by the appropriate handler (as identified by the protocol)
-
-
-
Method Detail
-
getProject
public java.lang.String getProject()
Description copied from interface:MessageChannelReturns the name of the project, which is unique.- Specified by:
getProjectin interfaceMessageChannel
-
getPageId
public java.lang.String getPageId()
Description copied from interface:MessageChannelReturns the view group identifier, which is used to differentiate between different instances of the same project . For a live project running in a browser, this might be the unique browser tab identifier. For a designer, this may be a specific workspace tab.- Specified by:
getPageIdin interfaceMessageChannel
-
isOpen
public boolean isOpen()
- Specified by:
isOpenin interfaceMessageChannel- Returns:
- false if the message channel not connected
-
send
public void send(java.lang.String protocol, java.lang.String payload) throws java.io.IOExceptionDescription copied from interface:MessageChannelSends a message to be handled by the appropriate handler (as identified by the protocol)- Specified by:
sendin interfaceMessageChannel- Throws:
java.io.IOException
-
close
public void close()
Description copied from interface:MessageChannelClose the message channel- Specified by:
closein interfaceMessageChannel
-
onConnect
@OnWebSocketConnect public void onConnect(org.eclipse.jetty.websocket.api.Session socket)
-
onMessage
@OnWebSocketMessage public void onMessage(org.eclipse.jetty.websocket.api.Session client, java.io.Reader reader) throws java.io.IOException- Throws:
java.io.IOException
-
onClose
@OnWebSocketClose public void onClose(int statusCode, java.lang.String reason)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-