Package csw.framework.javadsl
Class JDefaultComponentHandlers
- java.lang.Object
- 
- csw.framework.scaladsl.ComponentHandlers
- 
- csw.framework.javadsl.JComponentHandlers
- 
- csw.framework.javadsl.JDefaultComponentHandlers
 
 
 
- 
 public class JDefaultComponentHandlers extends JComponentHandlers 
- 
- 
Constructor SummaryConstructors Constructor Description JDefaultComponentHandlers(akka.actor.typed.javadsl.ActorContext<TopLevelActorMessage> ctx, JCswContext cswCtx)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinitialize()The initialize handler is invoked when the component is created.voidonDiagnosticMode(UTCTime startTime, java.lang.String hint)On receiving a diagnostic data command, the component goes into a diagnostic data mode based on hint at the specified startTime.voidonGoOffline()A component can be notified to run in offline mode in case it is not in use.voidonGoOnline()A component can be notified to run in online mode again in case it was put to run in offline mode.voidonLocationTrackingEvent(TrackingEvent trackingEvent)The onLocationTrackingEvent handler can be used to take action on the TrackingEvent for a particular connection.voidonOneway(Id runId, ControlCommand controlCommand)On receiving a command as Oneway, the onOneway handler is invoked for a component only if the validateCommand handler returns Accepted.voidonOperationsMode()On receiving a operations mode command, the current diagnostic data mode is halted.voidonShutdown()The onShutdown handler can be used for carrying out the tasks which will allow the component to shutdown gracefullyCommandResponse.SubmitResponseonSubmit(Id runId, ControlCommand controlCommand)On receiving a command as Submit, the onSubmit handler is invoked for a component only if the validateCommand handler returns Accepted.CommandResponse.ValidateCommandResponsevalidateCommand(Id runId, ControlCommand controlCommand)The validateCommand is invoked when a command is received by this component.
 
- 
- 
- 
Constructor Detail- 
JDefaultComponentHandlerspublic JDefaultComponentHandlers(akka.actor.typed.javadsl.ActorContext<TopLevelActorMessage> ctx, JCswContext cswCtx) 
 
- 
 - 
Method Detail- 
initializepublic void initialize() The initialize handler is invoked when the component is created. The component can initialize state such as configuration to be fetched from configuration service, location of components or services to be fetched from location service etc. These vary from component to component.- Specified by:
- initializein class- csw.framework.scaladsl.ComponentHandlers
 
 - 
onDiagnosticModepublic void onDiagnosticMode(UTCTime startTime, java.lang.String hint) On receiving a diagnostic data command, the component goes into a diagnostic data mode based on hint at the specified startTime. Validation of supported hints need to be handled by the component writer.- Specified by:
- onDiagnosticModein class- csw.framework.scaladsl.ComponentHandlers
- Parameters:
- startTime- represents the time at which the diagnostic mode actions will take effect
- hint- represents supported diagnostic data mode for a component
 
 - 
onGoOfflinepublic void onGoOffline() A component can be notified to run in offline mode in case it is not in use. The component can change its behavior if needed as a part of this handler.- Specified by:
- onGoOfflinein class- csw.framework.scaladsl.ComponentHandlers
 
 - 
onGoOnlinepublic void onGoOnline() A component can be notified to run in online mode again in case it was put to run in offline mode. The component can change its behavior if needed as a part of this handler.- Specified by:
- onGoOnlinein class- csw.framework.scaladsl.ComponentHandlers
 
 - 
onLocationTrackingEventpublic void onLocationTrackingEvent(TrackingEvent trackingEvent) The onLocationTrackingEvent handler can be used to take action on the TrackingEvent for a particular connection. This event could be for the connections in ComponentInfo tracked automatically or for the connections tracked explicitly using trackConnection method.- Specified by:
- onLocationTrackingEventin class- csw.framework.scaladsl.ComponentHandlers
- Parameters:
- trackingEvent- represents a LocationUpdated or LocationRemoved event received for a tracked connection
 
 - 
onOnewaypublic void onOneway(Id runId, ControlCommand controlCommand) On receiving a command as Oneway, the onOneway handler is invoked for a component only if the validateCommand handler returns Accepted. In case a command is received as a oneway, command response should not be provided to the sender.- Specified by:
- onOnewayin class- csw.framework.scaladsl.ComponentHandlers
- Parameters:
- runId- Run ID for command tracking
- controlCommand- represents a command received e.g. Setup, Observe or wait
 
 - 
onOperationsModepublic void onOperationsMode() On receiving a operations mode command, the current diagnostic data mode is halted.- Specified by:
- onOperationsModein class- csw.framework.scaladsl.ComponentHandlers
 
 - 
onShutdownpublic void onShutdown() The onShutdown handler can be used for carrying out the tasks which will allow the component to shutdown gracefully- Specified by:
- onShutdownin class- csw.framework.scaladsl.ComponentHandlers
 
 - 
onSubmitpublic CommandResponse.SubmitResponse onSubmit(Id runId, ControlCommand controlCommand) On receiving a command as Submit, the onSubmit handler is invoked for a component only if the validateCommand handler returns Accepted. In case a command is received as a submit, command response should be updated in the CommandResponseManager. CommandResponseManager is an actor whose reference commandResponseManager is available in the ComponentHandlers.- Specified by:
- onSubmitin class- csw.framework.scaladsl.ComponentHandlers
- Parameters:
- runId- Run ID for command tracking
- controlCommand- represents a command received e.g. Setup, Observe or wait
- Returns:
- response for command submission
 
 - 
validateCommandpublic CommandResponse.ValidateCommandResponse validateCommand(Id runId, ControlCommand controlCommand) The validateCommand is invoked when a command is received by this component. The component is required to validate the ControlCommand received and return a validation result as Accepted or Invalid.- Specified by:
- validateCommandin class- csw.framework.scaladsl.ComponentHandlers
- Parameters:
- runId- Run ID for command tracking
- controlCommand- represents a command received e.g. Setup, Observe or wait
- Returns:
- a CommandResponse after validation
 
 
- 
 
-