Package tigase.xmpp

Class XMPPIOService<RefObject>

    • Field Detail

      • CROSS_DOMAIN_POLICY_FILE_PROP_KEY

        public static final java.lang.String CROSS_DOMAIN_POLICY_FILE_PROP_KEY
        See Also:
        Constant Field Values
      • CROSS_DOMAIN_POLICY_FILE_PROP_VAL

        public static final java.lang.String CROSS_DOMAIN_POLICY_FILE_PROP_VAL
        See Also:
        Constant Field Values
      • DOM_HANDLER

        public static final java.lang.String DOM_HANDLER
        Key name of the system property for configuration protection from system overload and DOS attack.
        See Also:
        Constant Field Values
      • writeInProgress

        public java.util.concurrent.locks.ReentrantLock writeInProgress
    • Constructor Detail

      • XMPPIOService

        public XMPPIOService()
        Creates a new XMPPIOService instance.
    • Method Detail

      • addPacketToSend

        public void addPacketToSend​(Packet packet)
        Method addPacketToSend adds new data which will be processed during next run. Data are kept in proper order like in FIFO queue.
        Parameters:
        packet - a Packet value of data to process.
      • call

        public IOService<?> call()
                          throws java.io.IOException
        Specified by:
        call in interface java.util.concurrent.Callable<RefObject>
        Overrides:
        call in class IOService<RefObject>
        Throws:
        java.io.IOException
      • checkData

        public boolean checkData​(char[] data)
                          throws java.io.IOException
        Throws:
        java.io.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

        public java.util.Queue<Packet> getWaitingPackets()
        Returns queue with packets waiting to send. For use by ConnectionManager which may need to get undelivered packets
      • writeRawData

        public void writeRawData​(java.lang.String data)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • xmppStreamOpen

        public void xmppStreamOpen​(java.lang.String data)
      • getPacketsReceived

        public long getPacketsReceived​(boolean reset)
      • getPacketsSent

        public long getPacketsSent​(boolean reset)
      • getReceivedPackets

        public java.util.Queue<Packet> getReceivedPackets()
      • getTotalPacketsReceived

        public long getTotalPacketsReceived()
      • getTotalPacketsSent

        public long getTotalPacketsSent()
      • getUserJid

        public java.lang.String getUserJid()
      • setUserJid

        public void setUserJid​(java.lang.String jid)
      • getWaitingForAct

        public java.util.Map<java.lang.String,​Packet> getWaitingForAct()
      • getXMLNS

        public java.lang.String getXMLNS()
      • setXMLNS

        public void setXMLNS​(java.lang.String xmlns)
      • setAckMode

        public void setAckMode​(boolean white_char_ack,
                               boolean xmpp_ack,
                               boolean strict)
      • setElementLimits

        public void setElementLimits​(int limit)
      • setProcessors

        public void setProcessors​(XMPPIOProcessor[] processors)
      • 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:
        long number denoting time when the last XMPP packet was received.
      • addReceivedPacket

        protected void addReceivedPacket​(Packet packet)
        Method addReceivedPacket puts processing results to queue. The processing results are usually data (messages) which has been just received from socket.
        Parameters:
        packet - a Packet value of processing results.
      • prepareStreamClose

        protected java.lang.String prepareStreamClose()
      • processSocketData

        protected void processSocketData()
                                  throws java.io.IOException
        Specified by:
        processSocketData in class IOService<RefObject>
        Throws:
        java.io.IOException
      • xmppStreamClosed

        protected void xmppStreamClosed()
      • xmppStreamOpened

        protected void xmppStreamOpened​(java.util.Map<java.lang.String,​java.lang.String> attribs)
      • hasParsedElements

        protected boolean hasParsedElements()
      • moveParsedPacketsToReceived

        protected void moveParsedPacketsToReceived​(boolean sendAck)