|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttigase.net.IOService<RefObject>
RefObject - is a reference object stored by this service. This is e reference to
higher level data object keeping more information about the
connection.public abstract class IOService<RefObject>
IOService offers thread safe call() method
execution, however you must be prepared that other methods can be called
simultaneously like stop(), getProtocol() or
isConnected().
It is recommended that developers extend AbsractServerService
rather then implement ServerService interface directly.
If you directly implement ServerService interface you must take
care about SocketChannel I/O, queuing tasks, processing results
and thread safe execution of call() method. If you however
extend IOService class all this basic operation are implemented
and you have only to take care about parsing data received from network
socket. Parsing data is expected to be implemented in
parseData(char[] data) method.
Created: Tue Sep 28 23:00:34 2004
| Field Summary | |
|---|---|
static String |
CERT_CHECK_RESULT
Field description |
static String |
HOSTNAME_KEY
Field description |
static String |
PORT_TYPE_PROP_KEY
Field description |
static String |
SESSION_ID_KEY
This is key used to store session ID in temporary session data storage. |
| Constructor Summary | |
|---|---|
IOService()
|
|
| Method Summary | |
|---|---|
void |
accept(SocketChannel socketChannel)
Method accept is used to perform |
IOService<?> |
call()
Method run is used to perform |
ConnectionType |
connectionType()
Method description |
protected boolean |
debug(char[] msg)
Describe debug method here. |
protected boolean |
debug(String msg,
String prefix)
Describe debug method here. |
void |
forceStop()
Method description |
tigase.xmpp.JID |
getConnectionId()
|
tigase.xmpp.JID |
getDataReceiver()
Method description |
long |
getLastTransferTime()
This method returns the time of last transfer in any direction through this service. |
String |
getLocalAddress()
Method description |
long[] |
getReadCounters()
Method description |
RefObject |
getRefObject()
Method description |
String |
getRemoteAddress()
Returns a remote IP address for the TCP/IP connection. |
ConcurrentMap<String,Object> |
getSessionData()
Method description |
SocketChannel |
getSocketChannel()
Method getSocketChannel is used to perform |
void |
getStatistics(StatisticsList list,
boolean reset)
Method description |
String |
getUniqueId()
Method description |
long[] |
getWriteCounters()
Method description |
void |
handshakeCompleted(TLSWrapper wrapper)
Method description |
boolean |
isConnected()
Describe isConnected method here. |
protected boolean |
isInputBufferEmpty()
Method description |
protected abstract void |
processSocketData()
|
abstract void |
processWaitingPackets()
Method description |
protected ByteBuffer |
readBytes()
|
protected void |
readCompleted()
|
protected char[] |
readData()
Describe readData method here. |
protected abstract int |
receivedPackets()
|
void |
setConnectionId(tigase.xmpp.JID connectionId)
|
void |
setDataReceiver(tigase.xmpp.JID address)
Method description |
void |
setIOServiceListener(IOServiceListener<IOService<RefObject>> sl)
Method description |
void |
setRefObject(RefObject refObject)
Method description |
void |
setSessionData(Map<String,Object> props)
Method description |
void |
startSSL(boolean clientMode)
Method description |
void |
startTLS(boolean clientMode)
Method description |
void |
startZLib(int level)
Method description |
void |
stop()
Describe stop method here. |
String |
toString()
Method description |
boolean |
waitingToRead()
Method description |
boolean |
waitingToSend()
Method description |
int |
waitingToSendSize()
Method description |
protected void |
writeBytes(ByteBuffer data)
|
protected void |
writeData(String data)
Describe writeData method here. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String SESSION_ID_KEY
public static final String PORT_TYPE_PROP_KEY
public static final String HOSTNAME_KEY
public static final String CERT_CHECK_RESULT
| Constructor Detail |
|---|
public IOService()
| Method Detail |
|---|
public abstract void processWaitingPackets()
throws IOException
IOException
protected abstract void processSocketData()
throws IOException
IOExceptionprotected abstract int receivedPackets()
public void accept(SocketChannel socketChannel)
throws IOException
accept is used to perform
socketChannel - a SocketChannel value
IOException
public IOService<?> call()
throws IOException
run is used to perform
call in interface Callable<IOService<?>>IOExceptionpublic ConnectionType connectionType()
public void forceStop()
public tigase.xmpp.JID getDataReceiver()
public long getLastTransferTime()
public String getLocalAddress()
public long[] getReadCounters()
public RefObject getRefObject()
public String getRemoteAddress()
public ConcurrentMap<String,Object> getSessionData()
public SocketChannel getSocketChannel()
getSocketChannel is used to perform
SocketChannel value
public void getStatistics(StatisticsList list,
boolean reset)
list - reset - public String getUniqueId()
public long[] getWriteCounters()
public void handshakeCompleted(TLSWrapper wrapper)
handshakeCompleted in interface TLSEventHandlerwrapper - public boolean isConnected()
isConnected method here.
boolean valuepublic void setDataReceiver(tigase.xmpp.JID address)
address - public void setIOServiceListener(IOServiceListener<IOService<RefObject>> sl)
sl - public void setRefObject(RefObject refObject)
refObject - public void setSessionData(Map<String,Object> props)
props -
public void startSSL(boolean clientMode)
throws IOException
clientMode -
IOException
public void startTLS(boolean clientMode)
throws IOException
clientMode -
IOExceptionpublic void startZLib(int level)
level - public void stop()
stop method here.
public String toString()
toString in class Objectpublic boolean waitingToRead()
public boolean waitingToSend()
public int waitingToSendSize()
protected boolean isInputBufferEmpty()
protected boolean debug(char[] msg)
debug method here.
msg - a char[] value
boolean value
protected boolean debug(String msg,
String prefix)
debug method here.
msg - a String value
boolean valueprotected void readCompleted()
protected char[] readData()
throws IOException
readData method here.
char[] value
IOException - if an error occurs
protected ByteBuffer readBytes()
throws IOException
IOExceptionprotected void writeData(String data)
writeData method here.
data - a String valueprotected void writeBytes(ByteBuffer data)
public tigase.xmpp.JID getConnectionId()
public void setConnectionId(tigase.xmpp.JID connectionId)
connectionId - the connectionId to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||