|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.jabberwookie.Stream
This implements the most basic functions required to establish and
maintain a Jabber stream. It must be extended to be truely useful.
Currently this is done by the Client2Server and
Component2Server classes.
| Field Summary | |
protected com.jabberwookie.Stream.ChunkProcessor |
chunkProcessor
|
protected java.util.Vector |
chunkQueue
|
protected boolean |
connected
|
protected java.lang.String |
connectionId
|
protected static boolean |
DEBUG
|
protected java.io.DataInputStream |
in
|
protected IQListener |
iqListener
|
protected MessageListener |
mListener
|
protected Namespaces |
ns
|
protected java.io.OutputStream |
out
|
protected java.io.Writer |
outWriter
|
protected com.jabberwookie.Stream.ParserThread |
parserT
|
protected PresenceListener |
pListener
|
protected Processor |
processor
|
protected static int |
PROCESSOR_WAIT_TIME
How long to wait before giving up on trying to process a chunk. |
protected UnrecognizedChunkListener |
unListener
|
protected java.util.Hashtable |
waitingIds
|
| Constructor Summary | |
Stream(java.io.InputStream in,
java.io.OutputStream out)
Creates a new instance of Stream. |
|
Stream(java.io.InputStream in,
java.io.OutputStream out,
Processor processor)
Creates a new instance of Stream. |
|
| Method Summary | |
void |
cData(java.lang.String data)
|
void |
chunkStart(java.lang.String tag,
java.util.Hashtable attrs)
|
void |
chunkStop(java.lang.String tag)
|
abstract void |
close()
Closes the stream, needs to be impelmented by the subclass. |
void |
docStart(java.lang.String tag,
java.util.Hashtable attrs)
|
void |
docStop(java.lang.String tag)
|
void |
dtdData(java.lang.String dtd)
|
void |
elementStart(java.lang.String tag,
java.util.Hashtable attrs)
|
void |
elementStop(java.lang.String tag)
|
java.lang.String |
getConnectionId()
|
boolean |
isConnected()
|
abstract boolean |
open(java.lang.String serverName,
int timeoutSecs)
Opens the stream, needs to be impelmented by the subclass. |
void |
processChunk(Chunk chunk)
|
void |
processingInstruction(java.lang.String element)
|
void |
send(Chunk chunk)
Sends the chunk to the other end and returns immediatly. |
Chunk |
send(Chunk chunk,
int timeoutMillis)
Sends the chunk to the other end and waits for a reply. |
void |
setAllListeners(java.lang.Object listener)
Does NOT set the UnrecogizedChunkListener. |
void |
setIQListener(IQListener listener)
|
void |
setMessageListener(MessageListener listener)
|
void |
setNamespaces(Namespaces namespaces)
Sets the namespaces used when interpreting incoming data. |
void |
setPresenceListener(PresenceListener listener)
|
void |
setProcessor(Processor processor)
Sets the internal Processor used when calling your *Listeners. |
void |
setUnrecogizedChunkListener(UnrecognizedChunkListener listener)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final boolean DEBUG
protected static final int PROCESSOR_WAIT_TIME
protected java.io.DataInputStream in
protected java.io.OutputStream out
protected java.io.Writer outWriter
protected com.jabberwookie.Stream.ParserThread parserT
protected Processor processor
protected java.util.Vector chunkQueue
protected com.jabberwookie.Stream.ChunkProcessor chunkProcessor
protected MessageListener mListener
protected PresenceListener pListener
protected IQListener iqListener
protected UnrecognizedChunkListener unListener
protected boolean connected
protected java.lang.String connectionId
protected Namespaces ns
protected java.util.Hashtable waitingIds
| Constructor Detail |
public Stream(java.io.InputStream in,
java.io.OutputStream out)
public Stream(java.io.InputStream in,
java.io.OutputStream out,
Processor processor)
| Method Detail |
public void setProcessor(Processor processor)
processor - public void setNamespaces(Namespaces namespaces)
namespaces -
public abstract boolean open(java.lang.String serverName,
int timeoutSecs)
throws java.io.IOException
serverName - timeoutSecs -
java.io.IOExceptionpublic abstract void close()
public void send(Chunk chunk)
throws java.io.IOException
chunk -
java.io.IOException
public Chunk send(Chunk chunk,
int timeoutMillis)
throws java.io.IOException
chunk - timeoutMillis -
java.io.IOExceptionpublic boolean isConnected()
public java.lang.String getConnectionId()
public void setMessageListener(MessageListener listener)
public void setPresenceListener(PresenceListener listener)
public void setIQListener(IQListener listener)
public void setUnrecogizedChunkListener(UnrecognizedChunkListener listener)
public void setAllListeners(java.lang.Object listener)
public void cData(java.lang.String data)
public void chunkStart(java.lang.String tag,
java.util.Hashtable attrs)
public void docStart(java.lang.String tag,
java.util.Hashtable attrs)
public void elementStart(java.lang.String tag,
java.util.Hashtable attrs)
public void elementStop(java.lang.String tag)
public void chunkStop(java.lang.String tag)
public void processChunk(Chunk chunk)
public void docStop(java.lang.String tag)
public void processingInstruction(java.lang.String element)
public void dtdData(java.lang.String dtd)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||