Package org.opennms.core.ipc.sink.mock
Class MockSinkModule<S extends Message,T extends Message>
- java.lang.Object
-
- org.opennms.core.ipc.sink.mock.MockSinkModule<S,T>
-
- All Implemented Interfaces:
SinkModule<S,T>
public class MockSinkModule<S extends Message,T extends Message> extends java.lang.Object implements SinkModule<S,T>
-
-
Field Summary
-
Fields inherited from interface org.opennms.core.ipc.sink.api.SinkModule
HEARTBEAT_MODULE_ID
-
-
Constructor Summary
Constructors Constructor Description MockSinkModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AggregationPolicy<S,T,?>
getAggregationPolicy()
Defines how messages should be combined, and when they should be "released".AsyncPolicy
getAsyncPolicy()
Defines how messages should be asynchronously dispatched.java.lang.String
getId()
Globally unique identifier.int
getNumConsumerThreads()
The number of threads used to consume from the broker.byte[]
marshal(T message)
Marshals the aggregated message to a byte array.byte[]
marshalSingleMessage(S message)
Marshals single message to a byte array.T
unmarshal(byte[] bytes)
Unmarshals the aggregated message from a byte array.S
unmarshalSingleMessage(byte[] message)
Unmarshals single message from a byte array.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opennms.core.ipc.sink.api.SinkModule
getRoutingKey
-
-
-
-
Method Detail
-
getId
public java.lang.String getId()
Description copied from interface:SinkModule
Globally unique identifier. Used in the JMS queue name in the Camel implementation.
-
getNumConsumerThreads
public int getNumConsumerThreads()
Description copied from interface:SinkModule
The number of threads used to consume from the broker.- Specified by:
getNumConsumerThreads
in interfaceSinkModule<S extends Message,T extends Message>
-
marshal
public byte[] marshal(T message)
Description copied from interface:SinkModule
Marshals the aggregated message to a byte array.
-
unmarshal
public T unmarshal(byte[] bytes)
Description copied from interface:SinkModule
Unmarshals the aggregated message from a byte array.
-
marshalSingleMessage
public byte[] marshalSingleMessage(S message)
Description copied from interface:SinkModule
Marshals single message to a byte array.- Specified by:
marshalSingleMessage
in interfaceSinkModule<S extends Message,T extends Message>
-
unmarshalSingleMessage
public S unmarshalSingleMessage(byte[] message)
Description copied from interface:SinkModule
Unmarshals single message from a byte array.- Specified by:
unmarshalSingleMessage
in interfaceSinkModule<S extends Message,T extends Message>
-
getAggregationPolicy
public AggregationPolicy<S,T,?> getAggregationPolicy()
Description copied from interface:SinkModule
Defines how messages should be combined, and when they should be "released". Modules that do not wish to use aggregation can returnnull
.- Specified by:
getAggregationPolicy
in interfaceSinkModule<S extends Message,T extends Message>
- Returns:
- the
AggregationPolicy
used to combine messages, ornull
if the messages should not be combined.
-
getAsyncPolicy
public AsyncPolicy getAsyncPolicy()
Description copied from interface:SinkModule
Defines how messages should be asynchronously dispatched.- Specified by:
getAsyncPolicy
in interfaceSinkModule<S extends Message,T extends Message>
- Returns:
- the
AsyncPolicy
used when asynchronously dispatching messages for this module.
-
-