Interface SaslServerContext
-
- All Superinterfaces:
SaslContext
public interface SaslServerContext extends SaslContext
SASL Server operating context used by anEngine
that has been configured as a SASL server or that has receiver an AMQP header thereby forcing it into becoming the server side of the SASL exchange.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.qpid.protonj2.engine.sasl.SaslContext
SaslContext.Role
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SaslServerListener
getListener()
SaslServerContext
saslFailure(javax.security.sasl.SaslException failure)
Allows the server implementation to fail the SASL negotiation process due to some unrecoverable error.SaslServerContext
sendChallenge(ProtonBuffer challenge)
Sends the SASL challenge defined by the SASL mechanism that is in use during this SASL negotiation.SaslServerContext
sendMechanisms(Symbol[] mechanisms)
Sends the set of supported mechanisms to the SASL client from which it must choose and return one mechanism which will then be the basis for the SASL authentication negotiation.SaslServerContext
sendOutcome(SaslOutcome outcome, ProtonBuffer additional)
Sends a response to a server side challenge that comprises the challenge / response exchange for the chosen SASL mechanism.SaslServerContext
setListener(SaslServerListener listener)
Sets theSaslServerListener
that will be used to driver the server side SASL negotiations with a connected "client".-
Methods inherited from interface org.apache.qpid.protonj2.engine.sasl.SaslContext
getAttachments, getChosenMechanism, getHostname, getRole, getSaslOutcome, getSaslState, getServerMechanisms, isClient, isDone, isServer
-
-
-
-
Method Detail
-
setListener
SaslServerContext setListener(SaslServerListener listener)
Sets theSaslServerListener
that will be used to driver the server side SASL negotiations with a connected "client". As the client initiates or responds to the various phases of the SASL negotiation theSaslServerListener
will be notified and allowed to respond.- Parameters:
listener
- TheSaslServerListener
to use for SASL negotiations, cannot be null.- Returns:
- this server context.
-
getListener
SaslServerListener getListener()
- Returns:
- the currently set
SaslServerListener
instance.
-
sendMechanisms
SaslServerContext sendMechanisms(Symbol[] mechanisms) throws EngineStateException
Sends the set of supported mechanisms to the SASL client from which it must choose and return one mechanism which will then be the basis for the SASL authentication negotiation.- Parameters:
mechanisms
- The mechanisms that this server supports.- Returns:
- this server context.
- Throws:
EngineStateException
- if the engine has already shutdown or failed while processing the mechanisms.
-
sendChallenge
SaslServerContext sendChallenge(ProtonBuffer challenge) throws EngineStateException
Sends the SASL challenge defined by the SASL mechanism that is in use during this SASL negotiation. The challenge is an opaque binary that is provided to the server by the security mechanism.- Parameters:
challenge
- The buffer containing the server challenge.- Returns:
- this server context.
- Throws:
EngineStateException
- if the engine has already shutdown or failed while sending the challenge.
-
sendOutcome
SaslServerContext sendOutcome(SaslOutcome outcome, ProtonBuffer additional) throws EngineStateException
Sends a response to a server side challenge that comprises the challenge / response exchange for the chosen SASL mechanism.- Parameters:
outcome
- The outcome of the SASL negotiation to be sent to the client.additional
- The additional bytes to be sent from the server along with the outcome.- Returns:
- this server context.
- Throws:
EngineStateException
- if the engine has already shutdown or failed while processing the outcome.
-
saslFailure
SaslServerContext saslFailure(javax.security.sasl.SaslException failure)
Allows the server implementation to fail the SASL negotiation process due to some unrecoverable error. Failing the process will signal theEngine
that the SASL process has failed and place the engine in a failed state as well as notify the registered error handler for theEngine
.- Parameters:
failure
- The exception to report to theEngine
that describes the failure.- Returns:
- this server context.
-
-