Class MemoryTwinSubscriber

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, TwinSubscriber

    public class MemoryTwinSubscriber
    extends java.lang.Object
    implements TwinSubscriber
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      <T> java.io.Closeable subscribe​(java.lang.String key, java.lang.Class<T> clazz, java.util.function.Consumer<T> consumer)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MemoryTwinSubscriber

        public MemoryTwinSubscriber​(MemoryTwinPublisher publisher,
                                    java.lang.String location)
    • Method Detail

      • subscribe

        public <T> java.io.Closeable subscribe​(java.lang.String key,
                                               java.lang.Class<T> clazz,
                                               java.util.function.Consumer<T> consumer)
        Specified by:
        subscribe in interface TwinSubscriber
        Type Parameters:
        T - T is an object type that needs to be replicated from OpenNMS to Minion.
        Parameters:
        key - Unique key for the object.
        clazz - Specific bean class of T to marshal/unmarshal.
        consumer - Consumer of T for subsequent updates to T.
        Returns:
        Closeable to close the subscription of T.
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable