Package tigase.server.xmppclient
Class StreamManagementIOProcessor
java.lang.Object
tigase.server.xmppclient.StreamManagementIOProcessor
- All Implemented Interfaces:
XMPPIOProcessor
@Bean(name="urn:xmpp:sm:3",
parent=ClientConnectionManager.class,
active=true)
public class StreamManagementIOProcessor
extends Object
implements XMPPIOProcessor
Class implements XEP-0198 Stream Management
- Author:
- andrzej
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Counter class implements proper counter with overflow from 2^32-1 to 0static class
OutQueue class implements queue of outgoing packets waiting for ack with implementation of removing acked elements when id of acked packet is passedstatic class
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetId()
Returns identifier of processorvoid
getStatistics
(StatisticsList list) Returns statistics generated by this processorstatic boolean
isEnabled
(XMPPIOService service) Method returns true if XMPPIOService has enabled SM.protected boolean
protected StreamManagementIOProcessor.Counter
protected StreamManagementIOProcessor.OutQueue
void
packetsSent
(XMPPIOService service) Method is called when all waiting data was written to socket.void
processCommand
(XMPPIOService service, Packet pc) Process command execution which may be sent from other component and should be processed by processorboolean
processIncoming
(XMPPIOService service, Packet packet) Process packets read from socket as they are sent to SessionManager.boolean
processOutgoing
(XMPPIOService service, Packet packet) Process outgoing packets as they are added to XMPPIOService outgoing packets queue.boolean
serviceStopped
(XMPPIOService service, boolean streamClosed) Method called when XMPPIOService is closed.protected boolean
shouldRequestAck
(XMPPIOService service, StreamManagementIOProcessor.OutQueue outQueue) Override this method to define a custom behaviour for request ack.void
streamError
(XMPPIOService service, StreamError streamErrorName) Method called when XMPP stream error is about to be sentElement[]
supStreamFeatures
(XMPPIOService service) Returns array of features added by this processor
-
Field Details
-
XMLNS
- See Also:
-
-
Constructor Details
-
StreamManagementIOProcessor
public StreamManagementIOProcessor()
-
-
Method Details
-
isEnabled
Method returns true if XMPPIOService has enabled SM. -
getId
Description copied from interface:XMPPIOProcessor
Returns identifier of processor- Specified by:
getId
in interfaceXMPPIOProcessor
-
supStreamFeatures
Description copied from interface:XMPPIOProcessor
Returns array of features added by this processor- Specified by:
supStreamFeatures
in interfaceXMPPIOProcessor
-
processIncoming
Description copied from interface:XMPPIOProcessor
Process packets read from socket as they are sent to SessionManager.- Specified by:
processIncoming
in interfaceXMPPIOProcessor
- Returns:
- true if packet should not be forwarded
-
processOutgoing
Description copied from interface:XMPPIOProcessor
Process outgoing packets as they are added to XMPPIOService outgoing packets queue.- Specified by:
processOutgoing
in interfaceXMPPIOProcessor
- Returns:
- true if packet should be removed
-
packetsSent
Description copied from interface:XMPPIOProcessor
Method is called when all waiting data was written to socket.- Specified by:
packetsSent
in interfaceXMPPIOProcessor
- Throws:
IOException
-
processCommand
Description copied from interface:XMPPIOProcessor
Process command execution which may be sent from other component and should be processed by processor- Specified by:
processCommand
in interfaceXMPPIOProcessor
-
serviceStopped
Description copied from interface:XMPPIOProcessor
Method called when XMPPIOService is closed.- Specified by:
serviceStopped
in interfaceXMPPIOProcessor
- Returns:
- true if connecton manager should not be notified about stopping of this service
-
getStatistics
Description copied from interface:XMPPIOProcessor
Returns statistics generated by this processor- Specified by:
getStatistics
in interfaceXMPPIOProcessor
-
streamError
Description copied from interface:XMPPIOProcessor
Method called when XMPP stream error is about to be sent- Specified by:
streamError
in interfaceXMPPIOProcessor
-
shouldRequestAck
protected boolean shouldRequestAck(XMPPIOService service, StreamManagementIOProcessor.OutQueue outQueue) Override this method to define a custom behaviour for request ack. The default implementation will request an ack if there are more thanack_request_count
packets waiting since last request for ack and last ack request was not sent in last X ms. -
newCounter
-
newOutQueue
-
isStanza
-