hudson.plugins.im
Interface IMConnection

All Known Implementing Classes:
AbstractIMConnection

public interface IMConnection

Represents a connection to an IM-Server.

Author:
Uwe Schaefer

Method Summary
 void addConnectionListener(IMConnectionListener listener)
           
 void close()
          Closes the connection (includes logout) and releases resources.
 boolean connect()
          Establishes the connection and login.
 boolean isConnected()
          Returns if the connection is established.
 void removeConnectionListener(IMConnectionListener listener)
           
 void send(IMMessageTarget target, java.lang.String text)
          Sends a Message-Text to an IMMessageTarget (aka a User ;).
 void setPresence(IMPresence presence, java.lang.String statusMessage)
          Sets the current connection's presence to a protocol specific adaption of the given presence parameter.
 

Method Detail

connect

boolean connect()
Establishes the connection and login.

Returns:
true iff connection and login was successful

isConnected

boolean isConnected()
Returns if the connection is established.


close

void close()
Closes the connection (includes logout) and releases resources.


send

void send(IMMessageTarget target,
          java.lang.String text)
          throws IMException
Sends a Message-Text to an IMMessageTarget (aka a User ;).

Parameters:
target - the target to send to
text - the text to be sent
Throws:
IMException

setPresence

void setPresence(IMPresence presence,
                 java.lang.String statusMessage)
                 throws IMException
Sets the current connection's presence to a protocol specific adaption of the given presence parameter. May be ignored completely by some protocols.

Parameters:
presence - the presence to set
statusMessage - status message which should be deployed (maybe ignored by some protocols)
Throws:
IMException - encapsulated exception of underlying protocol/client

addConnectionListener

void addConnectionListener(IMConnectionListener listener)

removeConnectionListener

void removeConnectionListener(IMConnectionListener listener)


Copyright © 2010. All Rights Reserved.