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 021package org.apache.directory.server.ntp.messages; 022 023 024/** 025 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 026 */ 027public class NtpMessage 028{ 029 private LeapIndicatorType leapIndicator; 030 private int versionNumber; 031 private ModeType mode; 032 private StratumType stratumType; 033 private byte pollInterval; 034 private byte precision; 035 private int rootDelay; 036 private int rootDispersion; 037 038 private ReferenceIdentifier referenceIdentifier; 039 040 private NtpTimeStamp referenceTimestamp; 041 private NtpTimeStamp originateTimestamp; 042 private NtpTimeStamp receiveTimestamp; 043 private NtpTimeStamp transmitTimestamp; 044 045 046 /** 047 * Creates a new instance of NtpMessage. 048 * 049 * @param leapIndicator 050 * @param versionNumber 051 * @param mode 052 * @param stratumType 053 * @param pollInterval 054 * @param precision 055 * @param rootDelay 056 * @param rootDispersion 057 * @param referenceIdentifier 058 * @param referenceTimestamp 059 * @param originateTimestamp 060 * @param receiveTimestamp 061 * @param transmitTimestamp 062 */ 063 public NtpMessage( LeapIndicatorType leapIndicator, int versionNumber, ModeType mode, StratumType stratumType, 064 byte pollInterval, byte precision, int rootDelay, int rootDispersion, ReferenceIdentifier referenceIdentifier, 065 NtpTimeStamp referenceTimestamp, NtpTimeStamp originateTimestamp, NtpTimeStamp receiveTimestamp, 066 NtpTimeStamp transmitTimestamp ) 067 { 068 this.leapIndicator = leapIndicator; 069 this.versionNumber = versionNumber; 070 this.mode = mode; 071 this.stratumType = stratumType; 072 this.pollInterval = pollInterval; 073 this.precision = precision; 074 this.rootDelay = rootDelay; 075 this.rootDispersion = rootDispersion; 076 this.referenceIdentifier = referenceIdentifier; 077 this.referenceTimestamp = referenceTimestamp; 078 this.originateTimestamp = originateTimestamp; 079 this.receiveTimestamp = receiveTimestamp; 080 this.transmitTimestamp = transmitTimestamp; 081 } 082 083 084 /** 085 * @return Returns the Leap Indicator. 086 */ 087 public LeapIndicatorType getLeapIndicator() 088 { 089 return leapIndicator; 090 } 091 092 093 /** 094 * @return Returns the Mode. 095 */ 096 public ModeType getMode() 097 { 098 return mode; 099 } 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}