List of usage examples for org.apache.commons.net.telnet TelnetClient sendAYT
public boolean sendAYT(long timeout) throws IOException, IllegalArgumentException, InterruptedException
From source file:org.mule.transport.telnet.TelnetMessageDispatcher.java
@Override public RetryContext validateConnection(RetryContext retryContext) { try {/*from w w w. ja v a 2 s.c om*/ String host = getConnector().getHost(); int port = getConnector().getPort(); TelnetClient client = new TelnetClient(); client.connect(host, port); boolean b = client.sendAYT(2000); if (b) { retryContext.setOk(); } else { retryContext.setFailed(new IOException("sendAYT is false.")); } } catch (Exception e) { retryContext.setFailed(e); } return retryContext; }