com.valhalla.jbother
Class ConnectorThread

java.lang.Object
  extended by com.valhalla.jbother.ConnectorThread
All Implemented Interfaces:
java.lang.Runnable

public class ConnectorThread
extends java.lang.Object
implements java.lang.Runnable

Attempts to connect to the server. If the connection is made successfully, it sets up the various packet listeners and displays the BuddyList

Version:
1.0
Author:
Adam Olsen, Andrey Zakirov

Method Summary
 org.jivesoftware.smack.XMPPConnection getConnection()
           
 ConnectionListener getConnectionListener()
          Returns the ConnectionListener
 org.jivesoftware.smackx.RosterExchangeManager getExchangeManager()
           
 org.jivesoftware.smackx.filetransfer.FileTransferManager getFileTransferManager()
           
static ConnectorThread getInstance()
           
 org.jivesoftware.smackx.MessageEventManager getMessageEventManager()
          Gets the messageEventManager attribute of the ConnectorThread class
 org.jivesoftware.smack.Roster getRoster()
           
 ConnectorThread init(org.jivesoftware.smack.packet.Presence.Mode connectMode, java.lang.String statusString, boolean away)
           
 boolean isAlive()
           
 void resetCredentials()
           
 void run()
          Called when the Threads .start() method is called
 void setCancelled(boolean c)
          Sets the cancelled attribute of the ConnectorThread class
 void setHasHadError(boolean has)
          Sets whether or not a connection error has already been thrown for this connection
 void setPersistent(boolean persistent)
          Sets whether or not this thread should try to reconnect if there is a connection error
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getConnection

public org.jivesoftware.smack.XMPPConnection getConnection()

getFileTransferManager

public org.jivesoftware.smackx.filetransfer.FileTransferManager getFileTransferManager()

isAlive

public boolean isAlive()

start

public void start()

getExchangeManager

public org.jivesoftware.smackx.RosterExchangeManager getExchangeManager()

getInstance

public static ConnectorThread getInstance()

getRoster

public org.jivesoftware.smack.Roster getRoster()

init

public ConnectorThread init(org.jivesoftware.smack.packet.Presence.Mode connectMode,
                            java.lang.String statusString,
                            boolean away)

resetCredentials

public void resetCredentials()

getMessageEventManager

public org.jivesoftware.smackx.MessageEventManager getMessageEventManager()
Gets the messageEventManager attribute of the ConnectorThread class

Returns:
The messageEventManager value

setCancelled

public void setCancelled(boolean c)
Sets the cancelled attribute of the ConnectorThread class

Parameters:
c - The new cancelled value

setPersistent

public void setPersistent(boolean persistent)
Sets whether or not this thread should try to reconnect if there is a connection error

Parameters:
persistent - set to true if you want the thread to continue to try and connect even if there's an error

getConnectionListener

public ConnectionListener getConnectionListener()
Returns the ConnectionListener

Returns:
the connection listener

setHasHadError

public void setHasHadError(boolean has)
Sets whether or not a connection error has already been thrown for this connection

Parameters:
has - true if an error has already been thrown

run

public void run()
Called when the Threads .start() method is called

Specified by:
run in interface java.lang.Runnable