Class AmqpConnections
- java.lang.Object
-
- org.objectweb.joram.mom.dest.amqp.AmqpConnections
-
- All Implemented Interfaces:
AmqpConnectionsMBean
public class AmqpConnections extends Object implements AmqpConnectionsMBean
TheAmqpConnectionsservice handles the list of known AMQP servers, in order to keep live connections with them.
-
-
Field Summary
Fields Modifier and Type Field Description private static Loggerlogger(package private) static StringSAVE_FILE_NAMEprivate Map<String,LiveServerConnection>servers
-
Constructor Summary
Constructors Constructor Description AmqpConnections()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.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.voiddeleteServer(String name)Removes the live connection to the specified AMQP server.List<LiveServerConnection>getConnections()Gets the list of currently opened connections.String[]getServerNames()Gets the list of known servers.(package private) voidreadSavedConf()voidstop()
-
-
-
Field Detail
-
logger
private static final Logger logger
-
SAVE_FILE_NAME
static final String SAVE_FILE_NAME
- See Also:
- Constant Field Values
-
servers
private Map<String,LiveServerConnection> servers
-
-
Method Detail
-
readSavedConf
void readSavedConf()
-
addServer
public 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.- Specified by:
addServerin interfaceAmqpConnectionsMBean- Parameters:
name- the name identifying the serverhost- host of the added serverport- port of the added server
-
addServer
public 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.- Specified by:
addServerin interfaceAmqpConnectionsMBean- Parameters:
name- the name identifying the serverhost- host of the added serverport- port of the added serveruser- user namepass- user password
-
deleteServer
public void deleteServer(String name)
Removes the live connection to the specified AMQP server.- Specified by:
deleteServerin interfaceAmqpConnectionsMBean- Parameters:
name- the name identifying the server
-
getServerNames
public String[] getServerNames()
Gets the list of known servers.- Specified by:
getServerNamesin interfaceAmqpConnectionsMBean
-
getConnections
public List<LiveServerConnection> getConnections()
Gets the list of currently opened connections.- Returns:
- the list of usable connections.
-
stop
public void stop()
-
-