public final class LoginResponseParser extends TargetMessageParser
This is a parser for the Login Response Message of the iSCSI Protocol (RFC3720). So it parses all the field of this login message and offers it fields with its getter methods.
The Login Response indicates the progress and/or end of the Login Phase.
T bit is set to 1 as an indicator of the end of the
stage. If the T bit is set to 1 and NSG is FullFeaturePhase, then this is also
the Final Login Response (see Chapter 5). A T bit of 0 indicates a "partial"
response, which means "more negotiation needed".
A Login Response with a T bit set to 1 MUST NOT contain key=value pairs that may
require additional answers from the initiator within the same stage.
A Login Response with a T bit set to 1 MUST NOT contain key=value pairs that may
require additional answers from the initiator within the same stage.
number + 1. This field is only
valid if the Status-Class is 0.
All the rules specified in Section 10.11.6 Text Response Data for text responses also hold for Login Responses. Keys and their explanations are listed in Chapter 11 (security negotiation keys) and Chapter 12 (operational parameter negotiation keys). All keys in Chapter 12, except for the X extension formats, MUST be supported by iSCSI initiators and targets. Keys in Chapter 11, only need to be supported when the function to which they refer is mandatory to implement.
expectedCommandSequenceNumber, maximumCommandSequenceNumber, statusSequenceNumberlogicalUnitNumber, protocolDataUnit| Constructor and Description |
|---|
LoginResponseParser(ProtocolDataUnit initProtocolDataUnit)
Default constructor, creates a new, empty
LoginResponseParser object. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canHaveDigests()
If this method returns
true, then it indicates that this
derived AbstractMessageParser instance can be protected by a
digest. |
protected void |
checkIntegrity()
This method checks, if all parsed fields are valid.
|
void |
clear()
This method sets all settings to their initial values.
|
protected void |
deserializeBytes12to15(int line)
Parse the bytes
12 till 15 in the Basic Header
Segment. |
protected void |
deserializeBytes1to3(int line)
Parse the bytes
1 till 3 in the Basic Header
Segment. |
protected void |
deserializeBytes36to39(int line)
Parse the bytes
36 till 39 in the Basic Header
Segment. |
int |
getActiveVersion()
Indicates the highest version supported by the target and initiator.
|
LoginStage |
getCurrentStageNumber()
Returns the Current Stage Number of this Login Response Message.
|
DataSegmentFactory.DataSegmentFormat |
getDataSegmentFormat()
If this method returns
true, hen it indicates that the data
segment data is interpreted as binary data. |
ISID |
getInitiatorSessionID()
Returns the Initiator Session ID (ISID) of this LoginResponseParser
object.
|
int |
getMaxVersion()
This is the highest version number supported by the target.
|
LoginStage |
getNextStageNumber()
Returns the Next Stage Number of this Login Response Message.
|
LoginStatus |
getStatus()
The Status returned in a Login Response indicates the execution status of
the Login Phase.
|
short |
getTargetSessionIdentifyingHandle()
The TSIH is the target assigned session identifying handle.
|
boolean |
isContinueFlag()
When set to
1, indicates that the text (set of key=value
pairs) in this Login Response is not complete (it will be continued on
subsequent Login Responses); otherwise, it indicates that this Login
Response ends a set of key=value pairs. |
protected int |
serializeBytes1to3()
Serializes the bytes
1 till 3 in the Basic
Header Segment. |
protected int |
serializeBytes36to39()
Serializes the bytes
36 till 39 in the Basic
Header Segment. |
void |
setContinueFlag(boolean continueFlag) |
void |
setCurrentStageNumber(LoginStage currentStage) |
void |
setInitiatorSessionID(ISID initiatorSessionID) |
void |
setNextStageNumber(LoginStage nextStage) |
void |
setStatus(LoginStatus status) |
void |
setTargetSessionIdentifyingHandle(short targetSessionIdentifyingHandle) |
String |
toString()
This method concatenate all the fields of a derived parser to allow an
easy generation of debug informations.
|
deserializeBytes20to23, deserializeBytes24to27, deserializeBytes28to31, deserializeBytes32to35, deserializeBytes40to43, deserializeBytes44to47, getExpectedCommandSequenceNumber, getMaximumCommandSequenceNumber, getShortInfo, getStatusSequenceNumber, incrementSequenceNumber, serializeBytes20to23, serializeBytes24to27, serializeBytes28to31, serializeBytes32to35, serializeBytes40to43, serializeBytes44to47, setExpectedCommandSequenceNumber, setMaximumCommandSequenceNumber, setStatusSequenceNumbercanContainAdditionalHeaderSegments, deserializeBytes8to11, getLogicalUnitNumber, serializeBytes12to15, serializeBytes8to11, setLogicalUnitNumberpublic LoginResponseParser(ProtocolDataUnit initProtocolDataUnit)
LoginResponseParser object.initProtocolDataUnit - The reference ProtocolDataUnit instance, which
contains this LoginResponseParser subclass
object.public final String toString()
toString in class TargetMessageParserpublic final void clear()
clear in class TargetMessageParserpublic final DataSegmentFactory.DataSegmentFormat getDataSegmentFormat()
true, hen it indicates that the data
segment data is interpreted as binary data. Else the data segment data
must be interpreted as Text Format.getDataSegmentFormat in class AbstractMessageParserDataSegmentFactory.DataSegmentFormatpublic final boolean canHaveDigests()
true, then it indicates that this
derived AbstractMessageParser instance can be protected by a
digest.canHaveDigests in class AbstractMessageParsertrue, if the ProtocolDataUnit can be protected by a
header and/or a data digest. Else false.public final LoginStatus getStatus()
0 Status-Class indicates success.
A non-zero Status-Class indicates an exception. In this case, Status-Class is sufficient for a simple initiator to use when handling exceptions, without having to look at the Status-Detail. The Status-Detail allows finer-grained exception handling for more sophisticated initiators and for better information for logging.
public final boolean isContinueFlag()
1, indicates that the text (set of key=value
pairs) in this Login Response is not complete (it will be continued on
subsequent Login Responses); otherwise, it indicates that this Login
Response ends a set of key=value pairs. A Login Response with the C bit set to
1 MUST have the T bit
set to 0.LoginResponseParser object.public final LoginStage getCurrentStageNumber()
LoginStagepublic final ISID getInitiatorSessionID()
ISIDpublic final int getMaxVersion()
All Login Responses within the Login Phase MUST carry the same Version-max.
The initiator MUST use the value presented as a response to the first Login Request.
public final int getActiveVersion()
If the target does not support a version within the range specified by the initiator, the target rejects the login and this field indicates the lowest version supported by the target.
All Login Responses within the Login Phase MUST carry the same Version-active.
The initiator MUST use the value presented as a response to the first Login Request.
LoginResponseParser object.public final LoginStage getNextStageNumber()
LoginStagepublic final short getTargetSessionIdentifyingHandle()
0 that is
reserved. With the exception of the Login
Final-Response in a new session, this field should be set to the TSIH
provided by the initiator in the Login Request. For a new session, the
target MUST generate a non-zero TSIH and ONLY return it in the Login
Final-Response (see Section 5.3 Login Phase).LoginResponseParser object.public void setStatus(LoginStatus status)
public void setContinueFlag(boolean continueFlag)
public void setCurrentStageNumber(LoginStage currentStage)
public void setNextStageNumber(LoginStage nextStage)
public void setInitiatorSessionID(ISID initiatorSessionID)
public void setTargetSessionIdentifyingHandle(short targetSessionIdentifyingHandle)
protected final void deserializeBytes1to3(int line)
throws InternetSCSIException
1 till 3 in the Basic Header
Segment.deserializeBytes1to3 in class TargetMessageParserline - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected final void deserializeBytes12to15(int line)
throws InternetSCSIException
12 till 15 in the Basic Header
Segment.deserializeBytes12to15 in class AbstractMessageParserline - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected final void deserializeBytes36to39(int line)
throws InternetSCSIException
36 till 39 in the Basic Header
Segment.deserializeBytes36to39 in class TargetMessageParserline - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected final void checkIntegrity()
throws InternetSCSIException
checkIntegrity in class AbstractMessageParserInternetSCSIException - If the integrity is violated.protected final int serializeBytes1to3()
1 till 3 in the Basic
Header Segment.serializeBytes1to3 in class TargetMessageParserprotected final int serializeBytes36to39()
36 till 39 in the Basic
Header Segment.serializeBytes36to39 in class TargetMessageParserCopyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.