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
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classWebSocketChannel.CloseEventDefinitions
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the message channelbooleanequals(java.lang.Object o)java.lang.StringgetAllCloseEventDefinitionsAsJson()java.util.Map<java.lang.String,java.lang.String>getCloseEventDefinitions(int code)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.voidhandleSocketInit()inthashCode()booleanisClosed()booleanisOpen()voidonClose(int statusCode, java.lang.String reason)voidonConnect(org.eclipse.jetty.websocket.api.Session socket)voidonError(java.lang.Throwable error)voidonMessage(org.eclipse.jetty.websocket.api.Session client, java.lang.String rawMessage)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- 
getProjectpublic java.lang.String getProject() Description copied from interface:MessageChannelReturns the name of the project, which is unique.- Specified by:
- getProjectin interface- MessageChannel
 
 - 
getPageIdpublic 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 interface- MessageChannel
 
 - 
isOpenpublic boolean isOpen() - Specified by:
- isOpenin interface- MessageChannel
- Returns:
- false if the message channel not connected
 
 - 
isClosedpublic boolean isClosed() - Specified by:
- isClosedin interface- MessageChannel
- Returns:
- true iff this channel was closed by the local side of this connection (in order words: from a call
 to MessageChannel.close()
 
 - 
sendpublic 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 interface- MessageChannel
- Throws:
- java.io.IOException
 
 - 
closepublic void close() Description copied from interface:MessageChannelClose the message channel- Specified by:
- closein interface- MessageChannel
 
 - 
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.lang.String rawMessage) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
onClose@OnWebSocketClose public void onClose(int statusCode, java.lang.String reason)
 - 
onError@OnWebSocketError public void onError(java.lang.Throwable error) 
 - 
equalspublic boolean equals(java.lang.Object o) - Overrides:
- equalsin class- java.lang.Object
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 - 
handleSocketInitpublic void handleSocketInit() 
 - 
getCloseEventDefinitionspublic java.util.Map<java.lang.String,java.lang.String> getCloseEventDefinitions(int code) 
 - 
getAllCloseEventDefinitionsAsJsonpublic java.lang.String getAllCloseEventDefinitionsAsJson() 
 
- 
 
-