Class AmqpConnectionService
- java.lang.Object
-
- org.objectweb.joram.mom.dest.amqp.AmqpConnectionService
-
public class AmqpConnectionService extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classAmqpConnectionService.MyURLStreamHandler
-
Field Summary
Fields Modifier and Type Field Description private static booleanDEBUGprivate static Loggerloggerprivate static AmqpConnectionssingleton
-
Constructor Summary
Constructors Constructor Description AmqpConnectionService()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddServer(String urls)Adds an AMQP server and starts a live connection with it, accessible via the host and port provided.static voidaddServer(String name, String host, int port)Adds an AMQP server and starts a live connection with it, accessible via the host and port provided.static voidaddServer(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.static List<String>convertToList(String value)static voiddeleteServer(String names)Removes the live connection to the specified AMQP server.static AmqpConnectionsgetInstance()static String[]getServerNames()Gets the list of known servers.static voidinit(String args, boolean firstTime)Initializes the service.static voidstopService()Stops all connections to AMQP servers.
-
-
-
Field Detail
-
logger
private static final Logger logger
-
DEBUG
private static final boolean DEBUG
-
singleton
private static AmqpConnections singleton
-
-
Method Detail
-
getInstance
public static AmqpConnections getInstance()
-
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 serverhost- host of the added serverport- 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 serverhost- host of the added serverport- port of the added serveruser- user namepass- 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.
-
-