Source Code Cross Referenced for NtpV3Packet.java in  » Net » Apache-commons-net-1.4.1 » org » apache » commons » net » ntp » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » Apache commons net 1.4.1 » org.apache.commons.net.ntp 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.apache.commons.net.ntp;
002:
003:        /*
004:         * Copyright 2001-2005 The Apache Software Foundation
005:         *
006:         * Licensed under the Apache License, Version 2.0 (the "License");
007:         * you may not use this file except in compliance with the License.
008:         * 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, software
013:         * distributed under the License is distributed on an "AS IS" BASIS,
014:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015:         * See the License for the specific language governing permissions and
016:         * limitations under the License.
017:         */
018:
019:        import java.net.DatagramPacket;
020:
021:        /**
022:         * Interface for a NtpV3Packet with get/set methods corresponding to the fields
023:         * in the NTP Data Message Header described in RFC 1305.
024:         *
025:         * @author Naz Irizarry, MITRE Corp
026:         * @author Jason Mathews, MITRE Corp
027:         * @version $Revision: 165675 $ $Date: 2005-05-02 15:09:55 -0500 (Mon, 02 May 2005) $
028:         */
029:        public interface NtpV3Packet {
030:
031:            /**
032:             * Standard NTP UDP port
033:             */
034:            public static final int NTP_PORT = 123;
035:
036:            public static final int LI_NO_WARNING = 0;
037:            public static final int LI_LAST_MINUTE_HAS_61_SECONDS = 1;
038:            public static final int LI_LAST_MINUTE_HAS_59_SECONDS = 2;
039:            public static final int LI_ALARM_CONDITION = 3;
040:
041:            /* mode options */
042:            public static final int MODE_RESERVED = 0;
043:            public static final int MODE_SYMMETRIC_ACTIVE = 1;
044:            public static final int MODE_SYMMETRIC_PASSIVE = 2;
045:            public static final int MODE_CLIENT = 3;
046:            public static final int MODE_SERVER = 4;
047:            public static final int MODE_BROADCAST = 5;
048:            public static final int MODE_CONTROL_MESSAGE = 6;
049:            public static final int MODE_PRIVATE = 7;
050:
051:            public static final int NTP_MINPOLL = 4; // 16 seconds
052:            public static final int NTP_MAXPOLL = 14; // 16284 seconds
053:
054:            public static final int NTP_MINCLOCK = 1;
055:            public static final int NTP_MAXCLOCK = 10;
056:
057:            public static final int VERSION_3 = 3;
058:            public static final int VERSION_4 = 4;
059:
060:            /* possible getType values such that other time-related protocols can
061:             * have its information represented as NTP packets
062:             */
063:            public static final String TYPE_NTP = "NTP"; // RFC-1305/2030
064:            public static final String TYPE_ICMP = "ICMP"; // RFC-792
065:            public static final String TYPE_TIME = "TIME"; // RFC-868
066:            public static final String TYPE_DAYTIME = "DAYTIME"; // RFC-867
067:
068:            /**
069:             * @return a datagram packet with the NTP parts already filled in
070:             */
071:            public DatagramPacket getDatagramPacket();
072:
073:            /**
074:             * Set the contents of this object from the datagram packet
075:             */
076:            public void setDatagramPacket(DatagramPacket dp);
077:
078:            /**
079:             * @return leap indicator as defined in RFC-1305
080:             */
081:            public int getLeapIndicator();
082:
083:            /**
084:             * Set leap indicator.
085:             * @param li - leap indicator code
086:             */
087:            public void setLeapIndicator(int li);
088:
089:            /**
090:             * @return mode as defined in RFC-1305
091:             */
092:            public int getMode();
093:
094:            /**
095:             * @return mode as human readable string; e.g. 3=Client
096:             */
097:            public String getModeName();
098:
099:            /**
100:             * Set mode as defined in RFC-1305
101:             */
102:            public void setMode(int mode);
103:
104:            /**
105:             * @return poll interval as defined in RFC-1305.
106:             * Field range between NTP_MINPOLL and NTP_MAXPOLL.
107:             */
108:            public int getPoll();
109:
110:            /**
111:             * Set poll interval as defined in RFC-1305.
112:             * Field range between NTP_MINPOLL and NTP_MAXPOLL.
113:             */
114:            public void setPoll(int poll);
115:
116:            /**
117:             * @return precision as defined in RFC-1305
118:             */
119:            public int getPrecision();
120:
121:            /**
122:             * @return root delay as defined in RFC-1305
123:             */
124:            public int getRootDelay();
125:
126:            /**
127:             * @return root delay in milliseconds
128:             */
129:            public double getRootDelayInMillisDouble();
130:
131:            /**
132:             * @return root dispersion as defined in RFC-1305
133:             */
134:            public int getRootDispersion();
135:
136:            /**
137:             * @return root dispersion in milliseconds
138:             */
139:            public long getRootDispersionInMillis();
140:
141:            /**
142:             * @return root dispersion in milliseconds
143:             */
144:            public double getRootDispersionInMillisDouble();
145:
146:            /**
147:             * @return version as defined in RFC-1305
148:             */
149:            public int getVersion();
150:
151:            /**
152:             * Set version as defined in RFC-1305
153:             */
154:            public void setVersion(int mode);
155:
156:            /**
157:             * @return stratum as defined in RFC-1305
158:             */
159:            public int getStratum();
160:
161:            /**
162:             * Set stratum as defined in RFC-1305
163:             */
164:            public void setStratum(int stratum);
165:
166:            /**
167:             * @return the reference id string
168:             */
169:            public String getReferenceIdString();
170:
171:            /**
172:             * @return the reference id (32-bit code) as defined in RFC-1305
173:             */
174:            public int getReferenceId();
175:
176:            /**
177:             * Set reference clock identifier field.
178:             * @param refId
179:             */
180:            public void setReferenceId(int refId);
181:
182:            /**
183:             * @return the transmit timestamp as defined in RFC-1305
184:             */
185:            public TimeStamp getTransmitTimeStamp();
186:
187:            /**
188:             * @return the reference time as defined in RFC-1305
189:             */
190:            public TimeStamp getReferenceTimeStamp();
191:
192:            /**
193:             * @return the originate time as defined in RFC-1305
194:             */
195:            public TimeStamp getOriginateTimeStamp();
196:
197:            /**
198:             * @return the receive time as defined in RFC-1305
199:             */
200:            public TimeStamp getReceiveTimeStamp();
201:
202:            /**
203:             * Set the transmit timestamp given NTP TimeStamp object.
204:             * @param ts - timestamp
205:             */
206:            public void setTransmitTime(TimeStamp ts);
207:
208:            /**
209:             * Set the reference timestamp given NTP TimeStamp object.
210:             * @param ts - timestamp
211:             */
212:            public void setReferenceTime(TimeStamp ts);
213:
214:            /**
215:             * Set originate timestamp given NTP TimeStamp object.
216:             * @param ts - timestamp
217:             */
218:            public void setOriginateTimeStamp(TimeStamp ts);
219:
220:            /**
221:             * Set receive timestamp given NTP TimeStamp object.
222:             * @param ts - timestamp
223:             */
224:            public void setReceiveTimeStamp(TimeStamp ts);
225:
226:            /**
227:             * Return type of time packet. The values (e.g. NTP, TIME, ICMP, ...)
228:             * correspond to the protocol used to obtain the timing information.
229:             *
230:             * @return packet type string identifier
231:             */
232:            public String getType();
233:
234:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.