Class AbstractTwinSubscriber

    • Field Detail

      • TAG_TWIN_RPC_REQUEST

        protected static final java.lang.String TAG_TWIN_RPC_REQUEST
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractTwinSubscriber

        protected AbstractTwinSubscriber​(Identity identity,
                                         TracerRegistry tracerRegistry)
    • Method Detail

      • sendRpcRequest

        protected abstract void sendRpcRequest​(TwinRequest twinRequest)
      • 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.
      • accept

        protected void accept​(TwinUpdate twinUpdate)
      • mapTwinResponseToProto

        protected TwinUpdate mapTwinResponseToProto​(byte[] responseBytes)
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • getTracer

        public io.opentracing.Tracer getTracer()
      • getIdentity

        public Identity getIdentity()