net.bioclipse.xws.client
Class Client

java.lang.Object
  extended by net.bioclipse.xws.client.Client

public class Client
extends java.lang.Object


Constructor Summary
Client(java.lang.String clientJID, java.lang.String pwd, java.lang.String host, int port, IExecutionPipe executionPipe)
          Initializes a newly created XMPP client with the supplied account information.
 
Method Summary
 void addConnectionListener(IConnectionListener listener)
          Adds a connection listener that gets informed about connect and disconnect events.
 void connect()
          Connects the client to the server.
 void disconnect()
          Disconnects the client from the server.
 IFunction getFunction(java.lang.String service_jid, java.lang.String function_name)
          Creates an object representing a function of a XMPP Service.
 IService getService(java.lang.String service_jid)
          Creates an object representing a XMPP Service.
 IXmppItem getXmppItem(java.lang.String jid, java.lang.String node)
          Creates an object representing a XMPP item.
 boolean isConnected()
          Checks the connection status.
 boolean removeConnectionListener(IConnectionListener listener)
          Removes a connection listener.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Client

public Client(java.lang.String clientJID,
              java.lang.String pwd,
              java.lang.String host,
              int port,
              IExecutionPipe executionPipe)
       throws XmppException
Initializes a newly created XMPP client with the supplied account information.

Parameters:
clientJID - The JID used to identify to the server including a resource, example: 'user@server.example.net/MyLaptop'.
pwd - The password.
host - The server to connect to. The server is usually the domain name behind the @ of the specified account JID without the resource, for example: 'server.example.net'.
port - The port to connect to (usually 5222).
executionPipe - The execution pipe that is used to execute listener code in a user-defined thread (in most cases the GUI thread).
Throws:
XmppException
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isConnected

public boolean isConnected()
Checks the connection status.

Returns:
true if this client is connected to the server. false otherwise.

addConnectionListener

public void addConnectionListener(IConnectionListener listener)
Adds a connection listener that gets informed about connect and disconnect events.

Parameters:
listener - The listener to add.

removeConnectionListener

public boolean removeConnectionListener(IConnectionListener listener)
Removes a connection listener.

Parameters:
listener - The listener to remove.
Returns:
true if the listener was found and removed. false otherwise.

connect

public void connect()
             throws XmppException
Connects the client to the server.

Throws:
XmppException

disconnect

public void disconnect()
                throws XmppException
Disconnects the client from the server.

Throws:
XmppException

getService

public IService getService(java.lang.String service_jid)
Creates an object representing a XMPP Service.

Parameters:
service_jid - The JID of the XMPP Service.
Returns:
The XMPP Web Service.

getFunction

public IFunction getFunction(java.lang.String service_jid,
                             java.lang.String function_name)
Creates an object representing a function of a XMPP Service.

Parameters:
service_jid - The JID of the XMPP Service that hosts the function.
function_name - The name of the function.
Returns:
The function.

getXmppItem

public IXmppItem getXmppItem(java.lang.String jid,
                             java.lang.String node)
Creates an object representing a XMPP item.

Parameters:
jid - The JID of the XMPP item.
node - The node name.
Returns:
The XMPP item.