001 /* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 * 019 */ 020 021 package org.apache.directory.server.ntp.messages; 022 023 024 /** 025 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 026 * @version $Rev: 547539 $, $Date: 2007-06-15 08:08:06 +0200 (Fri, 15 Jun 2007) $ 027 */ 028 public class NtpMessage 029 { 030 private LeapIndicatorType leapIndicator; 031 private int versionNumber; 032 private ModeType mode; 033 private StratumType stratumType; 034 private byte pollInterval; 035 private byte precision; 036 private int rootDelay; 037 private int rootDispersion; 038 039 private ReferenceIdentifier referenceIdentifier; 040 041 private NtpTimeStamp referenceTimestamp; 042 private NtpTimeStamp originateTimestamp; 043 private NtpTimeStamp receiveTimestamp; 044 private NtpTimeStamp transmitTimestamp; 045 046 047 /** 048 * Creates a new instance of NtpMessage. 049 * 050 * @param leapIndicator 051 * @param versionNumber 052 * @param mode 053 * @param stratumType 054 * @param pollInterval 055 * @param precision 056 * @param rootDelay 057 * @param rootDispersion 058 * @param referenceIdentifier 059 * @param referenceTimestamp 060 * @param originateTimestamp 061 * @param receiveTimestamp 062 * @param transmitTimestamp 063 */ 064 public NtpMessage( LeapIndicatorType leapIndicator, int versionNumber, ModeType mode, StratumType stratumType, 065 byte pollInterval, byte precision, int rootDelay, int rootDispersion, ReferenceIdentifier referenceIdentifier, 066 NtpTimeStamp referenceTimestamp, NtpTimeStamp originateTimestamp, NtpTimeStamp receiveTimestamp, 067 NtpTimeStamp transmitTimestamp ) 068 { 069 this.leapIndicator = leapIndicator; 070 this.versionNumber = versionNumber; 071 this.mode = mode; 072 this.stratumType = stratumType; 073 this.pollInterval = pollInterval; 074 this.precision = precision; 075 this.rootDelay = rootDelay; 076 this.rootDispersion = rootDispersion; 077 this.referenceIdentifier = referenceIdentifier; 078 this.referenceTimestamp = referenceTimestamp; 079 this.originateTimestamp = originateTimestamp; 080 this.receiveTimestamp = receiveTimestamp; 081 this.transmitTimestamp = transmitTimestamp; 082 } 083 084 085 /** 086 * @return Returns the Leap Indicator. 087 */ 088 public LeapIndicatorType getLeapIndicator() 089 { 090 return leapIndicator; 091 } 092 093 094 /** 095 * @return Returns the Mode. 096 */ 097 public ModeType getMode() 098 { 099 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 }