public final class NumericalRangeEntry extends Entry
Entry
sub-class used for negotiating integer parameters which require the iSCSI initiator to offer an
interval from which the target must choose the final value. Thereby the key=value format differs from that
required by the NumericalEntry
class, for which value is a single integer. The value part
expected by this class looks like 1024~2048
, however the response value will again be a single
integer from the given range.
Currently this Entry
sub-class is only used for two parameters - IFMarkInt
and
OFMarkInt
. However, since the jSCSI Target does not support stream markers ( IFMarker=No
and OFMarker=No
), the correct response value to IFMarkInt
and OFMarkInt
keys must be Irrelevant
. This behavior is part of the
Entry.negotiate(org.jscsi.target.TargetServer, org.jscsi.parser.login.LoginStage, boolean, boolean, String, String, java.util.Collection)
method, which will lead to correct responses without having to check for additional constraints (the presence and
value of IFMarker
and OFMarker
key=value pairs.
alreadyNegotiated, keySet, negotiationStatus, negotiationType, use, value
Constructor and Description |
---|
NumericalRangeEntry(KeySet keySet,
Use use,
NegotiationStatus negotiationStatus,
int negotiationValue,
NumericalValueRange protocolValueRange,
Object defaultValue)
The
NumericalRangeEntry constructor. |
Modifier and Type | Method and Description |
---|---|
Entry |
copy()
Returns an exact copy of this
Entry . |
Integer |
getIntegerValue()
Returns the negotiated (or default) value as an
Integer . |
protected boolean |
inProtocolValueRange(Object values)
This method is used for checking if a sub-class-specific
Object , representing a single, a range, or a
list of values sent by the initiator, is illegal, according to the iSCSI standard. |
protected Object |
parseOffer(TargetServer target,
String values)
|
protected void |
processDeclaration(Object values)
Receives a sub-class-specific
Object , representing a legal parameter value declared by the initiator and
accepts it as the new Entry.value . |
protected String |
processNegotiation(Object values)
Receives a sub-class-specific
Object , representing a list, a range, or a single legal parameter value
offered by the initiator and tries to select a value from that offer. |
checkAccepted, getBooleanValue, getNegotiationStatus, getStringValue, matchKey, negotiate, resetAlreadyNegotiated
public NumericalRangeEntry(KeySet keySet, Use use, NegotiationStatus negotiationStatus, int negotiationValue, NumericalValueRange protocolValueRange, Object defaultValue)
NumericalRangeEntry
constructor.keySet
- contains all relevant keysuse
- determines under which circumstances the parameter may be negotiatednegotiationStatus
- indicates whether there is a default value or if the parameter must be negotiatednegotiationValue
- the value the jSCSI Target would like to useprotocolValueRange
- specifies the boundaries into which any RFC-conform value range proposed by the
iSCSI initiator must falldefaultValue
- the default value or null
protected boolean inProtocolValueRange(Object values)
Entry
Object
, representing a single, a range, or a
list of values sent by the initiator, is illegal, according to the iSCSI standard.inProtocolValueRange
in class Entry
values
- a sub-class-specific Object
, representing a single, a range, or a list of values sent by
the initiatorfalse
if the iSCSI standard has been violated, true
if notprotected Object parseOffer(TargetServer target, String values)
Entry
String
parameter and returns a sub-class-specific Object
which represents the
the specified value part a key=value pair.parseOffer
in class Entry
values
- the value part of a key=value pairObject
or null
if the parameter violated the expected formatprotected void processDeclaration(Object values)
Entry
Object
, representing a legal parameter value declared by the initiator and
accepts it as the new Entry.value
.processDeclaration
in class Entry
values
- sub-class-specific representation of a single value declared by the initiatorprotected String processNegotiation(Object values)
Entry
Object
, representing a list, a range, or a single legal parameter value
offered by the initiator and tries to select a value from that offer. If none of the offered values is supported
by the jSCSI Target, null
is returned, otherwise the selection is accepted as the new Entry.value
and returned as a String
. Entry.value
.processNegotiation
in class Entry
values
- a sub-class-specific Object
, representing a list, a range, or a single legal parameter
value offered by the initiatornull
, if the initiator's offer does not overlap with the
values supported by the jSCSI Targetpublic Integer getIntegerValue()
Entry
Integer
.getIntegerValue
in class Entry
Integer
Copyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.