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 TypeMethodDescriptionvoidallowSkip(boolean allowSkip) Set whether servers may accept incoming connections that skip the SASL layer negotiation.voidclient()voiddone(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.voidhandle(SaslFrameBody frameBody, Binary payload) voidhandleChallenge(SaslChallenge saslChallenge, Binary payload, Void context) voidhandleInit(SaslInit saslInit, Binary payload, Void context) voidhandleMechanisms(SaslMechanisms saslMechanisms, Binary payload, Void context) voidhandleOutcome(SaslOutcome saslOutcome, Binary payload, Void context) voidhandleResponse(SaslResponse saslResponse, Binary payload, Void context) booleanisDone()intpending()Determine the size of the bytes available via recv().voidConfigure the SASL layer to use the "PLAIN" mechanism.final intrecv(byte[] bytes, int offset, int size) Read challenge/response/additional data sent from the peer.final intsend(byte[] bytes, int offset, int size) Send challenge/response/additional data to the peer.voidserver()voidsetListener(SaslListener saslListener) Adds a listener to receive notice of frames having arrived.voidsetMechanism(Symbol mechanism) voidsetMechanisms(String... mechanisms) Set the acceptable SASL mechanisms for the layer.voidsetRemoteHostname(String hostname) Set the remote hostname to indicate the host being connected to when sending a SaslInit to the server.voidsetResponse(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:SaslRead 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:SaslSend challenge/response/additional data to the peer. -
pending
public int pending()Description copied from interface:SaslDetermine the size of the bytes available via recv(). Returns the size in bytes available via recv(). -
getState
Description copied from interface:SaslAccess the current state of the layer. -
setMechanisms
Description copied from interface:SaslSet the acceptable SASL mechanisms for the layer.- Specified by:
setMechanismsin interfaceSasl- Parameters:
mechanisms- a list of acceptable SASL mechanisms
-
getRemoteMechanisms
Description copied from interface:SaslRetrieve the list of SASL mechanisms provided by the remote.- Specified by:
getRemoteMechanismsin interfaceSasl- Returns:
- the SASL mechanisms advertised by the remote
-
setMechanism
-
getChosenMechanism
-
setResponse
-
handle
-
handleInit
- Specified by:
handleInitin interfaceSaslFrameBody.SaslFrameBodyHandler<Void>
-
handleResponse
- Specified by:
handleResponsein interfaceSaslFrameBody.SaslFrameBodyHandler<Void>
-
done
Description copied from interface:SaslSet the outcome of SASL negotiation Used by the server to set the result of the negotiation process. -
handleMechanisms
- Specified by:
handleMechanismsin interfaceSaslFrameBody.SaslFrameBodyHandler<Void>
-
handleChallenge
- Specified by:
handleChallengein interfaceSaslFrameBody.SaslFrameBodyHandler<Void>
-
handleOutcome
- Specified by:
handleOutcomein interfaceSaslFrameBody.SaslFrameBodyHandler<Void>
-
plain
Description copied from interface:SaslConfigure 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:SaslRetrieve the outcome of SASL negotiation.- Specified by:
getOutcomein interfaceSasl
-
client
public void client() -
server
public void server() -
allowSkip
public void allowSkip(boolean allowSkip) Description copied from interface:SaslSet whether servers may accept incoming connections that skip the SASL layer negotiation. -
wrap
- Specified by:
wrapin interfaceTransportLayer
-
toString
-
getHostname
Description copied from interface:SaslRetrieve the hostname indicated by the client when sending its SaslInit.- Specified by:
getHostnamein interfaceSasl- Returns:
- the hostname indicated by the remote client, or null if none specified.
-
setRemoteHostname
Description copied from interface:SaslSet the remote hostname to indicate the host being connected to when sending a SaslInit to the server.- Specified by:
setRemoteHostnamein interfaceSasl
-
setListener
Description copied from interface:SaslAdds a listener to receive notice of frames having arrived.- Specified by:
setListenerin interfaceSasl
-