Search in sources :

Example 1 with IMException

use of hudson.plugins.im.IMException in project ircbot-plugin by jenkinsci.

the class IRCConnectionProvider method createConnection.

@Override
public synchronized IMConnection createConnection() throws IMException {
    releaseConnection();
    if (getDescriptor() == null) {
        throw new IMException("Descriptor not set");
    }
    IMConnection imConnection = new IRCConnection((IrcPublisher.DescriptorImpl) getDescriptor(), getAuthenticationHolder());
    if (imConnection.connect()) {
        return imConnection;
    } else {
        imConnection.close();
    }
    throw new IMException("Connection failed");
}
Also used : IMException(hudson.plugins.im.IMException) IMConnection(hudson.plugins.im.IMConnection) IrcPublisher(hudson.plugins.ircbot.IrcPublisher)

Aggregations

IMConnection (hudson.plugins.im.IMConnection)1 IMException (hudson.plugins.im.IMException)1 IrcPublisher (hudson.plugins.ircbot.IrcPublisher)1