Class Helper


  • public abstract class Helper
    extends java.lang.Object
    Helper for testability.
    • Constructor Summary

      Constructors 
      Constructor Description
      Helper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static AdaptrisMessage build​(io.nats.client.Message nats, AdaptrisMessageFactory mf)
      Create an AdaptrisMessage from the incoming Message.
      static void closeDispatcher​(io.nats.client.Connection c, io.nats.client.Dispatcher d)  
      static void closeDispatchers​(io.nats.client.Connection conn, java.util.Collection<io.nats.client.Dispatcher> dispatchers)  
      static void closeQuietly​(java.lang.AutoCloseable c)  
      • Methods inherited from class java.lang.Object

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

      • Helper

        public Helper()
    • Method Detail

      • build

        public static AdaptrisMessage build​(io.nats.client.Message nats,
                                            AdaptrisMessageFactory mf)
        Create an AdaptrisMessage from the incoming Message.

        if the corresponding Message#getSID(), Message#getSubject(), Message#getReplyTo() are not blank then they will be added against their respective metadata keys (defined in NatsConstants).

        Parameters:
        nats - the message from the nats server
        mf - the message factory (default factory is used if null)
        Returns:
        the new AdaptrisMessage.
      • closeQuietly

        public static void closeQuietly​(java.lang.AutoCloseable c)
      • closeDispatchers

        public static void closeDispatchers​(io.nats.client.Connection conn,
                                            java.util.Collection<io.nats.client.Dispatcher> dispatchers)
      • closeDispatcher

        public static void closeDispatcher​(io.nats.client.Connection c,
                                           io.nats.client.Dispatcher d)