Thread: [Asterisk-java-cvs] CVS: asterisk-java/src/java/net/sf/asterisk/manager DefaultManagerConnection.jav
Brought to you by:
srt
From: Stefan R. <sr...@us...> - 2005-06-23 22:06:20
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29391/src/java/net/sf/asterisk/manager Modified Files: DefaultManagerConnection.java ManagerConnection.java Log Message: Added isConnected() to ManagerConnection Index: DefaultManagerConnection.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/DefaultManagerConnection.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -p -r1.15 -r1.16 --- DefaultManagerConnection.java 23 Apr 2005 22:56:38 -0000 1.15 +++ DefaultManagerConnection.java 23 Jun 2005 22:06:09 -0000 1.16 @@ -48,7 +48,8 @@ import net.sf.asterisk.util.LogFactory; * Default implemention of the ManagerConnection interface. * * @author srt - * @version $Id$ + * @version $Id: DefaultManagerConnection.java,v 1.15 2005/04/23 22:56:38 srt + * Exp $ */ public class DefaultManagerConnection implements ManagerConnection, Dispatcher { @@ -93,7 +94,8 @@ public class DefaultManagerConnection im this.eventHandlers = new HashSet(); } - public DefaultManagerConnection(String hostname, int port, String username, String password) + public DefaultManagerConnection(String hostname, int port, String username, + String password) { this(); @@ -103,7 +105,8 @@ public class DefaultManagerConnection im setPassword(password); } - protected ManagerReader createReader(Dispatcher dispatcher, AsteriskServer server) + protected ManagerReader createReader(Dispatcher dispatcher, + AsteriskServer server) { return new ManagerReaderImpl(dispatcher, server); } @@ -125,8 +128,8 @@ public class DefaultManagerConnection im } /** - * Sets the port to use to connect to the asterisk server. This is the port specified in - * asterisk's <code>manager.conf</code> file.<br> + * Sets the port to use to connect to the asterisk server. This is the port + * specified in asterisk's <code>manager.conf</code> file.<br> * Default is 5038. * * @param port the port to connect to @@ -137,8 +140,8 @@ public class DefaultManagerConnection im } /** - * Sets the username to use to connect to the asterisk server. This is the username specified in - * asterisk's <code>manager.conf</code> file. + * Sets the username to use to connect to the asterisk server. This is the + * username specified in asterisk's <code>manager.conf</code> file. * * @param username the username to use for login */ @@ -148,8 +151,8 @@ public class DefaultManagerConnection im } /** - * Sets the password to use to connect to the asterisk server. This is the password specified in - * asterisk's <code>manager.conf</code> file. + * Sets the password to use to connect to the asterisk server. This is the + * password specified in asterisk's <code>manager.conf</code> file. * * @param password the password to use for login */ @@ -159,8 +162,9 @@ public class DefaultManagerConnection im } /** - * Sets the time in milli seconds the synchronous method {@link #sendAction(ManagerAction)} will - * wait for a response before throwing a TimeoutException.<br> + * Sets the time in milli seconds the synchronous method + * {@link #sendAction(ManagerAction)} will wait for a response before + * throwing a TimeoutException.<br> * Default is 2000. * * @param defaultTimeout default timeout in milli seconds @@ -171,13 +175,14 @@ public class DefaultManagerConnection im } /** - * Sets the time in milli seconds the synchronous methods {@link #sendAction(ManagerAction)} and - * {@link #sendAction(ManagerAction, long)} will sleep between two checks for the arrival of a - * response. This value should be rather small.<br> + * Sets the time in milli seconds the synchronous methods + * {@link #sendAction(ManagerAction)} and + * {@link #sendAction(ManagerAction, long)} will sleep between two checks + * for the arrival of a response. This value should be rather small.<br> * Default is 50. * - * @param sleepTime time in milli seconds to sleep between two checks for the arrival of a - * responser + * @param sleepTime time in milli seconds to sleep between two checks for + * the arrival of a responser */ public void setSleepTime(long sleepTime) { @@ -185,11 +190,12 @@ public class DefaultManagerConnection im } /** - * Set to <code>true</code> to try reconnecting to ther asterisk serve even if the - * reconnection attempt threw an AuthenticationFailedException.<br> + * Set to <code>true</code> to try reconnecting to ther asterisk serve + * even if the reconnection attempt threw an AuthenticationFailedException.<br> * Default is <code>false</code>. */ - public void setKeepAliveAfterAuthenticationFailure(boolean keepAliveAfterAuthenticationFailure) + public void setKeepAliveAfterAuthenticationFailure( + boolean keepAliveAfterAuthenticationFailure) { this.keepAliveAfterAuthenticationFailure = keepAliveAfterAuthenticationFailure; } @@ -207,16 +213,19 @@ public class DefaultManagerConnection im } /** - * Logs in to the asterisk manager using asterisk's MD5 based challenge/response protocol. The - * login is delayed until the protocol identifier has been received by the reader. - * - * @throws AuthenticationFailedException if the username and/or password are incorrect - * @throws TimeoutException if no response is received within the specified timeout period + * Logs in to the asterisk manager using asterisk's MD5 based + * challenge/response protocol. The login is delayed until the protocol + * identifier has been received by the reader. * + * @throws AuthenticationFailedException if the username and/or password are + * incorrect + * @throws TimeoutException if no response is received within the specified + * timeout period * @see ChallengeAction * @see LoginAction */ - public void login() throws IOException, AuthenticationFailedException, TimeoutException + public void login() throws IOException, AuthenticationFailedException, + TimeoutException { login(defaultTimeout); } @@ -224,22 +233,29 @@ public class DefaultManagerConnection im /** * Does the real login, following the steps outlined below.<br> * <ol> - * <li>Connects to the asterisk server by calling {@link #connect()} if not already connected - * <li>Waits until the protocol identifier is received. This is checked every - * {@link #sleepTime} ms but not longer than timeout ms in total. - * <li>Sends a {@link ChallengeAction} requesting a challenge for authType MD5. - * <li>When the {@link ChallengeResponse} is received a {@link LoginAction} is sent using the - * calculated key (MD5 hash of the password appended to the received challenge). + * <li>Connects to the asterisk server by calling {@link #connect()} if not + * already connected + * <li>Waits until the protocol identifier is received. This is checked + * every {@link #sleepTime} ms but not longer than timeout ms in total. + * <li>Sends a {@link ChallengeAction} requesting a challenge for authType + * MD5. + * <li>When the {@link ChallengeResponse} is received a {@link LoginAction} + * is sent using the calculated key (MD5 hash of the password appended to + * the received challenge). * </ol> * - * @param timeout the maximum time to wait for the protocol identifier (in ms) - * @throws AuthenticationFailedException if username or password are incorrect and the login - * action returns an error or if the MD5 hash cannot be computed. The connection is closed in - * this case. - * @throws TimeoutException if a timeout occurs either while waiting for the protocol identifier - * or when sending the challenge or login action. The connection is closed in this case. + * @param timeout the maximum time to wait for the protocol identifier (in + * ms) + * @throws AuthenticationFailedException if username or password are + * incorrect and the login action returns an error or if the MD5 + * hash cannot be computed. The connection is closed in this + * case. + * @throws TimeoutException if a timeout occurs either while waiting for the + * protocol identifier or when sending the challenge or login + * action. The connection is closed in this case. */ - private void login(long timeout) throws IOException, AuthenticationFailedException, TimeoutException + private void login(long timeout) throws IOException, + AuthenticationFailedException, TimeoutException { long timeSpent; ChallengeAction challengeAction; @@ -264,7 +280,8 @@ public class DefaultManagerConnection im if (timeSpent > timeout) { disconnect(); - throw new TimeoutException("Timeout waiting for protocol identifier"); + throw new TimeoutException( + "Timeout waiting for protocol identifier"); } } catch (InterruptedException e) @@ -298,7 +315,8 @@ public class DefaultManagerConnection im catch (NoSuchAlgorithmException ex) { disconnect(); - throw new AuthenticationFailedException("Unable to create login key using MD5 Message Digest", ex); + throw new AuthenticationFailedException( + "Unable to create login key using MD5 Message Digest", ex); } loginResponse = sendAction(loginAction); @@ -308,7 +326,8 @@ public class DefaultManagerConnection im throw new AuthenticationFailedException(loginResponse.getMessage()); } - // successfully logged in so assure that we keep trying to reconnect when + // successfully logged in so assure that we keep trying to reconnect + // when // disconnected this.keepAlive = true; @@ -317,7 +336,8 @@ public class DefaultManagerConnection im protected synchronized void connect() throws IOException { - logger.info("Connecting to " + asteriskServer.getHostname() + " port " + asteriskServer.getPort()); + logger.info("Connecting to " + asteriskServer.getHostname() + " port " + + asteriskServer.getPort()); if (this.reader == null) { @@ -340,20 +360,21 @@ public class DefaultManagerConnection im protected SocketConnectionFacade createSocket() throws IOException { - return new SocketConnectionFacadeImpl(asteriskServer.getHostname(), asteriskServer.getPort()); + return new SocketConnectionFacadeImpl(asteriskServer.getHostname(), + asteriskServer.getPort()); } /** - * Returns <code>true</code> if there is a socket connection to the asterisk server, - * <code>false</code> otherwise. + * Returns <code>true</code> if there is a socket connection to the + * asterisk server, <code>false</code> otherwise. * - * @return <code>true</code> if there is a socket connection to the asterisk server, - * <code>false</code> otherwise. + * @return <code>true</code> if there is a socket connection to the + * asterisk server, <code>false</code> otherwise. */ - private synchronized boolean isConnected() + public synchronized boolean isConnected() { - // return socket != null && socket.isConnected(); // JDK 1.4 - return socket != null; + return socket != null && socket.isConnected(); // JDK 1.4 + //return socket != null; } /** @@ -392,12 +413,14 @@ public class DefaultManagerConnection im } } - public ManagerResponse sendAction(ManagerAction action) throws IOException, TimeoutException + public ManagerResponse sendAction(ManagerAction action) throws IOException, + TimeoutException { return sendAction(action, defaultTimeout); } - public ManagerResponse sendAction(ManagerAction action, long timeout) throws IOException, TimeoutException + public ManagerResponse sendAction(ManagerAction action, long timeout) + throws IOException, TimeoutException { long timeSpent; ResponseHandlerResult result; @@ -418,7 +441,9 @@ public class DefaultManagerConnection im if (timeSpent > timeout) { - throw new TimeoutException("Timeout waiting for response to " + action.getAction()); + throw new TimeoutException( + "Timeout waiting for response to " + + action.getAction()); } } catch (InterruptedException ex) @@ -429,22 +454,26 @@ public class DefaultManagerConnection im return result.getResponse(); } - public void sendAction(ManagerAction action, ManagerResponseHandler callbackHandler) throws IOException + public void sendAction(ManagerAction action, + ManagerResponseHandler callbackHandler) throws IOException { String internalActionId; if (action == null) { - throw new IllegalArgumentException("Unable to send action: action is null."); + throw new IllegalArgumentException( + "Unable to send action: action is null."); } if (!isConnected()) { - throw new IllegalStateException("Unable to send " + action.getAction() + " action: not connected."); + throw new IllegalStateException("Unable to send " + + action.getAction() + " action: not connected."); } internalActionId = createInternalActionId(); - action.setActionId(Util.addInternalActionId(action.getActionId(), internalActionId)); + action.setActionId(Util.addInternalActionId(action.getActionId(), + internalActionId)); if (callbackHandler != null) { @@ -458,8 +487,8 @@ public class DefaultManagerConnection im } /** - * Creates a new unique internal action id based on the hash code of this connection and a - * sequence. + * Creates a new unique internal action id based on the hash code of this + * connection and a sequence. */ private String createInternalActionId() { @@ -497,14 +526,19 @@ public class DefaultManagerConnection im return this.protocolIdentifier; } + public AsteriskServer getAsteriskServer() + { + return asteriskServer; + } + /* Callbacks for ManagerReaderImpl */ /** - * This method is called by the reader whenever a {@link ManagerResponse} is received. The - * response is dispatched to the associated {@link ManagerResponseHandler}. + * This method is called by the reader whenever a {@link ManagerResponse} is + * received. The response is dispatched to the associated + * {@link ManagerResponseHandler}. * * @param response the resonse received by the reader - * * @see ManagerReader */ public void dispatchResponse(ManagerResponse response) @@ -529,27 +563,32 @@ public class DefaultManagerConnection im response.setActionId(Util.stripInternalActionId(actionId)); } - logger.debug("Dispatching response with internalActionId '" + internalActionId + "':\n" + response); + logger.debug("Dispatching response with internalActionId '" + + internalActionId + "':\n" + response); if (internalActionId != null) { synchronized (this.responseHandlers) { - responseHandler = (ManagerResponseHandler) this.responseHandlers.get(internalActionId); + responseHandler = (ManagerResponseHandler) this.responseHandlers + .get(internalActionId); if (responseHandler != null) { this.responseHandlers.remove(internalActionId); } else { - logger.warn("No response handler registered for internalActionId '" + internalActionId + "'"); + logger + .warn("No response handler registered for internalActionId '" + + internalActionId + "'"); } } } else { - logger.error("Unable to retrieve internalActionId from response: asterisk sent actionId '" + actionId - + "':\n" + response); + logger + .error("Unable to retrieve internalActionId from response: asterisk sent actionId '" + + actionId + "':\n" + response); } if (responseHandler != null) @@ -570,11 +609,10 @@ public class DefaultManagerConnection im } /** - * This method is called by the reader whenever a ManagerEvent is received. The event is - * dispatched to all registered ManagerEventHandlers. + * This method is called by the reader whenever a ManagerEvent is received. + * The event is dispatched to all registered ManagerEventHandlers. * * @param event the event received by the reader - * * @see #addEventHandler(ManagerEventHandler) * @see #removeEventHandler(ManagerEventHandler) * @see ManagerReader @@ -610,7 +648,8 @@ public class DefaultManagerConnection im if (event instanceof ConnectEvent) { - setProtocolIdentifier(((ConnectEvent) event).getProtocolIdentifier()); + setProtocolIdentifier(((ConnectEvent) event) + .getProtocolIdentifier()); } if (event instanceof DisconnectEvent) { @@ -619,10 +658,12 @@ public class DefaultManagerConnection im } /** - * This method is called when a {@link ConnectEvent} is received from the reader. Having - * received a correct protocol identifier is the precodition for logging in. + * This method is called when a {@link ConnectEvent} is received from the + * reader. Having received a correct protocol identifier is the precodition + * for logging in. * - * @param protocolIdentifier the protocol version used by the asterisk server. + * @param protocolIdentifier the protocol version used by the asterisk + * server. */ private void setProtocolIdentifier(final String protocolIdentifier) { @@ -630,9 +671,11 @@ public class DefaultManagerConnection im if (!"Asterisk Call Manager/1.0".equals(protocolIdentifier)) { - logger.warn("Unsupported protocol version '" + protocolIdentifier - + "'. This library has only been tested with version 1.0 of the asterisk " - + "call manager protocol. Use at your own risk!"); + logger + .warn("Unsupported protocol version '" + + protocolIdentifier + + "'. This library has only been tested with version 1.0 of the asterisk " + + "call manager protocol. Use at your own risk!"); } this.protocolIdentifier = protocolIdentifier; @@ -640,11 +683,14 @@ public class DefaultManagerConnection im /** * Reconnects to the asterisk server when the connection is lost.<br> - * While keepAlive is <code>true</code> we will try to reconnect. Reconnection attempts will - * be stopped when the {@link #logoff()} method is called or when the login after a successful - * reconnect results in an {@link AuthenticationFailedException} suggesting that the manager - * credentials have changed and keepAliveAfterAuthenticationFailure is not set.<br> - * This method is called when a {@link DisconnectEvent} is received from the reader. + * While keepAlive is <code>true</code> we will try to reconnect. + * Reconnection attempts will be stopped when the {@link #logoff()} method + * is called or when the login after a successful reconnect results in an + * {@link AuthenticationFailedException} suggesting that the manager + * credentials have changed and keepAliveAfterAuthenticationFailure is not + * set.<br> + * This method is called when a {@link DisconnectEvent} is received from the + * reader. */ private void reconnect() { @@ -712,8 +758,10 @@ public class DefaultManagerConnection im } catch (IOException e) { - // server seems to be still down, just continue to attempt reconnection - logger.warn("Exception while trying to reconnect: " + e.getMessage()); + // server seems to be still down, just continue to attempt + // reconnection + logger.warn("Exception while trying to reconnect: " + + e.getMessage()); } numTries++; } @@ -748,10 +796,13 @@ public class DefaultManagerConnection im } /** - * A simple response handler that stores the received response in a ResponseHandlerResult for - * further processing. + * A simple response handler that stores the received response in a + * ResponseHandlerResult for further processing. */ - private class DefaultResponseHandler implements ManagerResponseHandler, Serializable + private class DefaultResponseHandler + implements + ManagerResponseHandler, + Serializable { /** * Serializable version identifier @@ -769,12 +820,4 @@ public class DefaultManagerConnection im this.result.setResponse(response); } } - - /** - * @return Returns the asteriskServer. - */ - public AsteriskServer getAsteriskServer() - { - return asteriskServer; - } } Index: ManagerConnection.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/ManagerConnection.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -p -r1.6 -r1.7 --- ManagerConnection.java 15 Apr 2005 04:46:59 -0000 1.6 +++ ManagerConnection.java 23 Jun 2005 22:06:10 -0000 1.7 @@ -22,11 +22,11 @@ import net.sf.asterisk.manager.action.Ma import net.sf.asterisk.manager.response.ManagerResponse; /** - * The main interface to talk to an Asterisk server via the Asterisk Manager API. A concrete - * implementation of this interface can be obtained from a ManagerConnectionFactory. + * The main interface to talk to an Asterisk server via the Asterisk Manager + * API. A concrete implementation of this interface can be obtained from a + * ManagerConnectionFactory. * * @see net.sf.asterisk.manager.ManagerConnectionFactory - * * @author srt * @version $Id$ */ @@ -34,107 +34,111 @@ public interface ManagerConnection { /** * Registers a new user event type.<br> - * Asterisk allows you to send custom events via the UserEvent application. If you choose to - * send such events you can extend the abstract class UserEvent provide a name for your new - * event and optionally add your own attributes. After registering a user event type - * asterisk-java will handle such events the same way it handles the internal events and inform - * your registered event handlers.<br> + * Asterisk allows you to send custom events via the UserEvent application. + * If you choose to send such events you can extend the abstract class + * UserEvent provide a name for your new event and optionally add your own + * attributes. After registering a user event type asterisk-java will handle + * such events the same way it handles the internal events and inform your + * registered event handlers.<br> * Note: If you write your own asterisk applications that use asterisk's - * <code>manager_event()</code> function directly and don't use the channel and uniqueid - * attributes provided by UserEvent you can also register events that directly subclass - * ManagerEvent. + * <code>manager_event()</code> function directly and don't use the + * channel and uniqueid attributes provided by UserEvent you can also + * register events that directly subclass ManagerEvent. * * @see net.sf.asterisk.manager.event.UserEvent * @see ManagerEvent - * * @param userEventClass the class of the user event to register. */ void registerUserEventClass(Class userEventClass); /** - * Logs in to the asterisk server with the username and password specified when this connection - * was created. + * Logs in to the asterisk server with the username and password specified + * when this connection was created. * * @throws IOException if the network connection is disrupted. - * @throws AuthenticationFailedException if the username and/or password are incorrect or the - * ChallengeResponse could not be built. - * @throws TimeoutException if no response is received within the default timeout period. If the - * implementation uses challenge/response this can either be a timeout of the ChallengeAction or - * the LoginAction; otherwise it is always a timeout of the LoginAction. - * + * @throws AuthenticationFailedException if the username and/or password are + * incorrect or the ChallengeResponse could not be built. + * @throws TimeoutException if no response is received within the default + * timeout period. If the implementation uses challenge/response + * this can either be a timeout of the ChallengeAction or the + * LoginAction; otherwise it is always a timeout of the + * LoginAction. * @see net.sf.asterisk.manager.action.LoginAction * @see net.sf.asterisk.manager.action.ChallengeAction */ - void login() throws IOException, AuthenticationFailedException, TimeoutException; + void login() throws IOException, AuthenticationFailedException, + TimeoutException; /** * Sends a LogoffAction to the asterisk server and disconnects. * * @throws IOException if the network connection is disrupted. - * @throws TimeoutException if no response to the logoff action is received within the default - * timeout period. - * + * @throws TimeoutException if no response to the logoff action is received + * within the default timeout period. * @see net.sf.asterisk.manager.action.LogoffAction */ void logoff() throws IOException, TimeoutException; /** - * Returns the protocol identifier, i.e. a string like "Asterisk Call Manager/1.0". + * Returns the protocol identifier, i.e. a string like "Asterisk Call + * Manager/1.0". * - * @return the protocol identifier of the asterisk manager interface in use if it has already - * been received; <code>null</code> otherwise + * @return the protocol identifier of the asterisk manager interface in use + * if it has already been received; <code>null</code> otherwise */ String getProtocolIdentifier(); /** - * Sends a ManagerAction to the asterisk manager interface and waits for the corresponding - * ManagerResponse. + * Sends a ManagerAction to the asterisk manager interface and waits for the + * corresponding ManagerResponse. * * @param action the action to send to the asterisk server - * * @return the corresponding response received from the asterisk server - * * @throws IOException if the network connection is disrupted. - * @throws TimeoutException if no reponse is received within the default timeout period. - * + * @throws TimeoutException if no reponse is received within the default + * timeout period. * @see #sendAction(ManagerAction, long) * @see #sendAction(ManagerAction, ManagerResponseHandler) */ - ManagerResponse sendAction(ManagerAction action) throws IOException, TimeoutException; + ManagerResponse sendAction(ManagerAction action) throws IOException, + TimeoutException; /** - * Sends a ManagerAction to the asterisk manager interface and waits for the corresponding - * {@link ManagerResponse}. + * Sends a ManagerAction to the asterisk manager interface and waits for the + * corresponding {@link ManagerResponse}. * * @param action the action to send to the asterisk server - * @param timeout milliseconds to wait for the reponse before throwing a TimeoutException - * + * @param timeout milliseconds to wait for the reponse before throwing a + * TimeoutException * @return the corresponding response received from the asterisk server - * * @throws IOException if the network connection is disrupted. - * @throws TimeoutException if no reponse is received within the given timeout period. - * + * @throws TimeoutException if no reponse is received within the given + * timeout period. * @see #sendAction(ManagerAction, ManagerResponseHandler) */ - ManagerResponse sendAction(ManagerAction action, long timeout) throws IOException, TimeoutException; + ManagerResponse sendAction(ManagerAction action, long timeout) + throws IOException, TimeoutException; /** - * Sends a ManagerAction to the asterisk manager interface and registers a callback handler to - * be called when the corresponding ManagerResponse is received. + * Sends a ManagerAction to the asterisk manager interface and registers a + * callback handler to be called when the corresponding ManagerResponse is + * received. * * @param action the action to send to the asterisk server - * @param callbackHandler the callback handler to call when the response is received - * + * @param callbackHandler the callback handler to call when the response is + * received * @throws IOException if the network connection is disrupted. */ - void sendAction(ManagerAction action, ManagerResponseHandler callbackHandler) throws IOException; + void sendAction(ManagerAction action, ManagerResponseHandler callbackHandler) + throws IOException; /** * Registers an event handler to be called whenever an - * {@link net.sf.asterisk.manager.event.ManagerEvent} is receiced from the asterisk server. - * - * @param eventHandler the handler to call whenever a manager event is received + * {@link net.sf.asterisk.manager.event.ManagerEvent} is receiced from the + * asterisk server. * + * @param eventHandler the handler to call whenever a manager event is + * received * @see #removeEventHandler(ManagerEventHandler) */ void addEventHandler(ManagerEventHandler eventHandler); @@ -144,7 +148,6 @@ public interface ManagerConnection * Does nothing if the given event handler hasn't be been regiered before. * * @param eventHandler the event handle to unregister - * * @see #addEventHandler(ManagerEventHandler) */ void removeEventHandler(ManagerEventHandler eventHandler); @@ -155,4 +158,13 @@ public interface ManagerConnection * @return the Asterisk server of this connection. */ AsteriskServer getAsteriskServer(); + + /** + * Checks if the connection to the Asterisk server is established. + * + * @return <code>true</code> if the connection is established, + * <code>false</code> otherwise. + * @since 0.2 + */ + boolean isConnected(); } |