public abstract class TargetLoginStage extends TargetStage
TargetLoginPhase
(see Connection
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 org.jscsi.parser.login.LoginStage |
nextStageNumber
A stage number describing which stage must follow this stage.
|
protected org.jscsi.parser.login.LoginStage |
requestedNextStageNumber
A stage number describing which stage the initiator wants to transition to.
|
protected org.jscsi.parser.login.LoginStage |
stageNumber
The stage number used for describing this stage in Login Request PDUs.
|
connection, session, settings, targetPhase
Constructor and Description |
---|
TargetLoginStage(TargetLoginPhase targetLoginPhase,
org.jscsi.parser.login.LoginStage stageNumber)
The abstract constructor.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkPdu(org.jscsi.parser.ProtocolDataUnit pdu)
Returns
true , if and only if the specified PDU is a Login Request PDU and the CSN and
InitiatorTaskTag fields check out. |
org.jscsi.parser.login.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(org.jscsi.parser.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,
org.jscsi.parser.login.LoginStage nextStage)
Sends a Login Response PDU sequence containing the specified key-value pairs.
|
protected void |
sendRejectPdu(org.jscsi.parser.login.LoginStatus errorStatus)
Sends a Login Response PDU informing the initiator that an error has occurred and that the connection must be
closed.
|
execute, getConnection
protected final ConnectionSettingsNegotiator negotiator
protected final org.jscsi.parser.login.LoginStage stageNumber
LoginRequestParser.getCurrentStageNumber()
,
LoginRequestParser.getNextStageNumber()
protected int initiatorTaskTag
protected org.jscsi.parser.login.LoginStage requestedNextStageNumber
stageNumber
protected org.jscsi.parser.login.LoginStage nextStageNumber
This value is initialized with null
, and will be changed in TargetStage.execute(ProtocolDataUnit)
, if
the stage was finished successfully.
stageNumber
public TargetLoginStage(TargetLoginPhase targetLoginPhase, org.jscsi.parser.login.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(org.jscsi.parser.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, org.jscsi.exception.InternetSCSIException, IOException, SettingsException, InterruptedException
LoginRequestParser.isContinueFlag()
and
returns the concatenated content of the text data segments.DigestException
org.jscsi.exception.InternetSCSIException
IOException
SettingsException
InterruptedException
protected final String receivePduSequence(org.jscsi.parser.ProtocolDataUnit pdu) throws org.jscsi.exception.InternetSCSIException, InterruptedException, IOException, DigestException, SettingsException
LoginRequestParser.isContinueFlag()
and
returns the concatenated content of the text data segments.pdu
- the first PDU of the sequenceorg.jscsi.exception.InternetSCSIException
InterruptedException
IOException
DigestException
SettingsException
protected final void sendPduSequence(String keyValuePairs, org.jscsi.parser.login.LoginStage nextStage) throws SettingsException, InterruptedException, IOException, org.jscsi.exception.InternetSCSIException, DigestException
keyValuePairs
- contains key-value pairs to sendnextStage
- indicates if the target is willing to transition to a different stageSettingsException
InterruptedException
IOException
org.jscsi.exception.InternetSCSIException
DigestException
protected final void sendRejectPdu(org.jscsi.parser.login.LoginStatus errorStatus) throws InterruptedException, IOException, org.jscsi.exception.InternetSCSIException
errorStatus
- hints to the cause of the errorInterruptedException
IOException
org.jscsi.exception.InternetSCSIException
public final org.jscsi.parser.login.LoginStage getNextStageNumber()
null
if the
initiator is not allowed to transition any further.null
Copyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.