trait ILocationService extends AnyRef
A LocationService interface to manage connections and their registrations. All operations are non-blocking.
- Alphabetic
- By Inheritance
- ILocationService
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def asScala: LocationService
Returns the Scala API for this instance of location service
- abstract def find[L <: Location](connection: TypedConnection[L]): CompletableFuture[Optional[L]]
Resolve the location for a connection from the local cache
Resolve the location for a connection from the local cache
- connection
a connection to resolve to with its registered location
- returns
a CompletableFuture which completes with the resolved location if found or Empty otherwise. It can fail with csw.location.api.exceptions.RegistrationListingFailed.
- abstract def list(connectionType: ConnectionType): CompletableFuture[List[Location]]
Filters all locations registered based on a connection type
Filters all locations registered based on a connection type
- connectionType
list components of this
connectionType
- returns
a CompletableFuture which completes with filtered locations or can fail with csw.location.api.exceptions.RegistrationListingFailed
- abstract def list(hostname: String): CompletableFuture[List[Location]]
Filters all locations registered based on a hostname
Filters all locations registered based on a hostname
- hostname
list components running on this
hostname
- returns
a CompletableFuture which completes with filtered locations or can fail with csw.location.api.exceptions.RegistrationListingFailed
- abstract def list(componentType: ComponentType): CompletableFuture[List[Location]]
Filters all locations registered based on a component type
Filters all locations registered based on a component type
- componentType
list components of this
componentType
- returns
a CompletableFuture which completes with filtered locations or can fail with csw.location.api.exceptions.RegistrationListingFailed
- abstract def list: CompletableFuture[List[Location]]
Lists all locations registered
Lists all locations registered
- returns
a CompletableFuture which completes with a List of all registered locations or can fail with csw.location.api.exceptions.RegistrationListingFailed
- abstract def listByPrefix(prefix: String): CompletableFuture[List[Location]]
Filters all locations registered based on a prefix.
Filters all locations registered based on a prefix.
Note that all locations having subsystem prefix that starts with the given prefix value will be listed
- prefix
list components by this
prefix
- returns
a CompletableFuture which completes with filtered locations or can fail with csw.location.api.exceptions.RegistrationListingFailed
- abstract def register(registration: Registration): CompletableFuture[IRegistrationResult]
Registers a connection to location
Registers a connection to location
- registration
the Registration holding connection and it's corresponding location to register with
LocationService
- returns
a CompletableFuture which completes with Registration result or can fail with csw.location.api.exceptions.RegistrationFailed or csw.location.api.exceptions.OtherLocationIsRegistered
- abstract def resolve[L <: Location](connection: TypedConnection[L], within: Duration): CompletableFuture[Optional[L]]
Resolves the location based on the given connection
Resolves the location based on the given connection
- L
the concrete Location type returned once the connection is resolved
- connection
a connection to resolve to with its registered location
- within
the time for which a connection is looked-up within
LocationService
- returns
a CompletableFuture which completes with the resolved location if found or None otherwise. It can fail with csw.location.api.exceptions.RegistrationListingFailed.
- abstract def subscribe(connection: Connection, consumer: Consumer[TrackingEvent]): Subscription
Subscribe to tracking events for a connection by providing a consumer For each event accept method of consumer interface is invoked.
Subscribe to tracking events for a connection by providing a consumer For each event accept method of consumer interface is invoked. Use this method if you do not want to handle materialization and happy with a side-effecting callback instead
Note that callbacks are not thread-safe on the JVM. If you are doing side effects/mutations inside the callback, you should ensure that it is done in a thread-safe way inside an actor.
- connection
the
connection
that is to be tracked- consumer
the
Consumer
function that consumesTrakingEvent
- returns
a killswitch which can be shutdown to unsubscribe the consumer
- abstract def track(connection: Connection): Source[TrackingEvent, Subscription]
Tracks the connection and send events for modification or removal of its location
Tracks the connection and send events for modification or removal of its location
- connection
the
connection
that is to be tracked- returns
A stream that emits events related to the connection. It can be cancelled using KillSwitch. This will stop giving events for earlier tracked connection
- abstract def unregister(connection: Connection): CompletableFuture[Done]
Unregisters the connection
Unregisters the connection
Note that this method is idempotent, which means multiple calls to unregister the same connection will be no-op once successfully unregistered from location service
- connection
an already registered connection
- returns
a CompletableFuture which completes after un-registration happens successfully and fails otherwise with csw.location.api.exceptions.UnregistrationFailed
- abstract def unregisterAll(): CompletableFuture[Done]
Unregisters all connections registered
Unregisters all connections registered
Note that it is highly recommended to use this method for testing purpose only
- returns
a CompletableFuture which completes after all connections are unregistered successfully or fails otherwise with csw.location.api.exceptions.RegistrationListingFailed
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[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])