You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by er...@apache.org on 2007/06/15 08:54:59 UTC
svn commit: r547552 - in
/directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages:
LeapIndicatorType.java ModeType.java ReferenceIdentifier.java
StratumType.java
Author: erodriguez
Date: Thu Jun 14 23:54:58 2007
New Revision: 547552
URL: http://svn.apache.org/viewvc?view=rev&rev=547552
Log:
More Javadocs for protocol-ntp.
Modified:
directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/LeapIndicatorType.java
directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ModeType.java
directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ReferenceIdentifier.java
directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/StratumType.java
Modified: directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/LeapIndicatorType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/LeapIndicatorType.java?view=diff&rev=547552&r1=547551&r2=547552
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/LeapIndicatorType.java (original)
+++ directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/LeapIndicatorType.java Thu Jun 14 23:54:58 2007
@@ -44,39 +44,66 @@
public final class LeapIndicatorType implements Comparable
{
/**
- * Enumeration elements are constructed once upon class loading.
- * Order of appearance here determines the order of compareTo.
+ * Constant for the "No leap second warning" leap indicator type.
*/
public static final LeapIndicatorType NO_WARNING = new LeapIndicatorType( 0, "No leap second warning." );
+
+ /**
+ * Constant for the "Last minute has 61 seconds" leap indicator type.
+ */
public static final LeapIndicatorType POSITIVE_LEAP_SECOND = new LeapIndicatorType( 1,
"Last minute has 61 seconds." );
+
+ /**
+ * Constant for the "Last minute has 59 seconds" leap indicator type.
+ */
public static final LeapIndicatorType NEGATIVE_LEAP_SECOND = new LeapIndicatorType( 2,
"Last minute has 59 seconds." );
+
+ /**
+ * Constant for the "Alarm condition (clock not synchronized)" leap indicator type.
+ */
public static final LeapIndicatorType ALARM_CONDITION = new LeapIndicatorType( 3,
"Alarm condition (clock not synchronized)." );
/**
- * These two lines are all that's necessary to export a List of VALUES.
+ * Array for building a List of VALUES.
*/
private static final LeapIndicatorType[] values =
{ NO_WARNING, POSITIVE_LEAP_SECOND, NEGATIVE_LEAP_SECOND, ALARM_CONDITION };
- // VALUES needs to be located here, otherwise illegal forward reference
+
+ /**
+ * A list of all the leap indicator type constants.
+ */
public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
+ /**
+ * The name of the leap indicator type.
+ */
private final String name;
+
+ /**
+ * The value/code for the leap indicator type.
+ */
private final int ordinal;
/**
* Private constructor prevents construction outside of this class.
*/
- private LeapIndicatorType(int ordinal, String name)
+ private LeapIndicatorType( int ordinal, String name )
{
this.ordinal = ordinal;
this.name = name;
}
+ /**
+ * Returns the leap indicator type when specified by its ordinal.
+ *
+ * @param type
+ * @return The leap indicator type.
+ */
public static LeapIndicatorType getTypeByOrdinal( int type )
{
for ( int ii = 0; ii < values.length; ii++ )
@@ -91,6 +118,11 @@
}
+ /**
+ * Returns the number associated with this leap indicator type.
+ *
+ * @return The leap indicator type ordinal.
+ */
public int getOrdinal()
{
return ordinal;
Modified: directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ModeType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ModeType.java?view=diff&rev=547552&r1=547551&r2=547552
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ModeType.java (original)
+++ directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ModeType.java Thu Jun 14 23:54:58 2007
@@ -47,41 +47,84 @@
public final class ModeType implements Comparable
{
/**
- * Enumeration elements are constructed once upon class loading.
- * Order of appearance here determines the order of compareTo.
+ * Constant for the "Reserved mode" mode type.
*/
public static final ModeType RESERVED = new ModeType( 0, "Reserved mode." );
+
+ /**
+ * Constant for the "Symmetric active mode" mode type.
+ */
public static final ModeType SYMMETRIC_ACTIVE = new ModeType( 1, "Symmetric active mode." );
+
+ /**
+ * Constant for the "Symmetric passive mode" mode type.
+ */
public static final ModeType RESERVED_PASSIVE = new ModeType( 2, "Symmetric passive mode." );
+
+ /**
+ * Constant for the "Client mode" mode type.
+ */
public static final ModeType CLIENT = new ModeType( 3, "Client mode." );
+
+ /**
+ * Constant for the "Server mode" mode type.
+ */
public static final ModeType SERVER = new ModeType( 4, "Server mode." );
+
+ /**
+ * Constant for the "Broadcast mode" mode type.
+ */
public static final ModeType BROADCAST = new ModeType( 5, "Broadcast mode." );
+
+ /**
+ * Constant for the "Reserved for NTP control message" mode type.
+ */
public static final ModeType RESERVED_FOR_NTP_CONTROL = new ModeType( 6, "Reserved for NTP control message." );
+
+ /**
+ * Constant for the "Reserved for private use" mode type.
+ */
public static final ModeType RESERVED_FOR_PRIVATE_USE = new ModeType( 7, "Reserved for private use." );
/**
- * These two lines are all that's necessary to export a List of VALUES.
+ * Array for building a List of VALUES.
*/
private static final ModeType[] values =
{ RESERVED, SYMMETRIC_ACTIVE, RESERVED_PASSIVE, CLIENT, SERVER, BROADCAST, RESERVED_FOR_NTP_CONTROL,
RESERVED_FOR_PRIVATE_USE };
- // VALUES needs to be located here, otherwise illegal forward reference
+
+ /**
+ * A list of all the mode type constants.
+ */
public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
+ /**
+ * The name of the mode type.
+ */
private final String name;
+
+ /**
+ * The value/code for the mode type.
+ */
private final int ordinal;
/**
* Private constructor prevents construction outside of this class.
*/
- private ModeType(int ordinal, String name)
+ private ModeType( int ordinal, String name )
{
this.ordinal = ordinal;
this.name = name;
}
+ /**
+ * Returns the mode type when specified by its ordinal.
+ *
+ * @param type
+ * @return The mode type.
+ */
public static ModeType getTypeByOrdinal( int type )
{
for ( int ii = 0; ii < values.length; ii++ )
@@ -95,6 +138,11 @@
}
+ /**
+ * Returns the number associated with this mode type.
+ *
+ * @return The mode type ordinal.
+ */
public int getOrdinal()
{
return ordinal;
Modified: directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ReferenceIdentifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ReferenceIdentifier.java?view=diff&rev=547552&r1=547551&r2=547552
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ReferenceIdentifier.java (original)
+++ directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ReferenceIdentifier.java Thu Jun 14 23:54:58 2007
@@ -46,52 +46,133 @@
public class ReferenceIdentifier implements Comparable
{
/**
- * Enumeration elements are constructed once upon class loading.
- * Order of appearance here determines the order of compareTo.
+ * Constant for the "INIT" reference identifier type.
*/
public static final ReferenceIdentifier INIT = new ReferenceIdentifier( 0, "INIT", "initializing" );
+
+ /**
+ * Constant for the "LOCL" reference identifier type.
+ */
public static final ReferenceIdentifier LOCL = new ReferenceIdentifier( 1, "LOCL", "uncalibrated local clock" );
+
+ /**
+ * Constant for the "PPL" reference identifier type.
+ */
public static final ReferenceIdentifier PPS = new ReferenceIdentifier( 2, "PPL", "pulse-per-second source" );
+
+ /**
+ * Constant for the "ACTS" reference identifier type.
+ */
public static final ReferenceIdentifier ACTS = new ReferenceIdentifier( 3, "ACTS", "NIST dialup modem service" );
+
+ /**
+ * Constant for the "USNO" reference identifier type.
+ */
public static final ReferenceIdentifier USNO = new ReferenceIdentifier( 4, "USNO", "USNO modem service" );
+
+ /**
+ * Constant for the "PTB" reference identifier type.
+ */
public static final ReferenceIdentifier PTB = new ReferenceIdentifier( 5, "PTB", "PTB (Germany) modem service" );
+
+ /**
+ * Constant for the "TDF" reference identifier type.
+ */
public static final ReferenceIdentifier TDF = new ReferenceIdentifier( 6, "TDF", "Allouis (France) Radio 164 kHz" );
+
+ /**
+ * Constant for the "DCF" reference identifier type.
+ */
public static final ReferenceIdentifier DCF = new ReferenceIdentifier( 7, "DCF",
"Mainflingen (Germany) Radio 77.5 kHz" );
+
+ /**
+ * Constant for the "MSF" reference identifier type.
+ */
public static final ReferenceIdentifier MSF = new ReferenceIdentifier( 8, "MSF", "Rugby (UK) Radio 60 kHz" );
+
+ /**
+ * Constant for the "WWV" reference identifier type.
+ */
public static final ReferenceIdentifier WWV = new ReferenceIdentifier( 9, "WWV",
"Ft. Collins (US) Radio 2.5, 5, 10, 15, 20 MHz" );
+
+ /**
+ * Constant for the "WWVB" reference identifier type.
+ */
public static final ReferenceIdentifier WWVB = new ReferenceIdentifier( 10, "WWVB", "Boulder (US) Radio 60 kHz" );
+
+ /**
+ * Constant for the "WWVH" reference identifier type.
+ */
public static final ReferenceIdentifier WWVH = new ReferenceIdentifier( 11, "WWVH",
"Kaui Hawaii (US) Radio 2.5, 5, 10, 15 MHz" );
+
+ /**
+ * Constant for the "CHU" reference identifier type.
+ */
public static final ReferenceIdentifier CHU = new ReferenceIdentifier( 12, "CHU",
"Ottawa (Canada) Radio 3330, 7335, 14670 kHz" );
+
+ /**
+ * Constant for the "LORC" reference identifier type.
+ */
public static final ReferenceIdentifier LORC = new ReferenceIdentifier( 13, "LORC",
"LORAN-C radionavigation system" );
+
+ /**
+ * Constant for the "OMEG" reference identifier type.
+ */
public static final ReferenceIdentifier OMEG = new ReferenceIdentifier( 14, "OMEG", "OMEGA radionavigation system" );
+
+ /**
+ * Constant for the "GPS" reference identifier type.
+ */
public static final ReferenceIdentifier GPS = new ReferenceIdentifier( 15, "GPS", "Global Positioning Service" );
+
+ /**
+ * Constant for the "GOES" reference identifier type.
+ */
public static final ReferenceIdentifier GOES = new ReferenceIdentifier( 16, "GOES",
"Geostationary Orbit Environment Satellite" );
+
+ /**
+ * Constant for the "CDMA" reference identifier type.
+ */
public static final ReferenceIdentifier CDMA = new ReferenceIdentifier( 17, "CDMA",
"CDMA mobile cellular/PCS telephone system" );
/**
- * These two lines are all that's necessary to export a List of VALUES.
+ * Array for building a List of VALUES.
*/
private static final ReferenceIdentifier[] values =
{ INIT, LOCL, PPS, ACTS, USNO, PTB, TDF, DCF, MSF, WWV, WWVB, WWVH, CHU, LORC, OMEG, GPS, GOES, CDMA };
- // VALUES needs to be located here, otherwise illegal forward reference
+
+ /**
+ * A list of all the reference identifier type constants.
+ */
public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
+ /**
+ * The value/code for the reference identifier type.
+ */
private final int ordinal;
+
+ /**
+ * The name of the reference identifier type.
+ */
private final String name;
+
+ /**
+ * The code of the reference identifier type.
+ */
private final String code;
/**
* Private constructor prevents construction outside of this class.
*/
- private ReferenceIdentifier(int ordinal, String code, String name)
+ private ReferenceIdentifier( int ordinal, String code, String name )
{
this.ordinal = ordinal;
this.code = code;
@@ -99,6 +180,12 @@
}
+ /**
+ * Returns the reference identifier type when specified by its ordinal.
+ *
+ * @param type
+ * @return The reference identifier type.
+ */
public static ReferenceIdentifier getTypeByOrdinal( int type )
{
for ( int ii = 0; ii < values.length; ii++ )
@@ -113,6 +200,12 @@
}
+ /**
+ * Returns the reference identifier type when specified by its name.
+ *
+ * @param type
+ * @return The reference identifier type.
+ */
public static ReferenceIdentifier getTypeByName( String type )
{
for ( int ii = 0; ii < values.length; ii++ )
@@ -127,15 +220,25 @@
}
- public int getOrdinal()
+ /**
+ * Returns the code associated with this reference identifier type.
+ *
+ * @return The reference identifier type code.
+ */
+ public String getCode()
{
- return ordinal;
+ return code;
}
- public String getCode()
+ /**
+ * Returns the number associated with this reference identifier type.
+ *
+ * @return The reference identifier type ordinal.
+ */
+ public int getOrdinal()
{
- return code;
+ return ordinal;
}
Modified: directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/StratumType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/StratumType.java?view=diff&rev=547552&r1=547551&r2=547552
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/StratumType.java (original)
+++ directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/StratumType.java Thu Jun 14 23:54:58 2007
@@ -43,35 +43,58 @@
public final class StratumType implements Comparable
{
/**
- * Enumeration elements are constructed once upon class loading.
- * Order of appearance here determines the order of compareTo.
+ * Constant for the "Unspecified or unavailable" stratum type.
*/
public static final StratumType UNSPECIFIED = new StratumType( 0, "Unspecified or unavailable." );
+
+ /**
+ * Constant for the "Primary reference" stratum type.
+ */
public static final StratumType PRIMARY_REFERENCE = new StratumType( 1, "Primary reference." );
+
+ /**
+ * Constant for the "Secondary reference" stratum type.
+ */
public static final StratumType SECONDARY_REFERENCE = new StratumType( 2, "Secondary reference." );
/**
- * These two lines are all that's necessary to export a List of VALUES.
+ * Array for building a List of VALUES.
*/
private static final StratumType[] values =
{ UNSPECIFIED, PRIMARY_REFERENCE, SECONDARY_REFERENCE };
- // VALUES needs to be located here, otherwise illegal forward reference
+
+ /**
+ * A list of all the stratum type constants.
+ */
public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
- private final int ordinal;
+ /**
+ * The name of the stratum type.
+ */
private final String name;
+ /**
+ * The value/code for the stratum type.
+ */
+ private final int ordinal;
+
/**
* Private constructor prevents construction outside of this class.
*/
- private StratumType(int ordinal, String name)
+ private StratumType( int ordinal, String name )
{
this.ordinal = ordinal;
this.name = name;
}
+ /**
+ * Returns the stratum type when specified by its ordinal.
+ *
+ * @param type
+ * @return The stratum type.
+ */
public static StratumType getTypeByOrdinal( int type )
{
for ( int ii = 0; ii < values.length; ii++ )
@@ -86,6 +109,11 @@
}
+ /**
+ * Returns the number associated with this stratum type.
+ *
+ * @return The stratum type ordinal.
+ */
public int getOrdinal()
{
return ordinal;