Search in sources :

Example 1 with MinionIdentity

use of org.opennms.minion.core.api.MinionIdentity in project opennms by OpenNMS.

the class SyslogdReceiverJavaNetBlueprintIT method addServicesOnStartup.

@SuppressWarnings("rawtypes")
@Override
protected void addServicesOnStartup(Map<String, KeyValueHolder<Object, Dictionary>> services) {
    // Register any mock OSGi services here
    final MessageDispatcherFactory messageProducerFactory = mock(MessageDispatcherFactory.class);
    final MinionIdentity minionIdentity = mock(MinionIdentity.class);
    services.put(MessageDispatcherFactory.class.getName(), new KeyValueHolder<Object, Dictionary>(messageProducerFactory, new Properties()));
    services.put(MinionIdentity.class.getName(), new KeyValueHolder<Object, Dictionary>(minionIdentity, new Properties()));
}
Also used : Dictionary(java.util.Dictionary) MinionIdentity(org.opennms.minion.core.api.MinionIdentity) Properties(java.util.Properties) MessageDispatcherFactory(org.opennms.core.ipc.sink.api.MessageDispatcherFactory)

Example 2 with MinionIdentity

use of org.opennms.minion.core.api.MinionIdentity in project opennms by OpenNMS.

the class LocationAwarePingClientIT method addServicesOnStartup.

@SuppressWarnings("rawtypes")
@Override
protected void addServicesOnStartup(Map<String, KeyValueHolder<Object, Dictionary>> services) {
    services.put(MinionIdentity.class.getName(), new KeyValueHolder<>(new MinionIdentity() {

        @Override
        public String getId() {
            return "0";
        }

        @Override
        public String getLocation() {
            return REMOTE_LOCATION_NAME;
        }
    }, new Properties()));
    Properties props = new Properties();
    props.setProperty("alias", "opennms.broker");
    services.put(Component.class.getName(), new KeyValueHolder<>(queuingservice, props));
}
Also used : MinionIdentity(org.opennms.minion.core.api.MinionIdentity) Properties(java.util.Properties) Component(org.apache.camel.Component)

Example 3 with MinionIdentity

use of org.opennms.minion.core.api.MinionIdentity in project opennms by OpenNMS.

the class LocationAwarePingSweepClientIT method addServicesOnStartup.

@SuppressWarnings("rawtypes")
@Override
protected void addServicesOnStartup(Map<String, KeyValueHolder<Object, Dictionary>> services) {
    services.put(MinionIdentity.class.getName(), new KeyValueHolder<>(new MinionIdentity() {

        @Override
        public String getId() {
            return "0";
        }

        @Override
        public String getLocation() {
            return REMOTE_LOCATION_NAME;
        }
    }, new Properties()));
    Properties props = new Properties();
    props.setProperty("alias", "opennms.broker");
    services.put(Component.class.getName(), new KeyValueHolder<>(queuingservice, props));
}
Also used : MinionIdentity(org.opennms.minion.core.api.MinionIdentity) Properties(java.util.Properties) Component(org.apache.camel.Component)

Example 4 with MinionIdentity

use of org.opennms.minion.core.api.MinionIdentity in project opennms by OpenNMS.

the class LocationAwareDetectorClientIT method addServicesOnStartup.

@SuppressWarnings("rawtypes")
@Override
protected void addServicesOnStartup(Map<String, KeyValueHolder<Object, Dictionary>> services) {
    services.put(MinionIdentity.class.getName(), new KeyValueHolder<Object, Dictionary>(new MinionIdentity() {

        @Override
        public String getId() {
            return "0";
        }

        @Override
        public String getLocation() {
            return REMOTE_LOCATION_NAME;
        }
    }, new Properties()));
    Properties props = new Properties();
    props.setProperty("alias", "opennms.broker");
    services.put(Component.class.getName(), new KeyValueHolder<Object, Dictionary>(queuingservice, props));
    services.put(ServiceDetectorRegistry.class.getName(), new KeyValueHolder<Object, Dictionary>(serviceDetectorRegistry, new Properties()));
}
Also used : Dictionary(java.util.Dictionary) ServiceDetectorRegistry(org.opennms.netmgt.provision.detector.registry.api.ServiceDetectorRegistry) MinionIdentity(org.opennms.minion.core.api.MinionIdentity) Properties(java.util.Properties) Component(org.apache.camel.Component)

Example 5 with MinionIdentity

use of org.opennms.minion.core.api.MinionIdentity in project opennms by OpenNMS.

the class SyslogdReceiverCamelNettyBlueprintIT method addServicesOnStartup.

@SuppressWarnings("rawtypes")
@Override
protected void addServicesOnStartup(Map<String, KeyValueHolder<Object, Dictionary>> services) {
    // Register any mock OSGi services here
    final MessageDispatcherFactory messageProducerFactory = mock(MessageDispatcherFactory.class);
    final MinionIdentity minionIdentity = mock(MinionIdentity.class);
    services.put(MessageDispatcherFactory.class.getName(), new KeyValueHolder<Object, Dictionary>(messageProducerFactory, new Properties()));
    services.put(MinionIdentity.class.getName(), new KeyValueHolder<Object, Dictionary>(minionIdentity, new Properties()));
}
Also used : Dictionary(java.util.Dictionary) MinionIdentity(org.opennms.minion.core.api.MinionIdentity) Properties(java.util.Properties) MessageDispatcherFactory(org.opennms.core.ipc.sink.api.MessageDispatcherFactory)

Aggregations

MinionIdentity (org.opennms.minion.core.api.MinionIdentity)11 Properties (java.util.Properties)9 Dictionary (java.util.Dictionary)7 Component (org.apache.camel.Component)7 CamelContext (org.apache.camel.CamelContext)2 Test (org.junit.Test)2 MessageDispatcherFactory (org.opennms.core.ipc.sink.api.MessageDispatcherFactory)2 EchoRequest (org.opennms.core.rpc.echo.EchoRequest)2 EchoRpcModule (org.opennms.core.rpc.echo.EchoRpcModule)2 ExecutionException (java.util.concurrent.ExecutionException)1 RemoteExecutionException (org.opennms.core.rpc.api.RemoteExecutionException)1 RequestTimedOutException (org.opennms.core.rpc.api.RequestTimedOutException)1 EchoResponse (org.opennms.core.rpc.echo.EchoResponse)1 ServiceDetectorRegistry (org.opennms.netmgt.provision.detector.registry.api.ServiceDetectorRegistry)1