Interface EngineSaslDriver
- All Known Implementing Classes:
ProtonEngineNoOpSaslDriver
When configured for SASL authentication the SASL driver provides a view of the current state of the authentication and allows for configuration of the SASL layer prior to the start of the authentication process. Once authentication is complete the driver provides a means of determining the outcome of process.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
The SASL driver state used to determine at what point the current SASL negotiation process is currently in. -
Method Summary
Modifier and TypeMethodDescriptionclient()
Configure thisEngineSaslDriver
to operate in client mode and return the associatedSaslClientContext
instance that should be used to complete the SASL negotiation with the server end.int
Provides a low level outcome value for the SASL authentication process.Returns a SaslState that indicates the current operating state of the SASL negotiation process or conversely if no SASL layer is configured this method should return the disabled state.server()
Configure thisEngineSaslDriver
to operate in server mode and return the associatedSaslServerContext
instance that should be used to complete the SASL negotiation with the client end.void
setMaxFrameSize
(int maxFrameSize) Set the maximum frame size the remote can send before an error is indicated.
-
Method Details
-
client
SaslClientContext client()Configure thisEngineSaslDriver
to operate in client mode and return the associatedSaslClientContext
instance that should be used to complete the SASL negotiation with the server end.- Returns:
- the SASL client context.
- Throws:
IllegalStateException
- if the engine is already in server mode or the engine has not been configure with SASL support.
-
server
SaslServerContext server()Configure thisEngineSaslDriver
to operate in server mode and return the associatedSaslServerContext
instance that should be used to complete the SASL negotiation with the client end.- Returns:
- the SASL server context.
- Throws:
IllegalStateException
- if the engine is already in client mode or the engine has not been configure with SASL support.
-
getSaslState
EngineSaslDriver.SaslState getSaslState()Returns a SaslState that indicates the current operating state of the SASL negotiation process or conversely if no SASL layer is configured this method should return the disabled state. This method must never return a null result.- Returns:
- the current state of SASL Authentication.
-
getSaslOutcome
SaslOutcome getSaslOutcome()Provides a low level outcome value for the SASL authentication process.If the SASL exchange is ongoing or the SASL layer was skipped because a particular engine configuration allows such behavior then this method should return null to indicate no SASL outcome is available.
- Returns:
- the SASL outcome code that results from authentication
-
getMaxFrameSize
int getMaxFrameSize()- Returns:
- the currently configured max frame size allowed for SASL frames.
-
setMaxFrameSize
void setMaxFrameSize(int maxFrameSize) Set the maximum frame size the remote can send before an error is indicated.The AMQP specification defines a default of 512 bytes for this value however in some cases this value is to small for the data needed in some SASL mechanisms. This allows the user to configure a larger acceptable value, the lowest possible value remains the default 512 bytes.
- Parameters:
maxFrameSize
- The maximum allowed frame size from the remote sender.
-