View Javadoc

1   /*
2    *  Licensed to the Apache Software Foundation (ASF) under one
3    *  or more contributor license agreements.  See the NOTICE file
4    *  distributed with this work for additional information
5    *  regarding copyright ownership.  The ASF licenses this file
6    *  to you under the Apache License, Version 2.0 (the
7    *  "License"); you may not use this file except in compliance
8    *  with the License.  You may obtain a copy of the License at
9    *  
10   *    http://www.apache.org/licenses/LICENSE-2.0
11   *  
12   *  Unless required by applicable law or agreed to in writing,
13   *  software distributed under the License is distributed on an
14   *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   *  KIND, either express or implied.  See the License for the
16   *  specific language governing permissions and limitations
17   *  under the License. 
18   *  
19   */
20  
21  package org.apache.directory.server.ntp.messages;
22  
23  
24  /**
25   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
26   * @version $Rev: 547539 $, $Date: 2007-06-15 08:08:06 +0200 (Fr, 15 Jun 2007) $
27   */
28  public class NtpMessage
29  {
30      private LeapIndicatorType leapIndicator;
31      private int versionNumber;
32      private ModeType mode;
33      private StratumType stratumType;
34      private byte pollInterval;
35      private byte precision;
36      private int rootDelay;
37      private int rootDispersion;
38  
39      private ReferenceIdentifier referenceIdentifier;
40  
41      private NtpTimeStamp referenceTimestamp;
42      private NtpTimeStamp originateTimestamp;
43      private NtpTimeStamp receiveTimestamp;
44      private NtpTimeStamp transmitTimestamp;
45  
46  
47      /**
48       * Creates a new instance of NtpMessage.
49       *
50       * @param leapIndicator
51       * @param versionNumber
52       * @param mode
53       * @param stratumType
54       * @param pollInterval
55       * @param precision
56       * @param rootDelay
57       * @param rootDispersion
58       * @param referenceIdentifier
59       * @param referenceTimestamp
60       * @param originateTimestamp
61       * @param receiveTimestamp
62       * @param transmitTimestamp
63       */
64      public NtpMessage( LeapIndicatorType leapIndicator, int versionNumber, ModeType mode, StratumType stratumType,
65          byte pollInterval, byte precision, int rootDelay, int rootDispersion, ReferenceIdentifier referenceIdentifier,
66          NtpTimeStamp referenceTimestamp, NtpTimeStamp originateTimestamp, NtpTimeStamp receiveTimestamp,
67          NtpTimeStamp transmitTimestamp )
68      {
69          this.leapIndicator = leapIndicator;
70          this.versionNumber = versionNumber;
71          this.mode = mode;
72          this.stratumType = stratumType;
73          this.pollInterval = pollInterval;
74          this.precision = precision;
75          this.rootDelay = rootDelay;
76          this.rootDispersion = rootDispersion;
77          this.referenceIdentifier = referenceIdentifier;
78          this.referenceTimestamp = referenceTimestamp;
79          this.originateTimestamp = originateTimestamp;
80          this.receiveTimestamp = receiveTimestamp;
81          this.transmitTimestamp = transmitTimestamp;
82      }
83  
84  
85      /**
86       * @return Returns the Leap Indicator.
87       */
88      public LeapIndicatorType getLeapIndicator()
89      {
90          return leapIndicator;
91      }
92  
93  
94      /**
95       * @return Returns the Mode.
96       */
97      public ModeType getMode()
98      {
99          return mode;
100     }
101 
102 
103     /**
104      * @return Returns the Originate Timestamp.
105      */
106     public NtpTimeStamp getOriginateTimestamp()
107     {
108         return originateTimestamp;
109     }
110 
111 
112     /**
113      * @return Returns the Poll Interval.
114      */
115     public byte getPollInterval()
116     {
117         return pollInterval;
118     }
119 
120 
121     /**
122      * @return Returns the Precision.
123      */
124     public byte getPrecision()
125     {
126         return precision;
127     }
128 
129 
130     /**
131      * @return Returns the Receive Timestamp.
132      */
133     public NtpTimeStamp getReceiveTimestamp()
134     {
135         return receiveTimestamp;
136     }
137 
138 
139     /**
140      * @return Returns the Reference Identifier.
141      */
142     public ReferenceIdentifier getReferenceIdentifier()
143     {
144         return referenceIdentifier;
145     }
146 
147 
148     /**
149      * @return Returns the Reference Timestamp.
150      */
151     public NtpTimeStamp getReferenceTimestamp()
152     {
153         return referenceTimestamp;
154     }
155 
156 
157     /**
158      * @return Returns the Root Delay.
159      */
160     public int getRootDelay()
161     {
162         return rootDelay;
163     }
164 
165 
166     /**
167      * @return Returns the Root Dispersion.
168      */
169     public int getRootDispersion()
170     {
171         return rootDispersion;
172     }
173 
174 
175     /**
176      * @return Returns the Stratum.
177      */
178     public StratumType getStratum()
179     {
180         return stratumType;
181     }
182 
183 
184     /**
185      * @return Returns the Transmit Timestamp.
186      */
187     public NtpTimeStamp getTransmitTimestamp()
188     {
189         return transmitTimestamp;
190     }
191 
192 
193     /**
194      * @return Returns the Version Number.
195      */
196     public int getVersionNumber()
197     {
198         return versionNumber;
199     }
200 }