Class SaslInitFrame
- java.lang.Object
-
- com.swiftmq.amqp.v100.transport.AMQPFrame
-
- com.swiftmq.amqp.v100.generated.security.sasl.SaslInitFrame
-
- All Implemented Interfaces:
SaslFrameIF
,FrameIF
,Writable
public class SaslInitFrame extends AMQPFrame implements SaslFrameIF
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
Fields Modifier and Type Field Description AMQPDescribedConstructor
codeConstructor
static long
DESCRIPTOR_CODE
static java.lang.String
DESCRIPTOR_NAME
AMQPDescribedConstructor
nameConstructor
-
Fields inherited from class com.swiftmq.amqp.v100.transport.AMQPFrame
HEADER_SIZE, TYPE_CODE_AMQP_FRAME, TYPE_CODE_SASL_FRAME
-
-
Constructor Summary
Constructors Constructor Description SaslInitFrame(int channel)
Constructs a SaslInitFrame.SaslInitFrame(int channel, AMQPList body)
Constructs a SaslInitFrame.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(SaslFrameVisitor visitor)
Accept method for a SaslFrame visitor.AMQPString
getHostname()
Returns the optional Hostname field.AMQPBinary
getInitialResponse()
Returns the optional InitialResponse field.AMQPSymbol
getMechanism()
Returns the mandatory Mechanism field.int
getPredictedSize()
Returns the predicted size of this SaslInitFrame.java.lang.String
getValueString()
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.java.lang.String
toString()
protected void
writeBody(java.io.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 Detail
-
DESCRIPTOR_NAME
public static java.lang.String DESCRIPTOR_NAME
-
DESCRIPTOR_CODE
public static long DESCRIPTOR_CODE
-
codeConstructor
public AMQPDescribedConstructor codeConstructor
-
nameConstructor
public AMQPDescribedConstructor nameConstructor
-
-
Constructor Detail
-
SaslInitFrame
public SaslInitFrame(int channel, AMQPList body) throws java.lang.Exception
Constructs a SaslInitFrame.- Parameters:
channel
- the channel idbody
- the frame body- Throws:
java.lang.Exception
-
SaslInitFrame
public SaslInitFrame(int channel)
Constructs a SaslInitFrame.- Parameters:
channel
- the channel id
-
-
Method Detail
-
accept
public void accept(SaslFrameVisitor visitor)
Accept method for a SaslFrame visitor.- Specified by:
accept
in interfaceSaslFrameIF
- Overrides:
accept
in classAMQPFrame
- Parameters:
visitor
- SaslFrame visitor
-
getMechanism
public AMQPSymbol getMechanism()
Returns the mandatory Mechanism field.- Returns:
- Mechanism
-
setMechanism
public void setMechanism(AMQPSymbol mechanism)
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
public AMQPBinary getInitialResponse()
Returns the optional InitialResponse field.- Returns:
- InitialResponse
-
setInitialResponse
public void setInitialResponse(AMQPBinary initialResponse)
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
public AMQPString getHostname()
Returns the optional Hostname field.- Returns:
- Hostname
-
setHostname
public void setHostname(AMQPString hostname)
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
protected void writeBody(java.io.DataOutput out) throws java.io.IOException
-
getValueString
public java.lang.String 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
-
-