Class WebSocketChannel
java.lang.Object
com.inductiveautomation.perspective.gateway.comm.WebSocketChannel
- All Implemented Interfaces:
MessageChannel
A
WebSocketChannel
connection that is mounted for realtime messaging between a running web-client and the
Ignition gateway's Perspective module.- Since:
- 8.0.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the message channelboolean
getCloseEventDefinitions
(int code) Returns the view group identifier, which is used to differentiate between different instances of the same project .Returns the name of the project, which is unique.void
int
hashCode()
boolean
isClosed()
boolean
isOpen()
void
void
onConnect
(org.eclipse.jetty.websocket.api.Session socket) void
void
void
Sends a message to be handled by the appropriate handler (as identified by the protocol)
-
Method Details
-
getProject
Description copied from interface:MessageChannel
Returns the name of the project, which is unique.- Specified by:
getProject
in interfaceMessageChannel
-
getPageId
Description copied from interface:MessageChannel
Returns 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:
getPageId
in interfaceMessageChannel
-
isOpen
public boolean isOpen()- Specified by:
isOpen
in interfaceMessageChannel
- Returns:
- false if the message channel not connected
-
isClosed
public boolean isClosed()- Specified by:
isClosed
in interfaceMessageChannel
- Returns:
- true iff this channel was closed by the local side of this connection (in order words: from a call
to
MessageChannel.close()
-
send
Description copied from interface:MessageChannel
Sends a message to be handled by the appropriate handler (as identified by the protocol)- Specified by:
send
in interfaceMessageChannel
- Throws:
IOException
-
close
public void close()Description copied from interface:MessageChannel
Close the message channel- Specified by:
close
in 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, String rawMessage) throws IOException - Throws:
IOException
-
onClose
-
onError
-
equals
-
hashCode
public int hashCode() -
handleSocketInit
public void handleSocketInit() -
getCloseEventDefinitions
-
getAllCloseEventDefinitionsAsJson
-