public abstract class TargetLoginStage extends TargetStage
TargetLoginPhase (see
TargetConnection for a description of
the relationship between sessions, connections, phases and sessions), namely
the LoginOperationalParameterNegotiationStage and the SecurityNegotiationStage.
The stage is started by calling the TargetStage.execute(ProtocolDataUnit) method with the first
ProtocolDataUnit to be processed as part of the stage.
Of equal importance is the getNextStageNumber() method, which must be used to find out which stage
or phase will follow this one.
| Modifier and Type | Field and Description |
|---|---|
protected int |
initiatorTaskTag
An identifier used by the initiator to identify the login task.
|
protected ConnectionSettingsNegotiator |
negotiator
Manages the text parameter negotiation.
|
protected LoginStage |
nextStageNumber
A stage number describing which stage must follow this stage.
|
protected LoginStage |
requestedNextStageNumber
A stage number describing which stage the initiator wants to transition
to.
|
protected LoginStage |
stageNumber
The stage number used for describing this stage in Login Request PDUs.
|
connection, session, settings, targetPhase| Constructor and Description |
|---|
TargetLoginStage(TargetLoginPhase targetLoginPhase,
LoginStage stageNumber)
The abstract constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkPdu(ProtocolDataUnit pdu)
Returns
true, if and only if the specified PDU is a Login
Request PDU and the CSN and InitiatorTaskTag fields check out. |
LoginStage |
getNextStageNumber()
Returns a stage number describing which stage of phase must follow this
stage, or
null if the initiator is not allowed to transition
any further. |
protected String |
receivePduSequence()
Receives a sequence of Login Request PDUs (as indicated by the
LoginRequestParser.isContinueFlag() and returns the concatenated
content of the text data segments. |
protected String |
receivePduSequence(ProtocolDataUnit pdu)
Receives a sequence of Login Request PDUs (as indicated by the
LoginRequestParser.isContinueFlag() and returns the concatenated
content of the text data segments. |
protected void |
sendPduSequence(String keyValuePairs,
LoginStage nextStage)
Sends a Login Response PDU sequence containing the specified
key-value pairs.
|
protected void |
sendRejectPdu(LoginStatus errorStatus)
Sends a Login Response PDU informing the initiator that an error has
occurred and that the connection must be closed.
|
execute, getConnectionprotected final ConnectionSettingsNegotiator negotiator
protected final LoginStage stageNumber
protected int initiatorTaskTag
protected LoginStage requestedNextStageNumber
stageNumberprotected LoginStage nextStageNumber
This value is initialized with null, and will be changed in
TargetStage.execute(ProtocolDataUnit), if the stage was finished successfully.
stageNumberpublic TargetLoginStage(TargetLoginPhase targetLoginPhase, LoginStage stageNumber)
targetLoginPhase - the phase this stage is a part ofstageNumber - the stage number used for describing this stage in Login
Request PDUsprotected boolean checkPdu(ProtocolDataUnit pdu)
true, if and only if the specified PDU is a Login
Request PDU and the CSN and InitiatorTaskTag fields check out.pdu - the PDU to checktrue if the PDU checks outprotected final String receivePduSequence() throws DigestException, InternetSCSIException, IOException, SettingsException, InterruptedException
LoginRequestParser.isContinueFlag() and returns the concatenated
content of the text data segments.DigestExceptionInternetSCSIExceptionIOExceptionSettingsExceptionInterruptedExceptionprotected final String receivePduSequence(ProtocolDataUnit pdu) throws InternetSCSIException, InterruptedException, IOException, DigestException, SettingsException
LoginRequestParser.isContinueFlag() and returns the concatenated
content of the text data segments.pdu - the first PDU of the sequenceInternetSCSIExceptionInterruptedExceptionIOExceptionDigestExceptionSettingsExceptionprotected final void sendPduSequence(String keyValuePairs, LoginStage nextStage) throws SettingsException, InterruptedException, IOException, InternetSCSIException, DigestException
keyValuePairs - contains key-value pairs to sendnextStage - indicates if the target is willing to transition to a
different stageSettingsExceptionInterruptedExceptionIOExceptionInternetSCSIExceptionDigestExceptionprotected final void sendRejectPdu(LoginStatus errorStatus) throws InterruptedException, IOException, InternetSCSIException
errorStatus - hints to the cause of the errorInterruptedExceptionIOExceptionInternetSCSIExceptionpublic final LoginStage getNextStageNumber()
null if the initiator is not allowed to transition
any further.nullCopyright © 2012 University of Konstanz, Distributed Systems Group. All Rights Reserved.