Package tigase.xmpp
Class XMPPIOService<RefObject>
java.lang.Object
tigase.net.IOService<RefObject>
tigase.xmpp.XMPPIOService<RefObject>
- Type Parameters:
RefObject- is a reference object stored by this service. This is e reference to higher level data object keeping more information about the connection.
- All Implemented Interfaces:
Callable<IOService<?>>,TLSEventHandler,IOListener
- Direct Known Subclasses:
BoshIOService,C2SIOService,ComponentIOService,S2SIOService,WebSocketXMPPIOService
Describe class XMPPIOService here.
Created: Tue Feb 7 07:15:02 2006
Created: Tue Feb 7 07:15:02 2006
- Author:
- Artur Hefczyc
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final StringKey name of the system property for configuration protection from system overload and DOS attack.static final Stringprotected SimpleParserprotected XMPPIOProcessor[]static final Stringprotected XMPPIOServiceListenerstatic final StringFields inherited from class tigase.net.IOService
cb, CERT_CHECK_RESULT, CERT_REQUIRED_DOMAIN, decoder, encoder, HOSTNAME_KEY, LOCAL_CERT_CHECK_RESULT, partialCharacterBytes, PORT_TYPE_PROP_KEY, SESSION_ID_KEY, SSL_PROTOCOLS_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPacketToSend(Packet packet) MethodaddPacketToSendadds new data which will be processed during next run.protected voidaddReceivedPacket(Packet packet) MethodaddReceivedPacketputs processing results to queue.IOService<?> call()booleancheckBufferLimit(int bufferSize) booleancheckData(char[] data) voidClears queue of packets waiting to send.voidlongThis method returns the time when the last XMPP packet was received, it is used to help detect dead connections.longgetPacketsReceived(boolean reset) longgetPacketsSent(boolean reset) longlongDeprecated.Returns queue with packets waiting to send.getXMLNS()protected booleanprotected voidmoveParsedPacketsToReceived(boolean sendAck) protected Stringprotected voidvoidprotected intvoidsetAckMode(boolean white_char_ack, boolean xmpp_ack, boolean strict) voidsetAuthorisedUserJid(JID authorisedUserJid) voidsetElementLimits(int limit) voidsetIOServiceListener(XMPPIOServiceListener servList) voidsetProcessors(XMPPIOProcessor[] processors) voidsetUserJid(String jid) Deprecated.voidprotected booleanshouldCountPacket(Packet packet) voidstop()toString()voidwriteRawData(String data) protected voidvoidxmppStreamOpen(String data) protected voidxmppStreamOpened(Map<String, String> attribs) Methods inherited from class tigase.net.IOService
accept, accept, byteOrder, connectionType, debug, debug, getBuffOverflow, getBytesReceived, getBytesSent, getCertificateContainer, getConnectionId, getDataReceiver, getIO, getLastTransferTime, getLocalAddress, getLocalCertificate, getLocalPort, getPeerCertificate, getReadCounters, getRefObject, getRemoteAddress, getSessionData, getSocketChannel, getSocketInputSize, getStatistics, getTlsExporter, getTlsUniqueId, getTotalBuffOverflow, getTotalBytesReceived, getTotalBytesSent, getUniqueId, getWriteCounters, handleMalformedInput, handshakeCompleted, isConnected, isInputBufferEmpty, isSocketServiceReady, readBytes, readCompleted, readData, setBufferLimit, setCertificateContainer, setConnectionId, setDataReceiver, setIOServiceListener, setRefObject, setSessionData, setSocketServiceReady, setSslContextContainer, setX509TrustManagers, startSSL, startTLS, startZLib, waitingToRead, waitingToSend, waitingToSendSize, writeBytes, writeData
-
Field Details
-
ACK_NAME
- See Also:
-
CROSS_DOMAIN_POLICY_FILE_PROP_KEY
- See Also:
-
CROSS_DOMAIN_POLICY_FILE_PROP_VAL
- See Also:
-
DOM_HANDLER
Key name of the system property for configuration protection from system overload and DOS attack.- See Also:
-
ID_ATT
- See Also:
-
REQ_NAME
- See Also:
-
STREAM_CLOSING
- See Also:
-
writeInProgress
-
parser
-
processors
-
serviceListener
-
-
Constructor Details
-
XMPPIOService
public XMPPIOService()Creates a newXMPPIOServiceinstance.
-
-
Method Details
-
addPacketToSend
MethodaddPacketToSendadds new data which will be processed during next run. Data are kept in proper order like in FIFO queue.- Parameters:
packet- aPacketvalue of data to process.
-
call
-
checkBufferLimit
public boolean checkBufferLimit(int bufferSize) - Specified by:
checkBufferLimitin interfaceIOListener- Overrides:
checkBufferLimitin classIOService<RefObject>
-
checkData
- Throws:
IOException
-
clearWaitingPackets
public void clearWaitingPackets()Clears queue of packets waiting to send. In case of connection close this packets may be sent to offline store but some processors may want stop this from happening - for that they may use this method -
getWaitingPackets
Returns queue with packets waiting to send. For use by ConnectionManager which may need to get undelivered packets -
forceStop
public void forceStop() -
processWaitingPackets
- Specified by:
processWaitingPacketsin classIOService<RefObject>- Throws:
IOException
-
stop
public void stop() -
toString
-
writeRawData
- Throws:
IOException
-
xmppStreamOpen
-
getPacketsReceived
public long getPacketsReceived(boolean reset) -
getPacketsSent
public long getPacketsSent(boolean reset) -
getReceivedPackets
-
getTotalPacketsReceived
public long getTotalPacketsReceived() -
getTotalPacketsSent
public long getTotalPacketsSent() -
getAuthorisedUserJid
-
setAuthorisedUserJid
-
getUserJid
Deprecated. -
setUserJid
Deprecated. -
getWaitingForAct
-
getXMLNS
-
setXMLNS
-
setAckMode
public void setAckMode(boolean white_char_ack, boolean xmpp_ack, boolean strict) -
setElementLimits
public void setElementLimits(int limit) -
setIOServiceListener
-
setProcessors
-
getLastXmppPacketReceiveTime
public long getLastXmppPacketReceiveTime()This method returns the time when the last XMPP packet was received, it is used to help detect dead connections.- Returns:
longnumber denoting time when the last XMPP packet was received.
-
addReceivedPacket
MethodaddReceivedPacketputs processing results to queue. The processing results are usually data (messages) which has been just received from socket.- Parameters:
packet- aPacketvalue of processing results.
-
shouldCountPacket
-
prepareStreamClose
-
processSocketData
- Specified by:
processSocketDatain classIOService<RefObject>- Throws:
IOException
-
receivedPackets
protected int receivedPackets()- Specified by:
receivedPacketsin classIOService<RefObject>
-
xmppStreamClosed
protected void xmppStreamClosed() -
xmppStreamOpened
-
hasParsedElements
protected boolean hasParsedElements() -
moveParsedPacketsToReceived
protected void moveParsedPacketsToReceived(boolean sendAck)
-