From 2f848cd91f899fe3de2701085ee720b96ba317c0 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 12 Oct 2003 03:24:56 +0000 Subject: Allow passing a path to the Path class constructor. --- .../fancydress/directory/IncomingMMTPSection.java | 10 ++++ src/org/noreply/fancydress/directory/Server.java | 20 ++++++-- .../fancydress/directory/ServerDescriptor.java | 59 ++++++++++++++++++---- .../noreply/fancydress/status/Mix3Exception.java | 2 +- src/org/noreply/fancydress/type3/HalfPath.java | 53 ++++++++++++++++++- src/org/noreply/fancydress/type3/Path.java | 23 +++------ .../fancydress/type3/routing/RoutingHOST.java | 4 +- .../fancydress/type3/routing/RoutingIP4.java | 4 +- 8 files changed, 138 insertions(+), 37 deletions(-) diff --git a/src/org/noreply/fancydress/directory/IncomingMMTPSection.java b/src/org/noreply/fancydress/directory/IncomingMMTPSection.java index bd1ec67..92e17d7 100644 --- a/src/org/noreply/fancydress/directory/IncomingMMTPSection.java +++ b/src/org/noreply/fancydress/directory/IncomingMMTPSection.java @@ -100,4 +100,14 @@ public class IncomingMMTPSection { protocols = entryProtocols.getValue(); } + + public InetAddress getIP() { + return ip; + } + public String getHostname() { + return hostname; + } + public int getPort() { + return port; + } } diff --git a/src/org/noreply/fancydress/directory/Server.java b/src/org/noreply/fancydress/directory/Server.java index 53455f4..c4052d9 100644 --- a/src/org/noreply/fancydress/directory/Server.java +++ b/src/org/noreply/fancydress/directory/Server.java @@ -77,11 +77,23 @@ public class Server { } /** - * get the first server descriptor (needs fixing). + * get the the currently valid server descriptor. * - * @return first server descriptor + * @return current server descriptor */ - public ServerDescriptor getDescriptor() { /* FIXME */ - return (ServerDescriptor) descriptors.get(0); + public ServerDescriptor getDescriptor() throws Mix3Exception { + ServerDescriptor result = null; + Date now = new Date(); + + for (int i=0; i