Package io.deephaven.dhservice.client
Class ServiceRegistryServiceGrpcImpl
java.lang.Object
io.deephaven.dhservice.client.ServiceRegistryServiceGrpcImpl
- All Implemented Interfaces:
SafeCloseable,NamedImplementation,AuthenticatedService,ServiceRegistryService,AutoCloseable
Implementation of the
ServiceRegistryService API which sends requests over grpc to a remote server.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.dhservice.client.AuthenticatedService
AuthenticatedService.DefaultImpl -
Field Summary
Fields inherited from interface io.deephaven.registrysupport.routing.ServiceRegistryService
SERVICE_REGISTRY_WRITERS_GROUPS_PROP -
Method Summary
Modifier and TypeMethodDescription@NotNull Stringabout()Information about a ServiceRegistryServer instance.booleanAttempt default authentication if this is not already authenticated.booleanauthenticate(@NotNull String keyFile) Authenticate, or re-authenticate using the given private key file.booleanauthenticate(@NotNull String user, @NotNull String password) Authenticate, or re-authenticate using the given credentials.booleanauthenticate(@NotNull String user, @NotNull String password, @Nullable String operateAsUser) Authenticate, or re-authenticate using the given credentials.voidclose()@NotNull Collection<RoutingEndpointConfig>Returns collection of all the active endpoint configs currently registered in backing store@Nullable RoutingEndpointConfiggetEndpointConfig(@NotNull String processName, @NotNull String endpointId) Returns endpoint config from backing store for the given processName and endpoint identifier, that may optionally be null@NotNull Collection<RoutingEndpointConfig>getEndpointConfigs(@NotNull String processName) Returns collection of active endpoint configs registered in backing store for the process namestatic ServiceRegistryServicemake()Create an instance with the default config.static ServiceRegistryServicemake(@NotNull ClientConnectionConfig configs) Create an instance with the given config.@NotNull DeephavenLeaseregisterEndpointConfig(@NotNull RoutingEndpointConfig config, @Nullable DeephavenLease lease) Stores the given endpoint configuration in backing store.booleanrenewLease(@NotNull DeephavenLease deephavenLease) Renew the lease for the given lease.voidrevokeLease(@NotNull DeephavenLease deephavenLease) Revoke the given deephaven lease.booleansetTokenFactoryFactory(@Nullable TokenFactoryFactory tokenAuthenticationManager) Set the authentication client manager to use for token generation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.illumon.util.type.NamedImplementation
getImplementationName
-
Method Details
-
make
Create an instance with the given config.- Parameters:
configs- use thisClientConnectionConfig- Returns:
- a new instance
-
make
public static ServiceRegistryService make() throws IOException, ClientConnectionConfigProvider.ProviderExceptionCreate an instance with the default config.- Returns:
- a new instance
- Throws:
ClientConnectionConfigProvider.ProviderException- if a parsing exception occurs while processing the configIOException- if an IO exception occurs while loading the config
-
registerEndpointConfig
@NotNull public @NotNull DeephavenLease registerEndpointConfig(@NotNull @NotNull RoutingEndpointConfig config, @Nullable @Nullable DeephavenLease lease) Description copied from interface:ServiceRegistryServiceStores the given endpoint configuration in backing store. Returns theDeephavenLeaseinstance after successfully storing the endpoint config.DeephavenLeasecan be used to schedule lease renewals until it is revoked.- Specified by:
registerEndpointConfigin interfaceServiceRegistryService- Parameters:
config- The endpoint config to storelease- Optional lease instance that will be used to register when present- Returns:
- Returns the
DeephavenLeaseinstance after successfully storing the endpoint config.
-
revokeLease
Description copied from interface:ServiceRegistryServiceRevoke the given deephaven lease. Revoke will delete the stored endpoint configuration from backing store.- Specified by:
revokeLeasein interfaceServiceRegistryService- Parameters:
deephavenLease- the deephaven lease to revoke
-
renewLease
Description copied from interface:ServiceRegistryServiceRenew the lease for the given lease.- Specified by:
renewLeasein interfaceServiceRegistryService- Parameters:
deephavenLease- the deephaven lease to renew- Returns:
- true if lease renewal was successful, false if error is lease is not found. All other errors should result in an unchecked exception.
-
about
Description copied from interface:ServiceRegistryServiceInformation about a ServiceRegistryServer instance. Useful for debugging.- Specified by:
aboutin interfaceServiceRegistryService- Returns:
- a string containing information about the implementing instance
-
getAllEndpointConfigs
Description copied from interface:ServiceRegistryServiceReturns collection of all the active endpoint configs currently registered in backing store- Specified by:
getAllEndpointConfigsin interfaceServiceRegistryService- Returns:
- collection of active endpoint configs in backing store
-
getEndpointConfigs
@NotNull public @NotNull Collection<RoutingEndpointConfig> getEndpointConfigs(@NotNull @NotNull String processName) Description copied from interface:ServiceRegistryServiceReturns collection of active endpoint configs registered in backing store for the process name- Specified by:
getEndpointConfigsin interfaceServiceRegistryService- Parameters:
processName- The name of the process- Returns:
- collection of active endpoint configs for the process name
-
getEndpointConfig
@Nullable public @Nullable RoutingEndpointConfig getEndpointConfig(@NotNull @NotNull String processName, @NotNull @NotNull String endpointId) Description copied from interface:ServiceRegistryServiceReturns endpoint config from backing store for the given processName and endpoint identifier, that may optionally be null- Specified by:
getEndpointConfigin interfaceServiceRegistryService- Parameters:
processName- The name of the processendpointId- The endpoint identifier(e.g. port tag)- Returns:
- The stored endpoint configuration that may optionally be null
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSafeCloseable
-
authenticate
public boolean authenticate()Description copied from interface:AuthenticatedServiceAttempt default authentication if this is not already authenticated.- Specified by:
authenticatein interfaceAuthenticatedService- Returns:
- true if authentication succeeded, else false
-
authenticate
Description copied from interface:AuthenticatedServiceAuthenticate, or re-authenticate using the given private key file.- Specified by:
authenticatein interfaceAuthenticatedService- Returns:
- true if authentication succeeded, else false
-
authenticate
public boolean authenticate(@NotNull @NotNull String user, @NotNull @NotNull String password, @Nullable @Nullable String operateAsUser) Description copied from interface:AuthenticatedServiceAuthenticate, or re-authenticate using the given credentials.- Specified by:
authenticatein interfaceAuthenticatedService- Parameters:
user- user to authenticatepassword- password for authenticationoperateAsUser- optional operate-as user- Returns:
- true if authentication succeeded, else false
-
authenticate
Description copied from interface:AuthenticatedServiceAuthenticate, or re-authenticate using the given credentials.- Specified by:
authenticatein interfaceAuthenticatedService- Parameters:
user- user to authenticatepassword- password for authentication- Returns:
- true if authentication succeeded, else false
-
setTokenFactoryFactory
public boolean setTokenFactoryFactory(@Nullable @Nullable TokenFactoryFactory tokenAuthenticationManager) Description copied from interface:AuthenticatedServiceSet the authentication client manager to use for token generation. If tokenAuthenticationManager is null or is not already authenticated, this call will de-authenticate the connection.- Specified by:
setTokenFactoryFactoryin interfaceAuthenticatedService- Parameters:
tokenAuthenticationManager- the authentication client manager to be used for future calls.- Returns:
- true if authentication succeeded, else false
-
getAuthenticatedUser
- Specified by:
getAuthenticatedUserin interfaceAuthenticatedService
-