Package rocks.xmpp.core.stream.server
Class ServerStreamFeaturesManager
- java.lang.Object
-
- rocks.xmpp.core.stream.server.ServerStreamFeaturesManager
-
public final class ServerStreamFeaturesManager extends Object
Negotiates stream features from a server perspective.Each feature which shall be advertised during stream negotiation, must be registered first.
- See Also:
StreamFeatureProvider
-
-
Constructor Summary
Constructors Constructor Description ServerStreamFeaturesManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<StreamFeature>getStreamFeatures()Gets the stream features which shall be advertised.StreamNegotiationResulthandleElement(StreamElement element)Handles an inbound element and tries to find a negotiator which feels responsible to negotiate the element.voidregisterStreamFeatureProvider(StreamFeatureProvider<? extends StreamFeature> streamFeatureProvider)Registers a stream feature negotiator.
-
-
-
Method Detail
-
registerStreamFeatureProvider
public final void registerStreamFeatureProvider(StreamFeatureProvider<? extends StreamFeature> streamFeatureProvider)
Registers a stream feature negotiator.- Parameters:
streamFeatureProvider- The negotiator.
-
getStreamFeatures
public final Collection<StreamFeature> getStreamFeatures()
Gets the stream features which shall be advertised. Different stream features may be advertised during different phases of the stream negotiation. E.g. the first and only feature should be STARTTLS, then SASL and only then Resource Binding.- Returns:
- The stream features.
-
handleElement
public final StreamNegotiationResult handleElement(StreamElement element) throws StreamNegotiationException
Handles an inbound element and tries to find a negotiator which feels responsible to negotiate the element.- Parameters:
element- The stream element.- Returns:
- The negotiation result. If no negotiator was found returns
StreamNegotiationResult.IGNORE - Throws:
StreamNegotiationException
-
-