Search in sources :

Example 6 with HonoClientImpl

use of org.eclipse.hono.client.impl.HonoClientImpl 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 7 with HonoClientImpl

use of org.eclipse.hono.client.impl.HonoClientImpl 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

HonoClientImpl (org.eclipse.hono.client.impl.HonoClientImpl)7 ClientConfigProperties (org.eclipse.hono.config.ClientConfigProperties)5 Future (io.vertx.core.Future)3 Vertx (io.vertx.core.Vertx)3 TestContext (io.vertx.ext.unit.TestContext)3 ProtonClientOptions (io.vertx.proton.ProtonClientOptions)3 MessageSender (org.eclipse.hono.client.MessageSender)3 VertxUnitRunner (io.vertx.ext.unit.junit.VertxUnitRunner)2 Message (org.apache.qpid.proton.message.Message)2 TestSupport (org.eclipse.hono.TestSupport)2 Activity (org.eclipse.hono.auth.Activity)2 Authorities (org.eclipse.hono.auth.Authorities)2 AuthoritiesImpl (org.eclipse.hono.auth.AuthoritiesImpl)2 HonoUser (org.eclipse.hono.auth.HonoUser)2 HonoUserAdapter (org.eclipse.hono.auth.HonoUserAdapter)2 CacheProvider (org.eclipse.hono.cache.CacheProvider)2 HonoSaslAuthenticatorFactory (org.eclipse.hono.service.auth.HonoSaslAuthenticatorFactory)2 SpringCacheProvider (org.eclipse.hono.service.cache.SpringCacheProvider)2 Constants (org.eclipse.hono.util.Constants)2 BeforeClass (org.junit.BeforeClass)2