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 class XMPPIOService<RefObject> extends IOService<RefObject>
| Modifier and Type | Field and Description |
|---|---|
static String |
ACK_NAME
Field description
|
static String |
CROSS_DOMAIN_POLICY_FILE_PROP_KEY
Field description
|
static String |
CROSS_DOMAIN_POLICY_FILE_PROP_VAL
Field description
|
static String |
DOM_HANDLER
Key name of the system property for configuration protection
from system overload and DOS attack.
|
static String |
ID_ATT
Field description
|
protected SimpleParser |
parser
Field description
|
protected XMPPIOProcessor[] |
processors |
static String |
REQ_NAME
Field description
|
static String |
STREAM_CLOSING |
ReentrantLock |
writeInProgress
Field description
|
cb, CERT_CHECK_RESULT, CERT_REQUIRED_DOMAIN, decoder, encoder, HOSTNAME_KEY, partialCharacterBytes, PORT_TYPE_PROP_KEY, SESSION_ID_KEY, SSL_PROTOCOLS_KEY| Constructor and Description |
|---|
XMPPIOService()
Creates a new
XMPPIOService instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
addPacketToSend(Packet packet)
Method
addPacketToSend adds new data which will be processed
during next run. |
protected void |
addReceivedPacket(Packet packet)
Method
addReceivedPacket puts processing results to queue. |
IOService<?> |
call() |
boolean |
checkBufferLimit(int bufferSize) |
boolean |
checkData(char[] data) |
void |
clearWaitingPackets()
Clears queue of packets waiting to send.
|
void |
forceStop()
Method description
|
long |
getLastXmppPacketReceiveTime()
This method returns the time when the last XMPP packet was received, it is
used to help detect dead connections.
|
long |
getPacketsReceived(boolean reset)
Method description
|
long |
getPacketsSent(boolean reset)
Method description
|
Queue<Packet> |
getReceivedPackets()
Method description
|
long |
getTotalPacketsReceived()
Method description
|
long |
getTotalPacketsSent()
Method description
|
String |
getUserJid()
Method description
|
Map<String,Packet> |
getWaitingForAct()
Method description
|
Queue<Packet> |
getWaitingPackets()
Returns queue with packets waiting to send.
|
String |
getXMLNS()
Method description
|
protected String |
prepareStreamClose() |
protected void |
processSocketData()
Method description
|
void |
processWaitingPackets()
Method description
|
protected int |
receivedPackets()
Method description
|
void |
setAckMode(boolean white_char_ack,
boolean xmpp_ack,
boolean strict)
Method description
|
void |
setElementLimits(int limit) |
void |
setIOServiceListener(XMPPIOServiceListener servList)
Method description
|
void |
setProcessors(XMPPIOProcessor[] processors)
Method description
|
void |
setUserJid(String jid)
Method description
|
void |
setXMLNS(String xmlns)
Method description
|
void |
stop()
Describe
stop method here. |
String |
toString() |
void |
writeRawData(String data)
Method description
|
protected void |
xmppStreamClosed()
Method description
|
void |
xmppStreamOpen(String data)
Method description
|
protected void |
xmppStreamOpened(Map<String,String> attribs)
Method description
|
accept, byteOrder, connectionType, debug, debug, getBuffOverflow, getBytesReceived, getBytesSent, getConnectionId, getDataReceiver, getLastTransferTime, getLocalAddress, getLocalCertificate, getLocalPort, getPeerCertificate, getReadCounters, getRefObject, getRemoteAddress, getSessionData, getSocketChannel, getStatistics, getTlsUniqueId, getTotalBuffOverflow, getTotalBytesReceived, getTotalBytesSent, getUniqueId, getWriteCounters, getX509TrustManagers, handshakeCompleted, isConnected, isInputBufferEmpty, isSocketServiceReady, readBytes, readCompleted, readData, setBufferLimit, setConnectionId, setDataReceiver, setIOServiceListener, setRefObject, setSessionData, setSocketServiceReady, setX509TrustManagers, startSSL, startTLS, startZLib, waitingToRead, waitingToSend, waitingToSendSize, writeBytes, writeDatapublic static final String ACK_NAME
public static final String CROSS_DOMAIN_POLICY_FILE_PROP_KEY
public static final String CROSS_DOMAIN_POLICY_FILE_PROP_VAL
public static final String DOM_HANDLER
public static final String ID_ATT
public static final String REQ_NAME
public static final String STREAM_CLOSING
protected SimpleParser parser
protected XMPPIOProcessor[] processors
public ReentrantLock writeInProgress
public void addPacketToSend(Packet packet)
addPacketToSend adds new data which will be processed
during next run. Data are kept in proper order like in FIFO queue.packet - a Packet value of data to process.public IOService<?> call() throws IOException
public boolean checkBufferLimit(int bufferSize)
checkBufferLimit in interface IOListenercheckBufferLimit in class IOService<RefObject>public boolean checkData(char[] data)
throws IOException
data - booleanIOExceptionpublic void clearWaitingPackets()
public Queue<Packet> getWaitingPackets()
public void forceStop()
IOServicepublic void processWaitingPackets()
throws IOException
IOServiceprocessWaitingPackets in class IOService<RefObject>IOExceptionpublic void stop()
IOServicestop method here.public void writeRawData(String data) throws IOException
data - IOExceptionpublic void xmppStreamOpen(String data)
data - public long getPacketsReceived(boolean reset)
reset - longpublic long getPacketsSent(boolean reset)
reset - longpublic Queue<Packet> getReceivedPackets()
Queue<Packet>public long getTotalPacketsReceived()
longpublic long getTotalPacketsSent()
longpublic String getUserJid()
Stringpublic Map<String,Packet> getWaitingForAct()
Map<String,Packet>public String getXMLNS()
Stringpublic void setAckMode(boolean white_char_ack,
boolean xmpp_ack,
boolean strict)
white_char_ack - xmpp_ack - strict - public void setElementLimits(int limit)
limit - public void setIOServiceListener(XMPPIOServiceListener servList)
servList - public void setProcessors(XMPPIOProcessor[] processors)
processors - is a XMPPIOProcessor[]public void setUserJid(String jid)
jid - public void setXMLNS(String xmlns)
xmlns - protected void addReceivedPacket(Packet packet)
addReceivedPacket puts processing results to queue. The
processing results are usually data (messages) which has been just received
from socket.packet - a Packet value of processing results.protected String prepareStreamClose()
protected void processSocketData()
throws IOException
IOServiceprocessSocketData in class IOService<RefObject>IOExceptionprotected int receivedPackets()
IOServicereceivedPackets in class IOService<RefObject>protected void xmppStreamClosed()
protected void xmppStreamOpened(Map<String,String> attribs)
attribs - public long getLastXmppPacketReceiveTime()
long number denoting time when the last XMPP packet was
received.Copyright © 2018 "Tigase, Inc.". All rights reserved.