Search in sources :

Example 1 with CacheProvider

use of org.eclipse.hono.cache.CacheProvider in project hono by eclipse.

the class AbstractAdapterConfig method tenantServiceClient.

/**
 * Exposes a client for the <em>Tenant</em> API as a Spring bean.
 *
 * @return The client.
 */
@Bean
@Qualifier(TenantConstants.TENANT_ENDPOINT)
@Scope("prototype")
public HonoClient tenantServiceClient() {
    final HonoClientImpl result = new HonoClientImpl(vertx(), tenantServiceClientConfig());
    final CacheProvider cacheProvider = tenantCacheProvider();
    if (cacheProvider != null) {
        result.setCacheProvider(cacheProvider);
    }
    return result;
}
Also used : HonoClientImpl(org.eclipse.hono.client.impl.HonoClientImpl) CacheProvider(org.eclipse.hono.cache.CacheProvider) SpringCacheProvider(org.eclipse.hono.service.cache.SpringCacheProvider) Scope(org.springframework.context.annotation.Scope) Qualifier(org.springframework.beans.factory.annotation.Qualifier) Bean(org.springframework.context.annotation.Bean)

Example 2 with CacheProvider

use of org.eclipse.hono.cache.CacheProvider in project hono by eclipse.

the class AbstractAdapterConfig method registrationServiceClient.

/**
 * Exposes a client for the <em>Device Registration</em> API as a Spring bean.
 *
 * @return The client.
 */
@Bean
@Qualifier(RegistrationConstants.REGISTRATION_ENDPOINT)
@Scope("prototype")
public HonoClient registrationServiceClient() {
    final HonoClientImpl result = new HonoClientImpl(vertx(), registrationServiceClientConfig());
    final CacheProvider cacheProvider = registrationCacheProvider();
    if (cacheProvider != null) {
        result.setCacheProvider(cacheProvider);
    }
    return result;
}
Also used : HonoClientImpl(org.eclipse.hono.client.impl.HonoClientImpl) CacheProvider(org.eclipse.hono.cache.CacheProvider) SpringCacheProvider(org.eclipse.hono.service.cache.SpringCacheProvider) Scope(org.springframework.context.annotation.Scope) Qualifier(org.springframework.beans.factory.annotation.Qualifier) Bean(org.springframework.context.annotation.Bean)

Aggregations

CacheProvider (org.eclipse.hono.cache.CacheProvider)2 HonoClientImpl (org.eclipse.hono.client.impl.HonoClientImpl)2 SpringCacheProvider (org.eclipse.hono.service.cache.SpringCacheProvider)2 Qualifier (org.springframework.beans.factory.annotation.Qualifier)2 Bean (org.springframework.context.annotation.Bean)2 Scope (org.springframework.context.annotation.Scope)2