Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.jabberwookie
Class Component2Server  view Component2Server download Component2Server.java

java.lang.Object
  extended bycom.jabberwookie.Stream
      extended bycom.jabberwookie.Component2Server
All Implemented Interfaces:
com.ssttr.xml.SAXInterface, UnrecognizedChunkListener

public class Component2Server
extends Stream
implements UnrecognizedChunkListener

Implements the required methods to establish a connection to a Jabber server as a component. This allows you to create new services for the server.


Nested Class Summary
 
Nested classes inherited from class com.jabberwookie.Stream
 
Field Summary
private  boolean authenticated
           
private  java.lang.String secret
           
private static java.lang.String STREAM_CLOSER
           
private static java.lang.String STREAM_OPENER
           
 
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
 
Constructor Summary
Component2Server(java.io.InputStream in, java.io.OutputStream out, java.lang.String secret)
          Creates a new instance of Component2Server.
Component2Server(java.io.InputStream in, java.io.OutputStream out, java.lang.String secret, com.ssttr.util.processor.Processor processor)
          Creates a new instance of Component2Server.
 
Method Summary
private  void _init(java.lang.String secret)
           
 void close()
          Closes the stream.
 void docStart(java.lang.String tag, java.util.Hashtable attrs)
           
 void incomingChunk(com.jabberwookie.ns.jabber.Chunk chunk)
          From UnrecognizedChunkListener, needed for authentication.
 boolean open(java.lang.String serverName, int timeoutSecs)
          Opens the stream and attempts to authenticate itself.
 void setUnrecogizedChunkListener(UnrecognizedChunkListener listener)
          Since Jabber components are set to receive data from specific namespaces only this overrides the default Stream.setUnrecogizedChunkListener(com.jabberwookie.UnrecognizedChunkListener) 55 to do nothing.
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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

secret

private java.lang.String secret

authenticated

private boolean authenticated
Constructor Detail

Component2Server

public Component2Server(java.io.InputStream in,
                        java.io.OutputStream out,
                        java.lang.String secret)
Creates a new instance of Component2Server. 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.


Component2Server

public Component2Server(java.io.InputStream in,
                        java.io.OutputStream out,
                        java.lang.String secret,
                        com.ssttr.util.processor.Processor processor)
Creates a new instance of Component2Server. 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.

Method Detail

_init

private void _init(java.lang.String secret)

setUnrecogizedChunkListener

public void setUnrecogizedChunkListener(UnrecognizedChunkListener listener)
Since Jabber components are set to receive data from specific namespaces only this overrides the default Stream.setUnrecogizedChunkListener(com.jabberwookie.UnrecognizedChunkListener) 55 to do nothing.

Overrides:
setUnrecogizedChunkListener in class Stream

open

public boolean open(java.lang.String serverName,
                    int timeoutSecs)
             throws java.io.IOException
Opens the stream and attempts to authenticate itself.

Specified by:
open in class Stream

close

public void close()
Closes the stream.

Specified by:
close in class Stream

docStart

public void docStart(java.lang.String tag,
                     java.util.Hashtable attrs)
Specified by:
docStart in interface com.ssttr.xml.SAXInterface
Overrides:
docStart in class Stream

incomingChunk

public void incomingChunk(com.jabberwookie.ns.jabber.Chunk chunk)
From UnrecognizedChunkListener, needed for authentication.

Specified by:
incomingChunk in interface UnrecognizedChunkListener