JComponentHandlers

csw.framework.javadsl.JComponentHandlers
abstract class JComponentHandlers(ctx: ActorContext[TopLevelActorMessage], cswCtx: JCswContext) extends ComponentHandlers

Base class for component handlers which will be used by the component actor

Value parameters

cswCtx

provides access to csw services e.g. location, event, alarm, etc

ctx

the org.apache.pekko.actor.typed.javadsl.ActorContext under which the actor instance of the component, which use these handlers, is created

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Inherited methods

def trackConnection(connection: Connection): Unit

Track any connection. The handlers for received events are defined in onLocationTrackingEvent() method

Track any connection. The handlers for received events are defined in onLocationTrackingEvent() method

Value parameters

connection

to be tracked for location updates

Attributes

Inherited from:
ComponentHandlers

Inherited and Abstract methods

def initialize(): Unit

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.

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.

Attributes

Returns

when the initialization of component completes

Inherited from:
ComponentHandlers
def onDiagnosticMode(startTime: UTCTime, hint: String): Unit

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.

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.

Value parameters

hint

represents supported diagnostic data mode for a component

startTime

represents the time at which the diagnostic mode actions will take effect

Attributes

Inherited from:
ComponentHandlers
def onGoOffline(): Unit

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.

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.

Attributes

Inherited from:
ComponentHandlers
def onGoOnline(): Unit

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.

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.

Attributes

Inherited from:
ComponentHandlers

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.

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.

Value parameters

trackingEvent

represents a LocationUpdated or LocationRemoved event received for a tracked connection

Attributes

Inherited from:
ComponentHandlers
def onOneway(runId: Id, controlCommand: ControlCommand): Unit

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.

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.

Value parameters

controlCommand

represents a command received e.g. Setup, Observe or wait

Attributes

Inherited from:
ComponentHandlers

On receiving a operations mode command, the current diagnostic data mode is halted.

On receiving a operations mode command, the current diagnostic data mode is halted.

Attributes

Inherited from:
ComponentHandlers
def onShutdown(): Unit

The onShutdown handler can be used for carrying out the tasks which will allow the component to shutdown gracefully

The onShutdown handler can be used for carrying out the tasks which will allow the component to shutdown gracefully

Attributes

Returns

when the shutdown completes for component

Inherited from:
ComponentHandlers
def onSubmit(runId: Id, controlCommand: ControlCommand): SubmitResponse

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.

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.

Value parameters

controlCommand

represents a command received e.g. Setup, Observe or wait

Attributes

Inherited from:
ComponentHandlers

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.

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.

Value parameters

controlCommand

represents a command received e.g. Setup, Observe or wait

Attributes

Returns

a CommandResponse after validation

Inherited from:
ComponentHandlers

Inherited fields

A component can access this flag, which can be used to determine if the component is in the online or offline state.

A component can access this flag, which can be used to determine if the component is in the online or offline state.

Attributes

Inherited from:
ComponentHandlers