abstract class ComponentHandlers extends AnyRef
Base class for component handlers which will be used by the component actor
- Alphabetic
- By Inheritance
- ComponentHandlers
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
ComponentHandlers(ctx: ActorContext[TopLevelActorMessage], componentInfo: ComponentInfo, commandResponseManager: CommandResponseManager, currentStatePublisher: CurrentStatePublisher, locationService: LocationService, eventService: EventService, alarmService: AlarmService, loggerFactory: LoggerFactory)
- ctx
the akka.actor.typed.scaladsl.ActorContext under which the actor instance of the component, which use these handlers, is created
- componentInfo
component related information as described in the configuration file
- commandResponseManager
to manage state of a received Submit command
- currentStatePublisher
the pub sub actor to publish state represented by csw.messages.params.states.CurrentState for this component
- locationService
the single instance of Location service created for a running application
- eventService
the single instance of event service with default publishers and subcribers as well as the capability to create new ones
- loggerFactory
factory to create suitable logger instance
Abstract Value Members
-
abstract
def
initialize(): Future[Unit]
The initialize handler is invoked when the component is created.
The initialize handler is invoked when the component is created. This is different than constructor initialization to allow non-blocking asynchronous operations. 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.
- returns
a future which completes when the initialization of component completes
-
abstract
def
onGoOffline(): Unit
A component can be notified to run in offline mode in case it is not in use.
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.
-
abstract
def
onGoOnline(): Unit
A component can be notified to run in online mode again in case it was put to run in offline mode.
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.
-
abstract
def
onLocationTrackingEvent(trackingEvent: TrackingEvent): Unit
The onLocationTrackingEvent handler can be used to take action on the TrackingEvent for a particular connection.
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.
- trackingEvent
represents a LocationUpdated or LocationRemoved event received for a tracked connection
-
abstract
def
onOneway(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.
- controlCommand
represents a command received e.g. Setup, Observe or wait
-
abstract
def
onShutdown(): Future[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
- returns
a future which completes when the shutdown completes for component
-
abstract
def
onSubmit(controlCommand: ControlCommand): Unit
On receiving a command as Submit, the onSubmit handler is invoked for a component only if the validateCommand handler returns Accepted.
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.
- controlCommand
represents a command received e.g. Setup, Observe or wait
-
abstract
def
validateCommand(controlCommand: ControlCommand): CommandResponse
The validateCommand is invoked when a command is received by this component.
The validateCommand is invoked when a command is received by this component. If a command can be completed immediately, a CommandResponse indicating the final response for the command can be returned. If a command requires time for processing, the component is required to validate the ControlCommand received and return a validation result as Accepted or Invalid.
- controlCommand
represents a command received e.g. Setup, Observe or wait
- returns
a CommandResponse after validation
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
var
isOnline: Boolean
A component can access this flag, which can be used to determine if the component is in the online or offline state.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
trackConnection(connection: Connection): Unit
Track any connection.
Track any connection. The handlers for received events are defined in onLocationTrackingEvent() method
- connection
to be tracked for location updates
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )