Class EventsSocketClient
- java.lang.Object
-
- com.artisol.teneo.studio.client.sockets.EventsSocketClient
-
public class EventsSocketClient extends Object
-
-
Constructor Summary
Constructors Constructor Description EventsSocketClient(String host, boolean isSecureConnection, com.artisol.teneo.studio.api.resources.WebSocketsResource webSocketsResource)
Client to establish the event channel connection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createEventsSocket(EventsHandler handler)
Create a new event socket connection.void
disconnect()
Disconnect and close the socket connection.boolean
isSessionAvailable()
Gets if the events' socket is connected and a session is available.void
subscribeToLogDataSources(Set<UUID> logDataSourceIds)
Subscribe to get the events of one or more log data sources.void
subscribeToSolutions(Set<UUID> solutionIds)
Subscribe to get the events of one or more Solution.void
unsubscribeToLogDataSources(Set<UUID> logDataSourceIds)
Unsubscribe to stop getting events from one or more log data sources.void
unsubscribeToSolutions(Set<UUID> solutionIds)
Unsubscribe to stop getting events from one or more solutions.
-
-
-
Constructor Detail
-
EventsSocketClient
public EventsSocketClient(String host, boolean isSecureConnection, com.artisol.teneo.studio.api.resources.WebSocketsResource webSocketsResource)
Client to establish the event channel connection.- Parameters:
host
- server addressisSecureConnection
- indicates whether to use a secure connection.webSocketsResource
- resource to retrieve the session token.
-
-
Method Detail
-
createEventsSocket
public void createEventsSocket(EventsHandler handler) throws javax.websocket.DeploymentException, com.artisol.teneo.studio.api.exceptions.ResourceException
Create a new event socket connection.- Parameters:
handler
- An EventsHandler implementation to process the events.- Throws:
com.artisol.teneo.studio.api.exceptions.ResourceException
- error on authentication.javax.websocket.DeploymentException
- error on connection.
-
subscribeToLogDataSources
public void subscribeToLogDataSources(Set<UUID> logDataSourceIds) throws Exception
Subscribe to get the events of one or more log data sources.- Parameters:
logDataSourceIds
- a Set of log data source Ids to subscribe to.- Throws:
Exception
- when sending the message fails.
-
unsubscribeToLogDataSources
public void unsubscribeToLogDataSources(Set<UUID> logDataSourceIds) throws Exception
Unsubscribe to stop getting events from one or more log data sources.- Parameters:
logDataSourceIds
- a Set of log data source Ids to subscribe to.- Throws:
Exception
- when sending the message fails.
-
subscribeToSolutions
public void subscribeToSolutions(Set<UUID> solutionIds) throws Exception
Subscribe to get the events of one or more Solution.- Parameters:
solutionIds
- a Set of solution IDs to subscribe to.- Throws:
Exception
- when sending the message fails.
-
unsubscribeToSolutions
public void unsubscribeToSolutions(Set<UUID> solutionIds) throws Exception
Unsubscribe to stop getting events from one or more solutions.- Parameters:
solutionIds
- a Set of solution IDs to unsubscribe to.- Throws:
Exception
- when sending the message fails.
-
disconnect
public void disconnect()
Disconnect and close the socket connection. Also stops reconnecting the client.
-
-