|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.svrCore.Stratum
public final class Stratum
Immutable stratum and other details of this instance/server and upstream.
| Field Summary | |
|---|---|
static short |
MAX_ROOT_DELAY
Maximum root delay; strictly positive (and no higher than Short.MAX_VALUE). |
static byte |
MAX_STRATUM
Maximum permissible stratum; strictly positive (and much less than Byte.MAX_VALUE). |
static int |
MAX_UPSTREAM_NAME
Maximum length of upstream short (unique) name; strictly positive. |
static Stratum |
ROOT
Value for use at the root (master) node; non-null. |
private short |
rootDelay
Root delay in ms capped to Short.MAX_VALUE; non-negative. |
private static long |
serialVersionUID
Unique serialisation ID. |
private byte |
stratum
Our stratum, in range [0,MAX_STRATUM] with 0 indicating master/root, or -1 for unknown. |
static Stratum |
UNKNOWN
Value for use when upstream node is knot known; non-null. |
private boolean |
upstreamConserving
True if upstream is in a power-conserving state or unknown (as fail-safe). |
private java.lang.String |
upstreamName
Upstream server short, unique, printable-ASCII name, "" for root/master/unknown else mirror tag like "cc-xxx"; never null. |
| Constructor Summary | |
|---|---|
Stratum(byte stratum,
short rootDelay,
java.lang.String upstreamName,
boolean upstreamConserving)
Construct an instance. |
|
Stratum(int stratum,
int rootDelay,
java.lang.String upstreamName,
boolean upstreamConserving)
Construct an instance with int-valued numeric arguments for convenience. |
|
| Method Summary | |
|---|---|
short |
getRootDelay()
Root delay in ms capped to Short.MAX_VALUE; non-negative. |
byte |
getStratum()
Our stratum, in range [0,MAX_STRATUM] with 0 indicating master/root, -1 unknown. |
java.lang.String |
getUpstreamName()
Upstream server short name, "" for root/master/unknown else like "cc-xxx"; never null. |
boolean |
isUnknownStratum()
True if stratum is unknown. |
boolean |
isUpstreamConserving()
True if upstream is in a power-conserving state. |
protected java.lang.Object |
readResolve()
Deserialise: use constructor for validation, defensive copying, etc. |
void |
validateObject()
Validate fields/state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_UPSTREAM_NAME
public static final short MAX_ROOT_DELAY
public static final byte MAX_STRATUM
private final byte stratum
private final short rootDelay
private final java.lang.String upstreamName
private final boolean upstreamConserving
private static final long serialVersionUID
public static final Stratum ROOT
It has no upstream node so the upstream name is "" and the conserving flag is false.
public static final Stratum UNKNOWN
The upstream node is not known so the upstream name is "" and the conserving flag is false.
| Constructor Detail |
|---|
public Stratum(int stratum,
int rootDelay,
java.lang.String upstreamName,
boolean upstreamConserving)
public Stratum(byte stratum,
short rootDelay,
java.lang.String upstreamName,
boolean upstreamConserving)
| Method Detail |
|---|
protected java.lang.Object readResolve()
public void validateObject()
throws java.io.InvalidObjectException
Barf if something bad is found. (Maybe allow some extra info in debug version.)
java.io.InvalidObjectExceptionpublic byte getStratum()
public boolean isUnknownStratum()
public short getRootDelay()
public java.lang.String getUpstreamName()
public boolean isUpstreamConserving()
|
DHD Multimedia Gallery V1.60.69 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||