Packages

t

csw.location.api.scaladsl

LocationService

trait LocationService extends AnyRef

A LocationService interface to manage registrations. All operations are non-blocking.

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. LocationService
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def find[L <: Location](connection: TypedConnection[L]): Future[Option[L]]

    Resolves the location for a connection from the local cache

    Resolves the location for a connection from the local cache

    connection

    a connection to resolve to with its registered location

    returns

    a future which completes with the resolved location if found or None otherwise. It can fail with csw.location.api.exceptions.RegistrationListingFailed.

  2. abstract def list(connectionType: ConnectionType): Future[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 future which completes with filtered locations or can fail with csw.location.api.exceptions.RegistrationListingFailed

  3. abstract def list(hostname: String): Future[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 future which completes with filtered locations or can fail with csw.location.api.exceptions.RegistrationListingFailed

  4. abstract def list(componentType: ComponentType): Future[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 future which completes with filtered locations or can fail with csw.location.api.exceptions.RegistrationListingFailed

  5. abstract def list: Future[List[Location]]

    Lists all locations registered

    Lists all locations registered

    returns

    a future which completes with a List of all registered locations or can fail with csw.location.api.exceptions.RegistrationListingFailed

  6. abstract def listByPrefix(prefix: String): Future[List[Location]]

    Filters all locations registered based on a prefix.

    Filters all locations registered based on a prefix.

    prefix

    list components by this prefix

    returns

    a future which completes with filtered locations or can fail with csw.location.api.exceptions.RegistrationListingFailed

    Note

    all locations having subsystem prefix that starts with the given prefix value will be listed.

  7. abstract def register(registration: Registration): Future[RegistrationResult]

    Registers a connection -> location in cluster

    Registers a connection -> location in cluster

    registration

    the Registration holding connection and it's corresponding location to register with LocationService

    returns

    a future which completes with Registration result or can fail with csw.location.api.exceptions.RegistrationFailed or csw.location.api.exceptions.OtherLocationIsRegistered

  8. abstract def resolve[L <: Location](connection: TypedConnection[L], within: FiniteDuration): Future[Option[L]]

    Resolves the location for a connection from the local cache, if not found waits for the event to arrive within specified time limit.

    Resolves the location for a connection from the local cache, if not found waits for the event to arrive within specified time limit. Returns None if both fail.

    L

    the concrete Location type returned once the connection is resolved

    connection

    a connection to resolve to with its registered location

    within

    max wait time for event to arrive

    returns

    a future which completes with the resolved location if found or None otherwise. It can fail with csw.location.api.exceptions.RegistrationListingFailed.

  9. abstract def subscribe(connection: Connection, callback: (TrackingEvent) => Unit): Subscription

    Subscribe to tracking events for a connection by providing a callback For each event the callback is invoked.

    Subscribe to tracking events for a connection by providing a callback For each event the callback is invoked. Use this method if you do not want to handle materialization and happy with a side-effecting callback instead.

    connection

    the connection that is to be tracked

    callback

    the callback function of type TrackingEvent => Unit which gets executed on receiving any TrackingEvent

    returns

    a killswitch which can be shutdown to unsubscribe the consumer

    Note

    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.

  10. 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

  11. abstract def unregister(connection: Connection): Future[Done]

    Unregisters the connection

    Unregisters the connection

    connection

    an already registered connection

    returns

    a future which completes after un-registration happens successfully and fails otherwise with csw.location.api.exceptions.UnregistrationFailed

    Note

    this method is idempotent, which means multiple call to unregister the same connection will be no-op once successfully unregistered from location service

  12. abstract def unregisterAll(): Future[Done]

    Unregisters all connections

    Unregisters all connections

    returns

    a future which completes after all connections are unregistered successfully or fails otherwise with csw.location.api.exceptions.RegistrationListingFailed

    Note

    it is highly recommended to use this method for testing purpose only

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  13. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  14. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  15. def toString(): String
    Definition Classes
    AnyRef → Any
  16. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  17. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  18. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped