Package rocks.xmpp.core.stream.model
Class StreamFeature
- java.lang.Object
-
- rocks.xmpp.core.stream.model.StreamFeature
-
- All Implemented Interfaces:
Comparable<StreamFeature>
- Direct Known Subclasses:
AdvancedMessageProcessing
,Bind
,CompressionFeature
,DialbackFeature
,EntityCapabilities1
,EntityCapabilities2
,Mechanisms
,RegisterFeature
,RosterVersioning
,Session
,StartTls
,StreamManagement
,SubscriptionPreApproval
public abstract class StreamFeature extends Object implements Comparable<StreamFeature>
A base class for a stream feature, which is advertised by the server in its<stream:features/>
element.
-
-
Constructor Summary
Constructors Constructor Description StreamFeature()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(StreamFeature o)
Compares two features by their priority and mandatory-to-negotiate flag.int
getPriority()
Gets the priority of the feature, i.e. when it will be negotiated during feature negotiation.boolean
isMandatory()
Indicates, whether this feature is mandatory to negotiate.boolean
requiresRestart()
If this feature requires a stream restart after it has been negotiated.
-
-
-
Method Detail
-
isMandatory
public boolean isMandatory()
Indicates, whether this feature is mandatory to negotiate. By default a feature is not mandatory. Override this method for mandatory-to-negotiate features.- Returns:
- True, if the feature is mandatory.
-
getPriority
public int getPriority()
Gets the priority of the feature, i.e. when it will be negotiated during feature negotiation.- Returns:
- The priority.
-
requiresRestart
public boolean requiresRestart()
If this feature requires a stream restart after it has been negotiated.- Returns:
- True, if a stream restart is required.
-
compareTo
public final int compareTo(StreamFeature o)
Compares two features by their priority and mandatory-to-negotiate flag.A
<features/>
element that contains both mandatory-to-negotiate and voluntary-to-negotiate features indicates that the negotiation is not complete but that the initiating entity MAY complete the voluntary-to-negotiate feature(s) before it attempts to negotiate the mandatory-to-negotiate feature(s).- Specified by:
compareTo
in interfaceComparable<StreamFeature>
- Parameters:
o
- The other feature.- Returns:
- The comparison result.
- See Also:
- XEP-0170: Recommended Order of Stream Feature Negotiation
-
-