threads
Class HttpBindThread

java.lang.Object
  extended by java.lang.Thread
      extended by threads.HttpBindThread
All Implemented Interfaces:
java.lang.Runnable, IWriterThread

public class HttpBindThread
extends java.lang.Thread
implements IWriterThread

Class for transmitting stanzas over http-binding (JEP 124)


Field Summary
static int DEFAULT_WAIT
           
protected  boolean statusSet
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
HttpBindThread(StanzaReader _stanzaReader, MidletEventListener events)
          Constructor
 
Method Summary
protected  void Authenticate(HttpNode x, java.lang.String user, java.lang.String pass, java.lang.String domain)
          authenticates the user with the most appropriate mechanism
protected  void initSession(java.lang.String addr, java.lang.String domain, java.lang.String user, java.lang.String pass, java.lang.String resource, java.lang.String Status)
          Initialize the session
protected  HttpNode readStanza()
          reads the next non-empty stanza (blocking)
 void run()
          Run Method of the thread
static int strlen(java.lang.String s)
          Find length in bytes of a string, akin to strlen vs wcslen � 2003, 2004 Vidar Holen www.vidarholen.net
 void terminate()
          Tells the thread to terminate as soon as possible.
 byte[] unicodeToServer(java.lang.String s)
          Unicode Support � 2003, 2004 Vidar Holen www.vidarholen.net
 void write(java.lang.String _s)
          Implements the interface method
protected  void writeWithBody(java.lang.String mess)
           
 
Methods inherited from class java.lang.Thread
activeCount, currentThread, getName, getPriority, interrupt, isAlive, join, setPriority, sleep, start, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface threads.IWriterThread
start
 

Field Detail

DEFAULT_WAIT

public static int DEFAULT_WAIT

statusSet

protected boolean statusSet
Constructor Detail

HttpBindThread

public HttpBindThread(StanzaReader _stanzaReader,
                      MidletEventListener events)
Constructor

Method Detail

run

public void run()
Run Method of the thread

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

readStanza

protected HttpNode readStanza()
reads the next non-empty stanza (blocking)

Returns:
HttpNode

initSession

protected void initSession(java.lang.String addr,
                           java.lang.String domain,
                           java.lang.String user,
                           java.lang.String pass,
                           java.lang.String resource,
                           java.lang.String Status)
                    throws java.lang.Exception
Initialize the session

Throws:
java.lang.Exception

terminate

public void terminate()
Tells the thread to terminate as soon as possible.

Specified by:
terminate in interface IWriterThread

write

public void write(java.lang.String _s)
Implements the interface method

Specified by:
write in interface IWriterThread
Parameters:
_s -

writeWithBody

protected void writeWithBody(java.lang.String mess)

Authenticate

protected void Authenticate(HttpNode x,
                            java.lang.String user,
                            java.lang.String pass,
                            java.lang.String domain)
                     throws java.lang.Exception
authenticates the user with the most appropriate mechanism

Parameters:
x - features
user -
pass -
domain -
Throws:
java.lang.Exception

unicodeToServer

public byte[] unicodeToServer(java.lang.String s)
Unicode Support � 2003, 2004 Vidar Holen www.vidarholen.net


strlen

public static int strlen(java.lang.String s)
Find length in bytes of a string, akin to strlen vs wcslen � 2003, 2004 Vidar Holen www.vidarholen.net