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   */
27  public class NtpMessage
28  {
29      private LeapIndicatorType leapIndicator;
30      private int versionNumber;
31      private ModeType mode;
32      private StratumType stratumType;
33      private byte pollInterval;
34      private byte precision;
35      private int rootDelay;
36      private int rootDispersion;
37  
38      private ReferenceIdentifier referenceIdentifier;
39  
40      private NtpTimeStamp referenceTimestamp;
41      private NtpTimeStamp originateTimestamp;
42      private NtpTimeStamp receiveTimestamp;
43      private NtpTimeStamp transmitTimestamp;
44  
45  
46      /**
47       * Creates a new instance of NtpMessage.
48       *
49       * @param leapIndicator
50       * @param versionNumber
51       * @param mode
52       * @param stratumType
53       * @param pollInterval
54       * @param precision
55       * @param rootDelay
56       * @param rootDispersion
57       * @param referenceIdentifier
58       * @param referenceTimestamp
59       * @param originateTimestamp
60       * @param receiveTimestamp
61       * @param transmitTimestamp
62       */
63      public NtpMessage( LeapIndicatorType leapIndicator, int versionNumber, ModeType mode, StratumType stratumType,
64          byte pollInterval, byte precision, int rootDelay, int rootDispersion, ReferenceIdentifier referenceIdentifier,
65          NtpTimeStamp./org/apache/directory/server/ntp/messages/NtpTimeStamp.html#NtpTimeStamp">NtpTimeStamp./org/apache/directory/server/ntp/messages/NtpTimeStamp.html#NtpTimeStamp">NtpTimeStamp referenceTimestamp, NtpTimeStamp./org/apache/directory/server/ntp/messages/NtpTimeStamp.html#NtpTimeStamp">NtpTimeStamp originateTimestamp, NtpTimeStamp receiveTimestamp,
66          NtpTimeStamp transmitTimestamp )
67      {
68          this.leapIndicator = leapIndicator;
69          this.versionNumber = versionNumber;
70          this.mode = mode;
71          this.stratumType = stratumType;
72          this.pollInterval = pollInterval;
73          this.precision = precision;
74          this.rootDelay = rootDelay;
75          this.rootDispersion = rootDispersion;
76          this.referenceIdentifier = referenceIdentifier;
77          this.referenceTimestamp = referenceTimestamp;
78          this.originateTimestamp = originateTimestamp;
79          this.receiveTimestamp = receiveTimestamp;
80          this.transmitTimestamp = transmitTimestamp;
81      }
82  
83  
84      /**
85       * @return Returns the Leap Indicator.
86       */
87      public LeapIndicatorType getLeapIndicator()
88      {
89          return leapIndicator;
90      }
91  
92  
93      /**
94       * @return Returns the Mode.
95       */
96      public ModeType getMode()
97      {
98          return mode;
99      }
100 
101 
102     /**
103      * @return Returns the Originate Timestamp.
104      */
105     public NtpTimeStamp getOriginateTimestamp()
106     {
107         return originateTimestamp;
108     }
109 
110 
111     /**
112      * @return Returns the Poll Interval.
113      */
114     public byte getPollInterval()
115     {
116         return pollInterval;
117     }
118 
119 
120     /**
121      * @return Returns the Precision.
122      */
123     public byte getPrecision()
124     {
125         return precision;
126     }
127 
128 
129     /**
130      * @return Returns the Receive Timestamp.
131      */
132     public NtpTimeStamp getReceiveTimestamp()
133     {
134         return receiveTimestamp;
135     }
136 
137 
138     /**
139      * @return Returns the Reference Identifier.
140      */
141     public ReferenceIdentifier getReferenceIdentifier()
142     {
143         return referenceIdentifier;
144     }
145 
146 
147     /**
148      * @return Returns the Reference Timestamp.
149      */
150     public NtpTimeStamp getReferenceTimestamp()
151     {
152         return referenceTimestamp;
153     }
154 
155 
156     /**
157      * @return Returns the Root Delay.
158      */
159     public int getRootDelay()
160     {
161         return rootDelay;
162     }
163 
164 
165     /**
166      * @return Returns the Root Dispersion.
167      */
168     public int getRootDispersion()
169     {
170         return rootDispersion;
171     }
172 
173 
174     /**
175      * @return Returns the Stratum.
176      */
177     public StratumType getStratum()
178     {
179         return stratumType;
180     }
181 
182 
183     /**
184      * @return Returns the Transmit Timestamp.
185      */
186     public NtpTimeStamp getTransmitTimestamp()
187     {
188         return transmitTimestamp;
189     }
190 
191 
192     /**
193      * @return Returns the Version Number.
194      */
195     public int getVersionNumber()
196     {
197         return versionNumber;
198     }
199 }