java.lang.Object
com.jabberwookie.Stream
com.jabberwookie.Client2Server
- All Implemented Interfaces:
- com.ssttr.xml.SAXInterface
- public class Client2Server
- extends Stream
This implements the most common form of Jabber stream. That of
a client (user) connecting to the server (usually for IM).
| Nested classes inherited from class com.jabberwookie.Stream |
|
| Fields inherited from class com.jabberwookie.Stream |
chunkProcessor, chunkQueue, connected, connectionId, DEBUG, in, iqListener, mListener, ns, out, outWriter, parserT, pListener, processor, PROCESSOR_WAIT_TIME, unListener, waitingIds |
|
Method Summary |
void |
close()
Closes down the stream. |
void |
docStart(java.lang.String tag,
java.util.Hashtable attrs)
Overrides the docStart from Stream in order to catch
the server name. |
java.lang.String |
getServerName()
Gets the name of the server as returned by the server. |
int |
login(java.lang.String userName,
java.lang.String resource,
java.lang.String password,
int minLevel,
int maxLevel,
int timeOut)
Will login with the specified authentication mechanisms. |
int |
loginAny(java.lang.String userName,
java.lang.String resource,
java.lang.String password,
int timeOut)
Logs in useing any suppored authentication mechanism, in the
order of most to least secure. |
int |
loginDigest(java.lang.String userName,
java.lang.String resource,
java.lang.String password,
int timeOut)
Attempts to login via digest authentication or stronger
only. |
int |
loginZeroK(java.lang.String userName,
java.lang.String resource,
java.lang.String password,
int timeOut)
Attempts to login with Zero Knowledge authentication only. |
boolean |
open(java.lang.String serverName,
int timeoutMillis)
Opens the stream, but does not login. |
| Methods inherited from class com.jabberwookie.Stream |
cData, chunkStart, chunkStop, docStop, dtdData, elementStart, elementStop, getConnectionId, isConnected, processChunk, processingInstruction, send, send, setAllListeners, setIQListener, setMessageListener, setNamespaces, setPresenceListener, setProcessor, setUnrecogizedChunkListener |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOGIN_BAD_PASS
public static final int LOGIN_BAD_PASS
- See Also:
- Constant Field Values
LOGIN_BAD_UID
public static final int LOGIN_BAD_UID
- See Also:
- Constant Field Values
LOGIN_FAILED
public static final int LOGIN_FAILED
- See Also:
- Constant Field Values
LOGIN_OK
public static final int LOGIN_OK
- See Also:
- Constant Field Values
LOGIN_PASS_EXP
public static final int LOGIN_PASS_EXP
- See Also:
- Constant Field Values
serverName
private java.lang.String serverName
STREAM_OPENER
private static final java.lang.String STREAM_OPENER
- See Also:
- Constant Field Values
STREAM_CLOSER
private static final java.lang.String STREAM_CLOSER
- See Also:
- Constant Field Values
Client2Server
public Client2Server(java.io.InputStream in,
java.io.OutputStream out)
- Creates a new instance of Client2Server. Since this class
doesn't understand what a Socket is you'll have to open
one youself and then pass in the input and output stream.
Client2Server
public Client2Server(java.io.InputStream in,
java.io.OutputStream out,
com.ssttr.util.processor.Processor processor)
- Creates a new instance of Client2Server. Since this class
doesn't understand what a Socket is you'll have to open
one youself and then pass in the input and output stream.
Please see the documentation for
Stream.Stream(InputStream,OutputStream,Processor) 55
and Stream.setProcessor(com.ssttr.util.processor.Processor) 55 for more information about
the Processor.
getServerName
public java.lang.String getServerName()
- Gets the name of the server as returned by the server.
open
public boolean open(java.lang.String serverName,
int timeoutMillis)
throws java.io.IOException
- Opens the stream, but does not login. Use
login(java.lang.String, java.lang.String, java.lang.String, int, int, int) 55
to do that.
- Specified by:
open in class Stream
close
public void close()
- Closes down the stream. And effectivly logs out.
- Specified by:
close in class Stream
docStart
public void docStart(java.lang.String tag,
java.util.Hashtable attrs)
- Overrides the docStart from Stream in order to catch
the server name.
- Specified by:
docStart in interface com.ssttr.xml.SAXInterface- Overrides:
docStart in class Stream
loginAny
public int loginAny(java.lang.String userName,
java.lang.String resource,
java.lang.String password,
int timeOut)
- Logs in useing any suppored authentication mechanism, in the
order of most to least secure.
loginDigest
public int loginDigest(java.lang.String userName,
java.lang.String resource,
java.lang.String password,
int timeOut)
- Attempts to login via digest authentication or stronger
only.
loginZeroK
public int loginZeroK(java.lang.String userName,
java.lang.String resource,
java.lang.String password,
int timeOut)
- Attempts to login with Zero Knowledge authentication only.
login
public int login(java.lang.String userName,
java.lang.String resource,
java.lang.String password,
int minLevel,
int maxLevel,
int timeOut)
- Will login with the specified authentication mechanisms.