Class WebsocketFactory
java.lang.Object
de.iip_ecosphere.platform.support.websocket.WebsocketFactory
Generic access to WebSockets. Requires an implementing plugin of type
WebsocketFactory or an active
WebsocketFactoryProviderDescriptor. Simplified interface akin to WebSocket.- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceIs called on status changes.static interfaceA web socket. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract de.iip_ecosphere.platform.support.ServercreateBroadcastingServer(de.iip_ecosphere.platform.support.ServerAddress address) Creates a broadcasting/relay server.abstract WebsocketFactory.WebSocketcreateSocket(URI uri) Creates the websocket.static WebsocketFactoryReturns the WebServices instance.static voidsetInstance(WebsocketFactory rest) Manually sets the instance.
-
Field Details
-
instance
-
-
Constructor Details
-
WebsocketFactory
public WebsocketFactory()
-
-
Method Details
-
getInstance
Returns the WebServices instance.- Returns:
- the instance
-
setInstance
Manually sets the instance. Shall not be needed, but may be required in some tests.- Parameters:
rest- the Rest instance
-
createSocket
Creates the websocket.- Parameters:
uri- the URI to connect to- Returns:
- the socket instance
- Throws:
IOException- if creating fails
-
createBroadcastingServer
public abstract de.iip_ecosphere.platform.support.Server createBroadcastingServer(de.iip_ecosphere.platform.support.ServerAddress address) throws IOException Creates a broadcasting/relay server.- Parameters:
address- the server address- Returns:
- the socket instance
- Throws:
IOException- if creating fails
-