Class SaslInitFrame
- All Implemented Interfaces:
SaslFrameIF
,FrameIF
,Writable
Selects the sasl mechanism and provides the initial response if needed.
- Version:
- AMQP Version v100. Generation Date: Wed Apr 18 14:09:32 CEST 2012
- Author:
- IIT Software GmbH, Bremen/Germany, (c) 2012, All Rights Reserved
-
Field Summary
FieldsFields inherited from class com.swiftmq.amqp.v100.transport.AMQPFrame
HEADER_SIZE, TYPE_CODE_AMQP_FRAME, TYPE_CODE_SASL_FRAME
-
Constructor Summary
ConstructorsConstructorDescriptionSaslInitFrame
(int channel) Constructs a SaslInitFrame.SaslInitFrame
(int channel, AMQPList body) Constructs a SaslInitFrame. -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(SaslFrameVisitor visitor) Accept method for a SaslFrame visitor.Returns the optional Hostname field.Returns the optional InitialResponse field.Returns the mandatory Mechanism field.int
Returns the predicted size of this SaslInitFrame.Returns a value representation of this SaslInitFrame.void
setHostname
(AMQPString hostname) Sets the optional Hostname field.void
setInitialResponse
(AMQPBinary initialResponse) Sets the optional InitialResponse field.void
setMechanism
(AMQPSymbol mechanism) Sets the mandatory Mechanism field.toString()
protected void
writeBody
(DataOutput out) Methods inherited from class com.swiftmq.amqp.v100.transport.AMQPFrame
accept, addMorePayload, getCallback, getChannel, getMorePayloads, getPayload, getPayloadLength, getSemaphore, setCallback, setChannel, setPayload, setSemaphore, setTypeCode, writeContent
-
Field Details
-
DESCRIPTOR_NAME
-
DESCRIPTOR_CODE
public static long DESCRIPTOR_CODE -
codeConstructor
-
nameConstructor
-
-
Constructor Details
-
SaslInitFrame
Constructs a SaslInitFrame.- Parameters:
channel
- the channel idbody
- the frame body- Throws:
Exception
-
SaslInitFrame
public SaslInitFrame(int channel) Constructs a SaslInitFrame.- Parameters:
channel
- the channel id
-
-
Method Details
-
accept
Accept method for a SaslFrame visitor.- Specified by:
accept
in interfaceSaslFrameIF
- Overrides:
accept
in classAMQPFrame
- Parameters:
visitor
- SaslFrame visitor
-
getMechanism
Returns the mandatory Mechanism field.- Returns:
- Mechanism
-
setMechanism
Sets the mandatory Mechanism field.The name of the SASL mechanism used for the SASL exchange. If the selected mechanism is not supported by the receiving peer, it MUST close the connection with the authentication-failure close-code. Each peer MUST authenticate using the highest-level security profile it can handle from the list provided by the partner.
- Parameters:
mechanism
- Mechanism
-
getInitialResponse
Returns the optional InitialResponse field.- Returns:
- InitialResponse
-
setInitialResponse
Sets the optional InitialResponse field.A block of opaque data passed to the security mechanism. The contents of this data are defined by the SASL security mechanism.
- Parameters:
initialResponse
- InitialResponse
-
getHostname
Returns the optional Hostname field.- Returns:
- Hostname
-
setHostname
Sets the optional Hostname field.The DNS name of the host (either fully qualified or relative) to which the sending peer is connecting. It is not mandatory to provide the hostname. If no hostname is provided the receiving peer should select a default based on its own configuration.
This field can be used by AMQP proxies to determine the correct back-end service to connect the client to, and to determine the domain to validate the client's credentials against.
This field may already have been specified by the server name indication extension as described in RFC-4366 [ RFC4366 ], if a TLS layer is used, in which case this field SHOULD either be null or contain the same value. It is undefined what a different value to those already specified means.
- Parameters:
hostname
- Hostname
-
getPredictedSize
public int getPredictedSize()Returns the predicted size of this SaslInitFrame. The predicted size may be greater than the actual size but it can never be less.- Specified by:
getPredictedSize
in interfaceFrameIF
- Specified by:
getPredictedSize
in interfaceSaslFrameIF
- Overrides:
getPredictedSize
in classAMQPFrame
- Returns:
- predicted size
-
writeBody
- Specified by:
writeBody
in classAMQPFrame
- Throws:
IOException
-
getValueString
Returns a value representation of this SaslInitFrame.- Specified by:
getValueString
in interfaceFrameIF
- Specified by:
getValueString
in interfaceSaslFrameIF
- Overrides:
getValueString
in classAMQPFrame
- Returns:
- value representation
-
toString
-