Class AmqpConnectionService


  • public class AmqpConnectionService
    extends Object
    • Field Detail

      • logger

        private static final Logger logger
      • DEBUG

        private static final boolean DEBUG
    • Constructor Detail

      • AmqpConnectionService

        public AmqpConnectionService()
    • Method Detail

      • addServer

        public static void addServer​(String name,
                                     String host,
                                     int port)
        Adds an AMQP server and starts a live connection with it, accessible via the host and port provided. A server is uniquely identified by the given name. Adding an existing server won't do anything.
        Parameters:
        name - the name identifying the server
        host - host of the added server
        port - port of the added server
      • addServer

        public static void addServer​(String name,
                                     String host,
                                     int port,
                                     String user,
                                     String pass)
        Adds an AMQP server and starts a live connection with it, accessible via the host and port provided. A server is uniquely identified by the given name. Adding an existing server won't do anything.
        Parameters:
        name - the name identifying the server
        host - host of the added server
        port - port of the added server
        user - user name
        pass - user password
      • addServer

        public static void addServer​(String urls)
        Adds an AMQP server and starts a live connection with it, accessible via the host and port provided. A server is uniquely identified by the given name. Adding an existing server won't do anything.
        Parameters:
        urls - the amqp url list identifying the servers separate by space. ex: amqp://user:pass@localhost:5672/?name=serv1 amqp://user:pass@localhost:5678/?name=serv2 serv1 and serv2 are the name identifying the server.
      • deleteServer

        public static void deleteServer​(String names)
        Removes the live connection to the specified AMQP server.
        Parameters:
        names - the name identifying the server or list of name separate by space
      • getServerNames

        public static String[] getServerNames()
        Gets the list of known servers.
      • init

        public static void init​(String args,
                                boolean firstTime)
                         throws Exception
        Initializes the service. Starts a connection with one server.
        Throws:
        Exception
      • stopService

        public static void stopService()
        Stops all connections to AMQP servers.