Search in sources :

Example 1 with RpcTargetHelper

use of org.opennms.core.rpc.utils.RpcTargetHelper in project opennms by OpenNMS.

the class CollectorTestUtils method createLocationAwareCollectorClient.

public 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.setRpcTargetHelper(new RpcTargetHelper());
    locationAwareCollectorClient.afterPropertiesSet();
    return locationAwareCollectorClient;
}
Also used : DefaultServiceCollectorRegistry(org.opennms.netmgt.collection.support.DefaultServiceCollectorRegistry) LocationAwareCollectorClientImpl(org.opennms.netmgt.collection.client.rpc.LocationAwareCollectorClientImpl) RpcTargetHelper(org.opennms.core.rpc.utils.RpcTargetHelper) CollectorClientRpcModule(org.opennms.netmgt.collection.client.rpc.CollectorClientRpcModule) MockRpcClientFactory(org.opennms.core.rpc.mock.MockRpcClientFactory)

Aggregations

MockRpcClientFactory (org.opennms.core.rpc.mock.MockRpcClientFactory)1 RpcTargetHelper (org.opennms.core.rpc.utils.RpcTargetHelper)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