LockUnlockUtil

esw.ocs.dsl.script.utils.LockUnlockUtil
class LockUnlockUtil(val source: Prefix)(actorSystem: ActorSystem[Command])

A Util class mainly written to send Lock/Unlock command to a particular HCD/Assembly

Value parameters

actorSystem
  • a Pekko ActorSystem
source
  • represents the prefix of component that is acquiring lock

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def lock(componentRef: ActorRef[ComponentMessage], leaseDuration: Duration)(onLockAboutToExpire: () => CompletionStage[Void], onLockExpired: () => CompletionStage[Void]): CompletionStage[LockingResponse]

Sends an Lock message to the given typed actor ref of the component

Sends an Lock message to the given typed actor ref of the component

Value parameters

componentRef
  • typed actor ref of the component whom to send the Lock message
leaseDuration
  • represents the lease duration of lock acquired
onLockAboutToExpire
  • a callback which is to be triggered when lock is about to expire
onLockExpired
  • a callback which is to be triggered when lock gets expired

Attributes

Returns

the csw.command.client.models.framework.LockingResponse as CompletionStage value

def unlock(componentRef: ActorRef[ComponentMessage]): CompletionStage[LockingResponse]

Sends an Unlock message to the given typed actor ref of the component

Sends an Unlock message to the given typed actor ref of the component

Value parameters

componentRef
  • typed actor ref of the component whom to send the Lock message

Attributes

Returns

the csw.command.client.models.framework.LockingResponse as CompletionStage value

Concrete fields

val source: Prefix

Implicits

Implicits

implicit val timeout: Timeout