public final class NumericalEntry extends Entry
Entry sub-class for boolean parameters.
During text parameter negotiation, numerical parameters are negotiated by sending a single integer value as
part of a key=value pair. Based on the values permitted for the specific key (
protocolValueRange), the resultFunction and the negotiationValue, the jSCSI Target will
choose a single value as the negotiation outcome.
For declared parameters this process is less complex, any proposed value from the protocolValueRange will be
silently accepted.
Please note the difference between numerical values and numerical range values (see NumericalRangeEntry).
The default or negotiated value can be accessed via the getIntegerValue() method.
EntryalreadyNegotiated, keySet, negotiationStatus, negotiationType, use, value| Constructor and Description |
|---|
NumericalEntry(KeySet keySet,
NegotiationType negotiationType,
Use use,
NegotiationStatus negotiationStatus,
int negotiationValue,
NumericalValueRange protocolValueRange,
NumericalResultFunction resultFunction,
Integer defaultValue,
boolean zeroMeansDontCare)
The
NumericalEntry 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, resetAlreadyNegotiatedpublic NumericalEntry(KeySet keySet, NegotiationType negotiationType, Use use, NegotiationStatus negotiationStatus, int negotiationValue, NumericalValueRange protocolValueRange, NumericalResultFunction resultFunction, Integer defaultValue, boolean zeroMeansDontCare)
NumericalEntry constructor.keySet - contains all relevant keysnegotiationType - declared or negotiateduse - determines under which circumstances the parameter may be negotiatednegotiationStatus - indicates whether there is a default value or if the parameter must be negotiatednegotiationValue - together with the resultFunction and the protocolValueRange parameters this
value indicates the values supported by the jSCSI TargetprotocolValueRange - specifying the range of legal valuesresultFunction - determines the negotiation outcomedefaultValue - the default value or nullzeroMeansDontCare - if true and negotiationValue equals 0 then
negotiationValue does not serve as an upper or lower boundary to the values the jSCSI Target
will acceptprotected boolean inProtocolValueRange(Object values)
EntryObject, representing a single, a range, or a
list of values sent by the initiator, is illegal, according to the iSCSI standard.inProtocolValueRange in class Entryvalues - 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)
EntryString parameter and returns a sub-class-specific Object which represents the
the specified value part a key=value pair.parseOffer in class Entryvalues - the value part of a key=value pairObject or null if the parameter violated the expected formatprotected void processDeclaration(Object values)
EntryObject, representing a legal parameter value declared by the initiator and
accepts it as the new Entry.value.processDeclaration in class Entryvalues - sub-class-specific representation of a single value declared by the initiatorprotected String processNegotiation(Object values)
EntryObject, 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 Entryvalues - 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()
EntryInteger.getIntegerValue in class EntryIntegerCopyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.