Class SaslImpl
java.lang.Object
org.apache.qpid.proton.engine.impl.SaslImpl
- All Implemented Interfaces:
SaslFrameBody.SaslFrameBodyHandler<Void>
,TransportLayer
,Sasl
public class SaslImpl
extends Object
implements Sasl, SaslFrameBody.SaslFrameBodyHandler<Void>, TransportLayer
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.qpid.proton.engine.Sasl
Sasl.SaslOutcome, Sasl.SaslState
-
Field Summary
FieldsFields inherited from interface org.apache.qpid.proton.engine.Sasl
PN_SASL_AUTH, PN_SASL_NONE, PN_SASL_OK, PN_SASL_PERM, PN_SASL_SKIPPED, PN_SASL_SYS, PN_SASL_TEMP
-
Method Summary
Modifier and TypeMethodDescriptionvoid
allowSkip
(boolean allowSkip) Set whether servers may accept incoming connections that skip the SASL layer negotiation.void
client()
void
done
(Sasl.SaslOutcome outcome) Set the outcome of SASL negotiation Used by the server to set the result of the negotiation process.Retrieve the hostname indicated by the client when sending its SaslInit.Retrieve the outcome of SASL negotiation.String[]
Retrieve the list of SASL mechanisms provided by the remote.getState()
Access the current state of the layer.void
handle
(SaslFrameBody frameBody, Binary payload) void
handleChallenge
(SaslChallenge saslChallenge, Binary payload, Void context) void
handleInit
(SaslInit saslInit, Binary payload, Void context) void
handleMechanisms
(SaslMechanisms saslMechanisms, Binary payload, Void context) void
handleOutcome
(SaslOutcome saslOutcome, Binary payload, Void context) void
handleResponse
(SaslResponse saslResponse, Binary payload, Void context) boolean
isDone()
int
pending()
Determine the size of the bytes available via recv().void
Configure the SASL layer to use the "PLAIN" mechanism.final int
recv
(byte[] bytes, int offset, int size) Read challenge/response/additional data sent from the peer.final int
send
(byte[] bytes, int offset, int size) Send challenge/response/additional data to the peer.void
server()
void
setListener
(SaslListener saslListener) Adds a listener to receive notice of frames having arrived.void
setMechanism
(Symbol mechanism) void
setMechanisms
(String... mechanisms) Set the acceptable SASL mechanisms for the layer.void
setRemoteHostname
(String hostname) Set the remote hostname to indicate the host being connected to when sending a SaslInit to the server.void
setResponse
(Binary initialResponse) toString()
wrap
(TransportInput input, TransportOutput output)
-
Field Details
-
SASL_FRAME_TYPE
public static final byte SASL_FRAME_TYPE- See Also:
-
-
Method Details
-
isDone
public boolean isDone() -
recv
public final int recv(byte[] bytes, int offset, int size) Description copied from interface:Sasl
Read challenge/response/additional data sent from the peer. Use pending to determine the size of the data. -
send
public final int send(byte[] bytes, int offset, int size) Description copied from interface:Sasl
Send challenge/response/additional data to the peer. -
pending
public int pending()Description copied from interface:Sasl
Determine the size of the bytes available via recv(). Returns the size in bytes available via recv(). -
getState
Description copied from interface:Sasl
Access the current state of the layer. -
setMechanisms
Description copied from interface:Sasl
Set the acceptable SASL mechanisms for the layer.- Specified by:
setMechanisms
in interfaceSasl
- Parameters:
mechanisms
- a list of acceptable SASL mechanisms
-
getRemoteMechanisms
Description copied from interface:Sasl
Retrieve the list of SASL mechanisms provided by the remote.- Specified by:
getRemoteMechanisms
in interfaceSasl
- Returns:
- the SASL mechanisms advertised by the remote
-
setMechanism
-
getChosenMechanism
-
setResponse
-
handle
-
handleInit
- Specified by:
handleInit
in interfaceSaslFrameBody.SaslFrameBodyHandler<Void>
-
handleResponse
- Specified by:
handleResponse
in interfaceSaslFrameBody.SaslFrameBodyHandler<Void>
-
done
Description copied from interface:Sasl
Set the outcome of SASL negotiation Used by the server to set the result of the negotiation process. -
handleMechanisms
- Specified by:
handleMechanisms
in interfaceSaslFrameBody.SaslFrameBodyHandler<Void>
-
handleChallenge
- Specified by:
handleChallenge
in interfaceSaslFrameBody.SaslFrameBodyHandler<Void>
-
handleOutcome
- Specified by:
handleOutcome
in interfaceSaslFrameBody.SaslFrameBodyHandler<Void>
-
plain
Description copied from interface:Sasl
Configure the SASL layer to use the "PLAIN" mechanism. A utility function to configure a simple client SASL layer using PLAIN authentication. -
getOutcome
Description copied from interface:Sasl
Retrieve the outcome of SASL negotiation.- Specified by:
getOutcome
in interfaceSasl
-
client
public void client() -
server
public void server() -
allowSkip
public void allowSkip(boolean allowSkip) Description copied from interface:Sasl
Set whether servers may accept incoming connections that skip the SASL layer negotiation. -
wrap
- Specified by:
wrap
in interfaceTransportLayer
-
toString
-
getHostname
Description copied from interface:Sasl
Retrieve the hostname indicated by the client when sending its SaslInit.- Specified by:
getHostname
in interfaceSasl
- Returns:
- the hostname indicated by the remote client, or null if none specified.
-
setRemoteHostname
Description copied from interface:Sasl
Set the remote hostname to indicate the host being connected to when sending a SaslInit to the server.- Specified by:
setRemoteHostname
in interfaceSasl
-
setListener
Description copied from interface:Sasl
Adds a listener to receive notice of frames having arrived.- Specified by:
setListener
in interfaceSasl
-