/** * Gets configuration information for a tenant. * <p> * This default implementation simply returns the result of * {@link #get(String)}. * * @param tenantId The id of the tenant to retrieve details for. * @param context The currently active OpenTracing span. An implementation * should use this as the parent for any span it creates for tracing * the execution of this operation. * @return A future indicating the result of the operation. * <ul> * <li>The future will succeed if a response with status 200 has been received from the * tenant service. The JSON object will then contain values as defined in * <a href="https://www.eclipse.org/hono/api/tenant-api/#get-tenant-information"> * Get Tenant Information</a>.</li> * <li>Otherwise, the future will fail with a {@link ServiceInvocationException} containing * the (error) status code returned by the service.</li> * </ul> * @throws NullPointerException if tenant ID is {@code null}. */ default Future<TenantObject> get(final String tenantId, final SpanContext context) { return get(tenantId); }
return get(subjectDn);
/** * Gets configuration information for a tenant. * <p> * The returned JSON object contains information as defined by Hono's * <a href="https://www.eclipse.org/hono/api/tenant-api/#response-payload">Tenant API</a>. * * @param tenantId The tenant to retrieve information for. * @return A future indicating the outcome of the operation. * <p> * The future will fail if the information cannot be retrieved. The cause will be a * {@link ServiceInvocationException} containing a corresponding error code. * <p> * Otherwise the future will contain the configuration information. * @throws NullPointerException if tenant ID is {@code null}. * @deprecated Use {@link #getTenantConfiguration(String, SpanContext)} instead. */ @Deprecated protected final Future<TenantObject> getTenantConfiguration(final String tenantId) { Objects.requireNonNull(tenantId); return getTenantClient().compose(client -> client.get(tenantId)); }
/** * Gets configuration information for a tenant. * <p> * The returned JSON object contains information as defined by Hono's * <a href="https://www.eclipse.org/hono/api/tenant-api/#response-payload">Tenant API</a>. * * @param tenantId The tenant to retrieve information for. * @param context The currently active OpenTracing span that is used to * trace the retrieval of the tenant configuration. * @return A future indicating the outcome of the operation. * <p> * The future will fail if the information cannot be retrieved. The cause will be a * {@link ServiceInvocationException} containing a corresponding error code. * <p> * Otherwise the future will contain the configuration information. * @throws NullPointerException if tenant ID is {@code null}. */ protected final Future<TenantObject> getTenantConfiguration(final String tenantId, final SpanContext context) { Objects.requireNonNull(tenantId); return getTenantClient().compose(client -> client.get(tenantId, context)); }
/** * Gets configuration information for a tenant. * <p> * The returned JSON object contains information as defined by Hono's * <a href="https://www.eclipse.org/hono/api/tenant-api/#response-payload">Tenant API</a>. * * @param tenantId The tenant to retrieve information for. * @return A future indicating the outcome of the operation. * <p> * The future will fail if the information cannot be retrieved. The cause will be a * {@link ServiceInvocationException} containing a corresponding error code. * <p> * Otherwise the future will contain the configuration information. * @throws NullPointerException if tenant ID is {@code null}. * @deprecated Use {@link #getTenantConfiguration(String, SpanContext)} instead. */ @Deprecated protected final Future<TenantObject> getTenantConfiguration(final String tenantId) { Objects.requireNonNull(tenantId); return getTenantClient().compose(client -> client.get(tenantId)); }
private Future<TenantObject> getTenant(final X509Certificate clientCert, final Span span) { return tenantServiceClient.getOrCreateTenantClient().compose(tenantClient -> tenantClient.get(clientCert.getIssuerX500Principal(), span.context())); }
/** * Gets configuration information for a tenant. * <p> * The returned JSON object contains information as defined by Hono's * <a href="https://www.eclipse.org/hono/api/tenant-api/#response-payload">Tenant API</a>. * * @param tenantId The tenant to retrieve information for. * @param context The currently active OpenTracing span that is used to * trace the retrieval of the tenant configuration. * @return A future indicating the outcome of the operation. * <p> * The future will fail if the information cannot be retrieved. The cause will be a * {@link ServiceInvocationException} containing a corresponding error code. * <p> * Otherwise the future will contain the configuration information. * @throws NullPointerException if tenant ID is {@code null}. */ protected final Future<TenantObject> getTenantConfiguration(final String tenantId, final SpanContext context) { Objects.requireNonNull(tenantId); return getTenantClient().compose(client -> client.get(tenantId, context)); }
private Future<TenantObject> getTenant(final X509Certificate clientCert, final Span span) { return tenantServiceClient.getOrCreateTenantClient().compose(tenantClient -> tenantClient.get(clientCert.getIssuerX500Principal(), span.context())); }
private Future<TenantObject> getTenantObject(final String tenantId) { return tenantServiceClient.getOrCreateTenantClient() .compose(tenantClient -> tenantClient.get(tenantId, currentSpan.context())); }
private Future<TenantObject> getTenantObject(final X500Principal issuerDn) { return tenantServiceClient.getOrCreateTenantClient() .compose(tenantClient -> tenantClient.get(issuerDn, currentSpan.context())); }