public abstract class CommandDescriptorBlock extends Object
A Command Descriptor Blocks is a blocks of multiple bytes that contains a ScsiOperationCode
, specifying a
command the SCSI initiator wants the SCSI target to perform and related fields, which determine details of the
ordered task.
Since all fields in the Control byte except for the Normal ACA bit are either reserved, obsolete, or vendor specific, the NACA bit can be accessed directly from this class.
Constructor and Description |
---|
CommandDescriptorBlock(ByteBuffer buffer)
The abstract constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addIllegalFieldPointer(int byteNumber)
Adds an instance
FieldPointerSenseKeySpecificData , which specifies an illegal field by the position of
its first byte, to illegalFieldPointers . |
protected void |
addIllegalFieldPointer(int byteNumber,
int bitNumber)
Adds an instance
FieldPointerSenseKeySpecificData , which specifies an illegal field by the position of
its first byte and its first bit, to illegalFieldPointers . |
FieldPointerSenseKeySpecificData[] |
getIllegalFieldPointers()
Returns
null if there were no illegal fields in the serialized CDB passed to the constructor, or an
array of appropriate FieldPointerSenseKeySpecificData , that have to be enclosed in the SenseData
returned to the initiator (with sense key SenseKey.ILLEGAL_REQUEST and additional sense code and sense
code qualifier AdditionalSenseCodeAndQualifier.INVALID_FIELD_IN_CDB ). |
ScsiOperationCode |
getScsiOperationCode() |
boolean |
isNormalACA()
The NACA (Normal ACA) bit specifies whether an auto contingent allegiance (ACA) is established if the command
terminates with CHECK CONDITION status.
|
public CommandDescriptorBlock(ByteBuffer buffer)
Deserializes the first byte containing the SCSI Operation Code and the Control byte.
The passed ByteBuffer
parameter must have a capacity ≥ the length of the specific command
descriptor block. Since this is assured by the SCSICommandParser.getCDB()
method, which always returns
ByteBuffer
objects with capacity 16, no checks will be performed.
buffer
- contains the serialized CDB starting at index position zeropublic final ScsiOperationCode getScsiOperationCode()
public final boolean isNormalACA()
true
if the Normal ACA bit in the CDB's Control byte is set and false
if it is
not.protected final void addIllegalFieldPointer(int byteNumber)
FieldPointerSenseKeySpecificData
, which specifies an illegal field by the position of
its first byte, to illegalFieldPointers
.byteNumber
- index of the first byte of the illegal fieldprotected final void addIllegalFieldPointer(int byteNumber, int bitNumber)
FieldPointerSenseKeySpecificData
, which specifies an illegal field by the position of
its first byte and its first bit, to illegalFieldPointers
.byteNumber
- index of the first byte of the illegal fieldbitNumber
- index of the first bit of the illegal fieldpublic final FieldPointerSenseKeySpecificData[] getIllegalFieldPointers()
null
if there were no illegal fields in the serialized CDB passed to the constructor, or an
array of appropriate FieldPointerSenseKeySpecificData
, that have to be enclosed in the SenseData
returned to the initiator (with sense key SenseKey.ILLEGAL_REQUEST
and additional sense code and sense
code qualifier AdditionalSenseCodeAndQualifier.INVALID_FIELD_IN_CDB
).null
or an array of appropriate FieldPointerSenseKeySpecificData
Copyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.