Search in sources :

Example 1 with LocationAwareCollectorClientImpl

use of org.opennms.netmgt.collection.client.rpc.LocationAwareCollectorClientImpl in project opennms by OpenNMS.

the class CollectorTestUtils method createLocationAwareCollectorClient.

static LocationAwareCollectorClient createLocationAwareCollectorClient() {
    final DefaultServiceCollectorRegistry serviceCollectorRegistry = new DefaultServiceCollectorRegistry();
    final CollectorClientRpcModule collectorClientRpcModule = new CollectorClientRpcModule();
    collectorClientRpcModule.setServiceCollectorRegistry(serviceCollectorRegistry);
    collectorClientRpcModule.setExecutor(Executors.newSingleThreadExecutor());
    final MockRpcClientFactory rpcClientFactory = new MockRpcClientFactory();
    final LocationAwareCollectorClientImpl locationAwareCollectorClient = new LocationAwareCollectorClientImpl(rpcClientFactory);
    locationAwareCollectorClient.setRpcModule(collectorClientRpcModule);
    locationAwareCollectorClient.afterPropertiesSet();
    return locationAwareCollectorClient;
}
Also used : DefaultServiceCollectorRegistry(org.opennms.netmgt.collection.support.DefaultServiceCollectorRegistry) LocationAwareCollectorClientImpl(org.opennms.netmgt.collection.client.rpc.LocationAwareCollectorClientImpl) CollectorClientRpcModule(org.opennms.netmgt.collection.client.rpc.CollectorClientRpcModule) MockRpcClientFactory(org.opennms.core.rpc.mock.MockRpcClientFactory)

Aggregations

MockRpcClientFactory (org.opennms.core.rpc.mock.MockRpcClientFactory)1 CollectorClientRpcModule (org.opennms.netmgt.collection.client.rpc.CollectorClientRpcModule)1 LocationAwareCollectorClientImpl (org.opennms.netmgt.collection.client.rpc.LocationAwareCollectorClientImpl)1 DefaultServiceCollectorRegistry (org.opennms.netmgt.collection.support.DefaultServiceCollectorRegistry)1