Package org.jivesoftware.openfire.csi
Class CsiManager
java.lang.Object
org.jivesoftware.openfire.csi.CsiManager
Handles Client State Indication nonzas for one particular client session.
- Author:
- Guus der Kinderen, guus@goodbytes.nl
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic SystemProperty<Boolean>Determines if 'unimportant' stanzas are delayed for a client that is inactive.static SystemProperty<Duration>Determines the maximum duration of stanzas being delayed for a client that is inactive.static SystemProperty<Integer>Determines the maximum length of the queue that holds delayed stanzas.static SystemProperty<Boolean>Controls if Client State Indication functionality is made available to clients.static final org.slf4j.Loggerstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Switch to the client state of 'active'.voidSwitch to the client state of 'inactive'.intReturns the number of stanzas that are currently in the delay queue.booleanisActive()Returns the client state for the session that is being tracked by this instance, either 'true' for 'active', or 'false' for 'inactive'static booleanisCsiNonza(org.dom4j.Element fragment) Checks if an XML fragment is recognized as a CSI nonzastatic booleanisStreamManagementNonza(org.dom4j.Element fragment) Deprecated, for removal: This API element is subject to removal in a future version.voidprocess(org.dom4j.Element nonza) Processes a CSI nonza.List<org.xmpp.packet.Packet>queueOrPush(org.xmpp.packet.Packet packet) Queues an unimportant stanza for later delivery, or returns the entire queue (including the argument) to be sent to the client.
-
Field Details
-
Log
public static final org.slf4j.Logger Log -
ENABLED
Controls if Client State Indication functionality is made available to clients. -
DELAY_ENABLED
Determines if 'unimportant' stanzas are delayed for a client that is inactive. -
DELAY_MAX_DURATION
Determines the maximum duration of stanzas being delayed for a client that is inactive. -
DELAY_QUEUE_CAPACITY
Determines the maximum length of the queue that holds delayed stanzas. -
NAMESPACE
- See Also:
-
-
Constructor Details
-
CsiManager
-
-
Method Details
-
process
public void process(@Nonnull org.dom4j.Element nonza) Processes a CSI nonza.- Parameters:
nonza- The CSI nonza to be processed.
-
activate
public void activate()Switch to the client state of 'active'. -
deactivate
public void deactivate()Switch to the client state of 'inactive'. -
isActive
public boolean isActive()Returns the client state for the session that is being tracked by this instance, either 'true' for 'active', or 'false' for 'inactive'- Returns:
- a client state indication
-
getDelayQueueSize
public int getDelayQueueSize()Returns the number of stanzas that are currently in the delay queue.- Returns:
- the number of delayed stanzas.
-
queueOrPush
Queues an unimportant stanza for later delivery, or returns the entire queue (including the argument) to be sent to the client.- Parameters:
packet- the stanza to process.- Returns:
- stanzas to be delivered to the client (possibly empty).
-
isCsiNonza
public static boolean isCsiNonza(@Nullable org.dom4j.Element fragment) Checks if an XML fragment is recognized as a CSI nonza- Parameters:
fragment- the XML to evaluate- Returns:
- true if the XML is recognized as a CSI nonza, otherwise false.
-
isStreamManagementNonza
@Deprecated(forRemoval=true, since="5.1.0") public static boolean isStreamManagementNonza(@Nullable org.dom4j.Element fragment) Deprecated, for removal: This API element is subject to removal in a future version.Replaced byisCsiNonza(Element)
-
isCsiNonza(Element)