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 java.lang.Object implements XMPPIOProcessor
Class implements XEP-0198 Stream Management- Author:
- andrzej
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStreamManagementIOProcessor.CounterCounter class implements proper counter with overflow from 2^32-1 to 0static classStreamManagementIOProcessor.OutQueueOutQueue class implements queue of outgoing packets waiting for ack with implementation of removing acked elements when id of acked packet is passed
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringXMLNS
-
Constructor Summary
Constructors Constructor Description StreamManagementIOProcessor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetId()Returns identifier of processorvoidgetStatistics(StatisticsList list)Returns statistics generated by this processorstatic booleanisEnabled(XMPPIOService service)Method returns true if XMPPIOService has enabled SM.protected StreamManagementIOProcessor.CounternewCounter()protected StreamManagementIOProcessor.OutQueuenewOutQueue()voidpacketsSent(XMPPIOService service)Method is called when all waiting data was written to socket.voidprocessCommand(XMPPIOService service, Packet pc)Process command execution which may be sent from other component and should be processed by processorbooleanprocessIncoming(XMPPIOService service, Packet packet)Process packets read from socket as they are sent to SessionManager.booleanprocessOutgoing(XMPPIOService service, Packet packet)Process outgoing packets as they are added to XMPPIOService outgoing packets queue.booleanserviceStopped(XMPPIOService service, boolean streamClosed)Method called when XMPPIOService is closed.protected booleanshouldRequestAck(XMPPIOService service, StreamManagementIOProcessor.OutQueue outQueue)Override this method to define a custom behaviour for request ack.voidstreamError(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 Detail
-
XMLNS
public static final java.lang.String XMLNS
- See Also:
- Constant Field Values
-
-
Method Detail
-
isEnabled
public static boolean isEnabled(XMPPIOService service)
Method returns true if XMPPIOService has enabled SM.
-
getId
public java.lang.String getId()
Description copied from interface:XMPPIOProcessorReturns identifier of processor- Specified by:
getIdin interfaceXMPPIOProcessor
-
supStreamFeatures
public Element[] supStreamFeatures(XMPPIOService service)
Description copied from interface:XMPPIOProcessorReturns array of features added by this processor- Specified by:
supStreamFeaturesin interfaceXMPPIOProcessor
-
processIncoming
public boolean processIncoming(XMPPIOService service, Packet packet)
Description copied from interface:XMPPIOProcessorProcess packets read from socket as they are sent to SessionManager.- Specified by:
processIncomingin interfaceXMPPIOProcessor- Returns:
- true if packet should not be forwarded
-
processOutgoing
public boolean processOutgoing(XMPPIOService service, Packet packet)
Description copied from interface:XMPPIOProcessorProcess outgoing packets as they are added to XMPPIOService outgoing packets queue.- Specified by:
processOutgoingin interfaceXMPPIOProcessor- Returns:
- true if packet should be removed
-
packetsSent
public void packetsSent(XMPPIOService service) throws java.io.IOException
Description copied from interface:XMPPIOProcessorMethod is called when all waiting data was written to socket.- Specified by:
packetsSentin interfaceXMPPIOProcessor- Throws:
java.io.IOException
-
processCommand
public void processCommand(XMPPIOService service, Packet pc)
Description copied from interface:XMPPIOProcessorProcess command execution which may be sent from other component and should be processed by processor- Specified by:
processCommandin interfaceXMPPIOProcessor
-
serviceStopped
public boolean serviceStopped(XMPPIOService service, boolean streamClosed)
Description copied from interface:XMPPIOProcessorMethod called when XMPPIOService is closed.- Specified by:
serviceStoppedin interfaceXMPPIOProcessor- Returns:
- true if connecton manager should not be notified about stopping of this service
-
getStatistics
public void getStatistics(StatisticsList list)
Description copied from interface:XMPPIOProcessorReturns statistics generated by this processor- Specified by:
getStatisticsin interfaceXMPPIOProcessor
-
streamError
public void streamError(XMPPIOService service, StreamError streamErrorName)
Description copied from interface:XMPPIOProcessorMethod called when XMPP stream error is about to be sent- Specified by:
streamErrorin 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_countpackets waiting, so you probably want to OR your behaviour with this.
-
newCounter
protected StreamManagementIOProcessor.Counter newCounter()
-
newOutQueue
protected StreamManagementIOProcessor.OutQueue newOutQueue()
-
-