hudson.plugins.im
Class IMConnectionProvider

java.lang.Object
  extended by hudson.plugins.im.IMConnectionProvider
All Implemented Interfaces:
IMConnectionListener

public abstract class IMConnectionProvider
extends java.lang.Object
implements IMConnectionListener

Abstract implementation of a provider of IMConnections.

Author:
kutzi

Field Summary
protected  IMPublisherDescriptor descriptor
           
 
Constructor Summary
protected IMConnectionProvider()
           
 
Method Summary
 void connectionBroken(java.lang.Exception e)
           
abstract  IMConnection createConnection()
          Creates a new connection.
 IMConnection currentConnection()
          Return the current connection.
 AuthenticationHolder getAuthenticationHolder()
           
protected  IMPublisherDescriptor getDescriptor()
           
protected  void init()
          Must be called once to initialize the provider.
 void releaseConnection()
          Releases (and thus closes) the current connection.
 void setDescriptor(IMPublisherDescriptor desc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

descriptor

protected IMPublisherDescriptor descriptor
Constructor Detail

IMConnectionProvider

protected IMConnectionProvider()
Method Detail

init

protected void init()
Must be called once to initialize the provider.


createConnection

public abstract IMConnection createConnection()
                                       throws IMException
Creates a new connection.

Returns:
the new connection. Never null.
Throws:
IMException - if the connection couldn't be created for any reason.
IMException

currentConnection

public IMConnection currentConnection()
Return the current connection. Returns an instance of DummyConnection if the plugin is currently not connection to a IM network.

Returns:
the current connection. Never null.

releaseConnection

public void releaseConnection()
Releases (and thus closes) the current connection.


getDescriptor

protected IMPublisherDescriptor getDescriptor()

setDescriptor

public void setDescriptor(IMPublisherDescriptor desc)

connectionBroken

public void connectionBroken(java.lang.Exception e)
Specified by:
connectionBroken in interface IMConnectionListener

getAuthenticationHolder

public AuthenticationHolder getAuthenticationHolder()


Copyright © 2010. All Rights Reserved.