Go to the documentation of this file.00001
00002
00003
00004
00005 package javax.jmdns;
00006
00007 import java.io.Closeable;
00008 import java.io.IOException;
00009 import java.net.InetAddress;
00010 import java.util.Collection;
00011 import java.util.Map;
00012
00013 import javax.jmdns.impl.JmDNSImpl;
00014
00020 public abstract class JmDNS implements Closeable {
00021
00025 public static interface Delegate {
00026
00035 public void cannotRecoverFromIOError(JmDNS dns, Collection<ServiceInfo> infos);
00036
00037 }
00038
00042 public static final String VERSION = "3.4.2";
00043
00059 public static JmDNS create() throws IOException {
00060 return new JmDNSImpl(null, null);
00061 }
00062
00080 public static JmDNS create(final InetAddress addr) throws IOException {
00081 return new JmDNSImpl(addr, null);
00082 }
00083
00101 public static JmDNS create(final String name) throws IOException {
00102 return new JmDNSImpl(null, name);
00103 }
00104
00136 public static JmDNS create(final InetAddress addr, final String name) throws IOException {
00137 return new JmDNSImpl(addr, name);
00138 }
00139
00145 public abstract String getName();
00146
00152 public abstract String getHostName();
00153
00161 public abstract InetAddress getInetAddress() throws IOException;
00162
00171 @Deprecated
00172 public abstract InetAddress getInterface() throws IOException;
00173
00185 public abstract ServiceInfo getServiceInfo(String type, String name);
00186
00200 public abstract ServiceInfo getServiceInfo(String type, String name, long timeout);
00201
00215 public abstract ServiceInfo getServiceInfo(String type, String name, boolean persistent);
00216
00232 public abstract ServiceInfo getServiceInfo(String type, String name, boolean persistent, long timeout);
00233
00244 public abstract void requestServiceInfo(String type, String name);
00245
00258 public abstract void requestServiceInfo(String type, String name, boolean persistent);
00259
00270 public abstract void requestServiceInfo(String type, String name, long timeout);
00271
00284 public abstract void requestServiceInfo(String type, String name, boolean persistent, long timeout);
00285
00294 public abstract void addServiceTypeListener(ServiceTypeListener listener) throws IOException;
00295
00302 public abstract void removeServiceTypeListener(ServiceTypeListener listener);
00303
00312 public abstract void addServiceListener(String type, ServiceListener listener);
00313
00322 public abstract void removeServiceListener(String type, ServiceListener listener);
00323
00333 public abstract void registerService(ServiceInfo info) throws IOException;
00334
00350 public abstract void unregisterService(ServiceInfo info);
00351
00355 public abstract void unregisterAllServices();
00356
00367 public abstract boolean registerServiceType(String type);
00368
00374 @Deprecated
00375 public abstract void printServices();
00376
00384 public abstract ServiceInfo[] list(String type);
00385
00395 public abstract ServiceInfo[] list(String type, long timeout);
00396
00404 public abstract Map<String, ServiceInfo[]> listBySubtype(String type);
00405
00415 public abstract Map<String, ServiceInfo[]> listBySubtype(String type, long timeout);
00416
00422 public abstract Delegate getDelegate();
00423
00431 public abstract Delegate setDelegate(Delegate value);
00432
00433 }