public interface ILocationService
Modifier and Type | Method and Description |
---|---|
csw.services.location.scaladsl.LocationService |
asScala()
Returns the Scala API for this instance of location service
|
<L extends Location> |
find(TypedConnection<L> connection)
Resolve the location for a connection from the local cache
|
java.util.concurrent.CompletableFuture<java.util.List<Location>> |
list()
Lists all locations registered
|
java.util.concurrent.CompletableFuture<java.util.List<Location>> |
list(ComponentType componentType)
Filters all locations registered based on a component type
|
java.util.concurrent.CompletableFuture<java.util.List<Location>> |
list(ConnectionType connectionType)
Filters all locations registered based on a connection type
|
java.util.concurrent.CompletableFuture<java.util.List<Location>> |
list(java.lang.String hostname)
Filters all locations registered based on a hostname
|
java.util.concurrent.CompletableFuture<java.util.List<AkkaLocation>> |
listByPrefix(java.lang.String prefix)
Filters all locations registered based on a prefix.
|
java.util.concurrent.CompletableFuture<IRegistrationResult> |
register(Registration registration)
Registers a connection to location
|
<L extends Location> |
resolve(TypedConnection<L> connection,
java.time.Duration within)
Resolves the location based on the given connection
|
java.util.concurrent.CompletableFuture<akka.Done> |
shutdown(akka.actor.CoordinatedShutdown.Reason reason)
Shuts down the LocationService
|
akka.stream.KillSwitch |
subscribe(Connection connection,
java.util.function.Consumer<TrackingEvent> consumer)
Subscribe to tracking events for a connection by providing a consumer
For each event accept method of consumer interface is invoked.
|
akka.stream.javadsl.Source<TrackingEvent,akka.stream.KillSwitch> |
track(Connection connection)
Tracks the connection and send events for modification or removal of its location
|
java.util.concurrent.CompletableFuture<akka.Done> |
unregister(Connection connection)
Unregisters the connection
|
java.util.concurrent.CompletableFuture<akka.Done> |
unregisterAll()
Unregisters all connections registered
|
csw.services.location.scaladsl.LocationService asScala()
<L extends Location> java.util.concurrent.CompletableFuture<java.util.Optional<L>> find(TypedConnection<L> connection)
connection
- a connection to resolve to with its registered locationRegistrationListingFailed
.java.util.concurrent.CompletableFuture<java.util.List<Location>> list()
RegistrationListingFailed
java.util.concurrent.CompletableFuture<java.util.List<Location>> list(ComponentType componentType)
componentType
- list components of this componentType
RegistrationListingFailed
java.util.concurrent.CompletableFuture<java.util.List<Location>> list(java.lang.String hostname)
hostname
- list components running on this hostname
RegistrationListingFailed
java.util.concurrent.CompletableFuture<java.util.List<Location>> list(ConnectionType connectionType)
connectionType
- list components of this connectionType
RegistrationListingFailed
java.util.concurrent.CompletableFuture<java.util.List<AkkaLocation>> listByPrefix(java.lang.String prefix)
prefix
- list components by this prefix
RegistrationListingFailed
java.util.concurrent.CompletableFuture<IRegistrationResult> register(Registration registration)
registration
- the Registration holding connection and it's corresponding location to register with LocationService
RegistrationFailed
or OtherLocationIsRegistered
<L extends Location> java.util.concurrent.CompletableFuture<java.util.Optional<L>> resolve(TypedConnection<L> connection, java.time.Duration within)
connection
- a connection to resolve to with its registered locationwithin
- the time for which a connection is looked-up within LocationService
RegistrationListingFailed
.java.util.concurrent.CompletableFuture<akka.Done> shutdown(akka.actor.CoordinatedShutdown.Reason reason)
reason
- the reason explaining the shutdownmethod in {@link csw.services.location.commons.CswCluster}
akka.stream.KillSwitch subscribe(Connection connection, java.util.function.Consumer<TrackingEvent> consumer)
connection
- the connection
that is to be trackedconsumer
- the Consumer
function that consumes TrakingEvent
akka.stream.javadsl.Source<TrackingEvent,akka.stream.KillSwitch> track(Connection connection)
connection
- the connection
that is to be trackedjava.util.concurrent.CompletableFuture<akka.Done> unregister(Connection connection)
connection
- an already registered connectionUnregistrationFailed
java.util.concurrent.CompletableFuture<akka.Done> unregisterAll()
RegistrationListingFailed