Holger's
Java API

com.antelmann.calendar
Class TimeProtocolServer

java.lang.Object
  extended by com.antelmann.calendar.TimeProtocolServer
All Implemented Interfaces:
Runnable

Deprecated. although there is currently no replacement for a server, use NTPClient instead

@Deprecated
@Todo(value="UDP support")
public class TimeProtocolServer
extends Object
implements Runnable

implements the Network Time Protocol (NTP) using tcp/ip.

Author:
Holger Antelmann
See Also:
TimeProtocolClient

Constructor Summary
TimeProtocolServer()
          Deprecated.  
TimeProtocolServer(int port)
          Deprecated.  
TimeProtocolServer(int port, TimeSystem ts)
          Deprecated.  
TimeProtocolServer(TimeSystem ts)
          Deprecated.  
 
Method Summary
 Calendar getCalendar()
          Deprecated. returns the calendar used to localize the time
 Logger getLogger()
          Deprecated. returns an empty logger w/o writers by default
 TimeSystem getTimeSystem()
          Deprecated. returns TimeSystem.systemTime by default
 void run()
          Deprecated. accepts connection to its port and sends an integer according to NTP.
protected  int secondsSince1900()
          Deprecated. calculates the raw int used by the NTP protocol
 void setCalendar(Calendar cal)
          Deprecated.  
 void setLogger(Logger logger)
          Deprecated.  
 void setTimeSystem(TimeSystem ts)
          Deprecated. allows to use another time system instead of the system time to provide the correct time.
 void shutdown()
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeProtocolServer

public TimeProtocolServer()
                   throws IOException
Deprecated. 
Throws:
IOException

TimeProtocolServer

public TimeProtocolServer(TimeSystem ts)
                   throws IOException
Deprecated. 
Throws:
IOException

TimeProtocolServer

public TimeProtocolServer(int port)
                   throws IOException
Deprecated. 
Throws:
IOException

TimeProtocolServer

public TimeProtocolServer(int port,
                          TimeSystem ts)
                   throws IOException
Deprecated. 
Throws:
IOException
Method Detail

getTimeSystem

public TimeSystem getTimeSystem()
Deprecated. 
returns TimeSystem.systemTime by default


setTimeSystem

public void setTimeSystem(TimeSystem ts)
Deprecated. 
allows to use another time system instead of the system time to provide the correct time. If the value is set to null, TimeSystem.SYSTEM_TIME is used.


getLogger

public Logger getLogger()
Deprecated. 
returns an empty logger w/o writers by default


setLogger

public void setLogger(Logger logger)
Deprecated. 

getCalendar

public Calendar getCalendar()
Deprecated. 
returns the calendar used to localize the time


setCalendar

public void setCalendar(Calendar cal)
Deprecated. 

secondsSince1900

protected int secondsSince1900()
Deprecated. 
calculates the raw int used by the NTP protocol


shutdown

public void shutdown()
Deprecated. 

run

public void run()
Deprecated. 
accepts connection to its port and sends an integer according to NTP. This method ensures that it can only be run by one thread. Calls by other threads to this method will return immediately while the run method is executing.

Specified by:
run in interface Runnable


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads