public abstract class AbstractMessageParser extends Object
Abstract class from which each parser (initiator or target message parser) for a specific Protocol Data Unit (PDU) is inherited. The version of iSCSI Protocol is the RFC3720.
| Modifier and Type | Field and Description |
|---|---|
protected long |
logicalUnitNumber
Some opcodes operate on a specific Logical Unit.
|
protected ProtocolDataUnit |
protocolDataUnit
The read-only reference to the
ProtocolDataUnit instance, which contains this
AbstractMessageParser type. |
| Constructor and Description |
|---|
AbstractMessageParser(ProtocolDataUnit initProtocolDataUnit)
Default Contructor to create a new, empty AbstractMessageParser object.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canContainAdditionalHeaderSegments()
If this method returns
true, it indicates that this derived
AbstractMessageParser can contain one or more Additional Header Segments. |
boolean |
canHaveDigests()
If this method returns
true, then it indicates that this
derived AbstractMessageParser instance can be protected by a
digest. |
protected abstract 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 abstract void |
deserializeBytes1to3(int line)
Parse the bytes
1 till 3 in the Basic Header
Segment. |
protected abstract void |
deserializeBytes20to23(int line)
Parse the bytes
20 till 23 in the Basic Header
Segment. |
protected abstract void |
deserializeBytes24to27(int line)
Parse the bytes
24 till 27 in the Basic Header
Segment. |
protected abstract void |
deserializeBytes28to31(int line)
Parse the bytes
28 till 31 in the Basic Header
Segment. |
protected abstract void |
deserializeBytes32to35(int line)
Parse the bytes
32 till 35 in the Basic Header
Segment. |
protected abstract void |
deserializeBytes36to39(int line)
Parse the bytes
36 till 39 in the Basic Header
Segment. |
protected abstract void |
deserializeBytes40to43(int line)
Parse the bytes
40 till 43 in the Basic Header
Segment. |
protected abstract void |
deserializeBytes44to47(int line)
Parse the bytes
44 till 47 in the Basic Header
Segment. |
protected void |
deserializeBytes8to11(int line)
Parse the bytes
8 till 11 in the Basic Header
Segment. |
abstract DataSegmentFactory.DataSegmentFormat |
getDataSegmentFormat()
If this method returns
true, hen it indicates that the data
segment data is interpreted as binary data. |
long |
getLogicalUnitNumber()
Returns the Logical Unit Number (LUN) of this
AbstractMessageParser object. |
abstract String |
getShortInfo()
Returns the short version of the used sequence numbers of this parser
instance.
|
abstract boolean |
incrementSequenceNumber()
This
AbstractMessageParser instance affects the
incrementation of a Sequence Number counter. |
protected int |
serializeBytes12to15()
Serializes the bytes
12 till 15 in the Basic
Header Segment. |
protected abstract int |
serializeBytes1to3()
Serializes the bytes
1 till 3 in the Basic
Header Segment. |
protected abstract int |
serializeBytes20to23()
Serializes the bytes
20 till 23 in the Basic
Header Segment. |
protected abstract int |
serializeBytes24to27()
Serializes the bytes
24 till 27 in the Basic
Header Segment. |
protected abstract int |
serializeBytes28to31()
Serializes the bytes
28 till 31 in the Basic
Header Segment. |
protected abstract int |
serializeBytes32to35()
Serializes the bytes
32 till 35 in the Basic
Header Segment. |
protected abstract int |
serializeBytes36to39()
Serializes the bytes
36 till 39 in the Basic
Header Segment. |
protected abstract int |
serializeBytes40to43()
Serializes the bytes
40 till 43 in the Basic
Header Segment. |
protected abstract int |
serializeBytes44to47()
Serializes the bytes
44 till 47 in the Basic
Header Segment. |
protected int |
serializeBytes8to11()
Serializes the bytes
8 till 11 in the Basic
Header Segment. |
void |
setLogicalUnitNumber(long logicalUnitNumber)
Set the Logical Unit Number (LUN) of this
AbstractMessageParser object. |
String |
toString()
This method concatenate all the fields of a derived parser to allow an
easy generation of debug informations.
|
protected final ProtocolDataUnit protocolDataUnit
ProtocolDataUnit instance, which contains this
AbstractMessageParser type.protected long logicalUnitNumber
8 and so on up to
LUN[7] from [SAM2], which is BHS byte 15.public AbstractMessageParser(ProtocolDataUnit initProtocolDataUnit)
initProtocolDataUnit - The reference ProtocolDataUnit instance, which
contains this AbstractMessageParser object.public abstract 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.DataSegmentFactory.DataSegmentFormatpublic boolean canContainAdditionalHeaderSegments()
true, it indicates that this derived
AbstractMessageParser can contain one or more Additional Header Segments.true, if this AbstractMessageParser object
can contain one or more AHSs.AdditionalHeaderSegmentpublic boolean canHaveDigests()
true, then it indicates that this
derived AbstractMessageParser instance can be protected by a
digest.true, if the ProtocolDataUnit can be protected by a
header and/or a data digest. Else false.public abstract String getShortInfo()
public String toString()
public void clear()
public abstract boolean incrementSequenceNumber()
AbstractMessageParser instance affects the
incrementation of a Sequence Number counter.true, if the counter has to be incremented.public final long getLogicalUnitNumber()
AbstractMessageParser object.public final void setLogicalUnitNumber(long logicalUnitNumber)
AbstractMessageParser object.logicalUnitNumber - The Logical Unit Number of this object.protected abstract void deserializeBytes1to3(int line)
throws InternetSCSIException
1 till 3 in the Basic Header
Segment.line - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected void deserializeBytes8to11(int line)
throws InternetSCSIException
8 till 11 in the Basic Header
Segment.line - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected void deserializeBytes12to15(int line)
throws InternetSCSIException
12 till 15 in the Basic Header
Segment.line - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected abstract void deserializeBytes20to23(int line)
throws InternetSCSIException
20 till 23 in the Basic Header
Segment.line - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected abstract void deserializeBytes24to27(int line)
throws InternetSCSIException
24 till 27 in the Basic Header
Segment.line - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected abstract void deserializeBytes28to31(int line)
throws InternetSCSIException
28 till 31 in the Basic Header
Segment.line - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected abstract void deserializeBytes32to35(int line)
throws InternetSCSIException
32 till 35 in the Basic Header
Segment.line - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected abstract void deserializeBytes36to39(int line)
throws InternetSCSIException
36 till 39 in the Basic Header
Segment.line - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected abstract void deserializeBytes40to43(int line)
throws InternetSCSIException
40 till 43 in the Basic Header
Segment.line - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected abstract void deserializeBytes44to47(int line)
throws InternetSCSIException
44 till 47 in the Basic Header
Segment.line - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected abstract int serializeBytes1to3()
1 till 3 in the Basic
Header Segment.protected int serializeBytes8to11()
throws InternetSCSIException
8 till 11 in the Basic
Header Segment.InternetSCSIException - if any violation of the iSCSI Standard (RFC3720) occurs.protected int serializeBytes12to15()
12 till 15 in the Basic
Header Segment.protected abstract int serializeBytes20to23()
20 till 23 in the Basic
Header Segment.protected abstract int serializeBytes24to27()
24 till 27 in the Basic
Header Segment.protected abstract int serializeBytes28to31()
28 till 31 in the Basic
Header Segment.protected abstract int serializeBytes32to35()
32 till 35 in the Basic
Header Segment.protected abstract int serializeBytes36to39()
36 till 39 in the Basic
Header Segment.protected abstract int serializeBytes40to43()
40 till 43 in the Basic
Header Segment.protected abstract int serializeBytes44to47()
44 till 47 in the Basic
Header Segment.protected abstract void checkIntegrity()
throws InternetSCSIException
InternetSCSIException - If the integrity is violated.Copyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.