Package org.yamcs.http.websocket
Class ManagementResource
- java.lang.Object
-
- org.yamcs.http.websocket.ManagementResource
-
- All Implemented Interfaces:
WebSocketResource
,ManagementListener
public class ManagementResource extends Object implements WebSocketResource, ManagementListener
Provides access to any Processor/Client info over web socket
-
-
Constructor Summary
Constructors Constructor Description ManagementResource(ConnectedWebSocketClient client)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clientInfoChanged(ConnectedClient changedClient)
void
clientRegistered(ConnectedClient newClient)
void
clientUnregistered(ConnectedClient oldClient)
String
getName()
void
processorAdded(ProcessorInfo processorInfo)
void
processorClosed(ProcessorInfo processorInfo)
void
processorStateChanged(ProcessorInfo processorInfo)
void
selectProcessor(Processor processor)
void
socketClosed()
Called when the web socket is closedvoid
statisticsUpdated(Processor processor, Statistics stats)
Called by theManagementService
when the statistics for the given processor were updated.WebSocketReply
subscribe(WebSocketDecodeContext ctx, WebSocketDecoder decoder)
Registers for updates on any processor or client.void
unselectProcessor()
WebSocketReply
unsubscribe(WebSocketDecodeContext ctx, WebSocketDecoder decoder)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.yamcs.management.ManagementListener
instanceStateChanged, serviceRegistered, serviceUnregistered
-
Methods inherited from interface org.yamcs.http.websocket.WebSocketResource
processRequest, subscribe, subscribeAll, unsubscribeAll
-
-
-
-
Constructor Detail
-
ManagementResource
public ManagementResource(ConnectedWebSocketClient client)
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getName
in interfaceWebSocketResource
-
subscribe
public WebSocketReply subscribe(WebSocketDecodeContext ctx, WebSocketDecoder decoder) throws WebSocketException
Registers for updates on any processor or client. Sends the current set of processor, and clients (in that order) to the requester.Calling this multiple times, will cause the current set of data to be sent again. Further updates will still arrive one-time only.
- Specified by:
subscribe
in interfaceWebSocketResource
- Throws:
WebSocketException
-
unsubscribe
public WebSocketReply unsubscribe(WebSocketDecodeContext ctx, WebSocketDecoder decoder) throws WebSocketException
- Specified by:
unsubscribe
in interfaceWebSocketResource
- Throws:
WebSocketException
-
selectProcessor
public void selectProcessor(Processor processor) throws ProcessorException
- Specified by:
selectProcessor
in interfaceWebSocketResource
- Throws:
ProcessorException
-
unselectProcessor
public void unselectProcessor()
- Specified by:
unselectProcessor
in interfaceWebSocketResource
-
processorAdded
public void processorAdded(ProcessorInfo processorInfo)
- Specified by:
processorAdded
in interfaceManagementListener
-
processorStateChanged
public void processorStateChanged(ProcessorInfo processorInfo)
- Specified by:
processorStateChanged
in interfaceManagementListener
-
processorClosed
public void processorClosed(ProcessorInfo processorInfo)
- Specified by:
processorClosed
in interfaceManagementListener
-
clientRegistered
public void clientRegistered(ConnectedClient newClient)
- Specified by:
clientRegistered
in interfaceManagementListener
-
clientInfoChanged
public void clientInfoChanged(ConnectedClient changedClient)
- Specified by:
clientInfoChanged
in interfaceManagementListener
-
clientUnregistered
public void clientUnregistered(ConnectedClient oldClient)
- Specified by:
clientUnregistered
in interfaceManagementListener
-
statisticsUpdated
public void statisticsUpdated(Processor processor, Statistics stats)
Description copied from interface:ManagementListener
Called by theManagementService
when the statistics for the given processor were updated. This usually happens at about 1Hz.- Specified by:
statisticsUpdated
in interfaceManagementListener
-
socketClosed
public void socketClosed()
Description copied from interface:WebSocketResource
Called when the web socket is closed- Specified by:
socketClosed
in interfaceWebSocketResource
-
-