ServiceInfo.java
Go to the documentation of this file.
00001 // Copyright 2003-2005 Arthur van Hoff, Rick Blair
00002 // Licensed under Apache License version 2.0
00003 // Original license LGPL
00004 package javax.jmdns;
00005 
00006 import java.net.Inet4Address;
00007 import java.net.Inet6Address;
00008 import java.net.InetAddress;
00009 import java.util.Enumeration;
00010 import java.util.Map;
00011 
00012 import javax.jmdns.impl.ServiceInfoImpl;
00013 
00033 public abstract class ServiceInfo implements Cloneable {
00034 
00038     public static final byte[] NO_VALUE = new byte[0];
00039 
00043     public enum Fields {
00047         Domain,
00051         Protocol,
00055         Application,
00059         Instance,
00063         Subtype
00064     }
00065 
00079     public static ServiceInfo create(final String type, final String name, final int port, final String text) {
00080         return new ServiceInfoImpl(type, name, "", port, 0, 0, false, text);
00081     }
00082 
00098     public static ServiceInfo create(final String type, final String name, final String subtype, final int port, final String text) {
00099         return new ServiceInfoImpl(type, name, subtype, port, 0, 0, false, text);
00100     }
00101 
00119     public static ServiceInfo create(final String type, final String name, final int port, final int weight, final int priority, final String text) {
00120         return new ServiceInfoImpl(type, name, "", port, weight, priority, false, text);
00121     }
00122 
00142     public static ServiceInfo create(final String type, final String name, final String subtype, final int port, final int weight, final int priority, final String text) {
00143         return new ServiceInfoImpl(type, name, subtype, port, weight, priority, false, text);
00144     }
00145 
00163     public static ServiceInfo create(final String type, final String name, final int port, final int weight, final int priority, final Map<String, ?> props) {
00164         return new ServiceInfoImpl(type, name, "", port, weight, priority, false, props);
00165     }
00166 
00186     public static ServiceInfo create(final String type, final String name, final String subtype, final int port, final int weight, final int priority, final Map<String, ?> props) {
00187         return new ServiceInfoImpl(type, name, subtype, port, weight, priority, false, props);
00188     }
00189 
00207     public static ServiceInfo create(final String type, final String name, final int port, final int weight, final int priority, final byte[] text) {
00208         return new ServiceInfoImpl(type, name, "", port, weight, priority, false, text);
00209     }
00210 
00230     public static ServiceInfo create(final String type, final String name, final String subtype, final int port, final int weight, final int priority, final byte[] text) {
00231         return new ServiceInfoImpl(type, name, subtype, port, weight, priority, false, text);
00232     }
00233 
00253     public static ServiceInfo create(final String type, final String name, final int port, final int weight, final int priority, final boolean persistent, final String text) {
00254         return new ServiceInfoImpl(type, name, "", port, weight, priority, persistent, text);
00255     }
00256 
00278     public static ServiceInfo create(final String type, final String name, final String subtype, final int port, final int weight, final int priority, final boolean persistent, final String text) {
00279         return new ServiceInfoImpl(type, name, subtype, port, weight, priority, persistent, text);
00280     }
00281 
00301     public static ServiceInfo create(final String type, final String name, final int port, final int weight, final int priority, final boolean persistent, final Map<String, ?> props) {
00302         return new ServiceInfoImpl(type, name, "", port, weight, priority, persistent, props);
00303     }
00304 
00326     public static ServiceInfo create(final String type, final String name, final String subtype, final int port, final int weight, final int priority, final boolean persistent, final Map<String, ?> props) {
00327         return new ServiceInfoImpl(type, name, subtype, port, weight, priority, persistent, props);
00328     }
00329 
00349     public static ServiceInfo create(final String type, final String name, final int port, final int weight, final int priority, final boolean persistent, final byte[] text) {
00350         return new ServiceInfoImpl(type, name, "", port, weight, priority, persistent, text);
00351     }
00352 
00374     public static ServiceInfo create(final String type, final String name, final String subtype, final int port, final int weight, final int priority, final boolean persistent, final byte[] text) {
00375         return new ServiceInfoImpl(type, name, subtype, port, weight, priority, persistent, text);
00376     }
00377 
00395     public static ServiceInfo create(final Map<Fields, String> qualifiedNameMap, final int port, final int weight, final int priority, final boolean persistent, final Map<String, ?> props) {
00396         return new ServiceInfoImpl(qualifiedNameMap, port, weight, priority, persistent, props);
00397     }
00398 
00404     public abstract boolean hasData();
00405 
00411     public abstract String getType();
00412 
00418     public abstract String getTypeWithSubtype();
00419 
00425     public abstract String getName();
00426 
00433     public abstract String getKey();
00434 
00440     public abstract String getQualifiedName();
00441 
00447     public abstract String getServer();
00448 
00457     @Deprecated
00458     public abstract String getHostAddress();
00459 
00465     public abstract String[] getHostAddresses();
00466 
00474     @Deprecated
00475     public abstract InetAddress getAddress();
00476 
00485     @Deprecated
00486     public abstract InetAddress getInetAddress();
00487 
00496     @Deprecated
00497     public abstract Inet4Address getInet4Address();
00498 
00507     @Deprecated
00508     public abstract Inet6Address getInet6Address();
00509 
00518     public abstract InetAddress[] getInetAddresses();
00519 
00528     public abstract Inet4Address[] getInet4Addresses();
00529 
00538     public abstract Inet6Address[] getInet6Addresses();
00539 
00545     public abstract int getPort();
00546 
00552     public abstract int getPriority();
00553 
00559     public abstract int getWeight();
00560 
00566     public abstract byte[] getTextBytes();
00567 
00578     @Deprecated
00579     public abstract String getTextString();
00580 
00588     @Deprecated
00589     public abstract String getURL();
00590 
00596     public abstract String[] getURLs();
00597 
00607     @Deprecated
00608     public abstract String getURL(String protocol);
00609 
00617     public abstract String[] getURLs(String protocol);
00618 
00626     public abstract byte[] getPropertyBytes(final String name);
00627 
00635     public abstract String getPropertyString(final String name);
00636 
00642     public abstract Enumeration<String> getPropertyNames();
00643 
00649     public abstract String getNiceTextString();
00650 
00659     public abstract void setText(final byte[] text) throws IllegalStateException;
00660 
00669     public abstract void setText(final Map<String, ?> props) throws IllegalStateException;
00670 
00676     public abstract boolean isPersistent();
00677 
00683     public abstract String getDomain();
00684 
00690     public abstract String getProtocol();
00691 
00697     public abstract String getApplication();
00698 
00704     public abstract String getSubtype();
00705 
00711     public abstract Map<Fields, String> getQualifiedNameMap();
00712 
00713     /*
00714      * (non-Javadoc)
00715      * @see java.lang.Object#clone()
00716      */
00717     @Override
00718     public ServiceInfo clone() {
00719         try {
00720             return (ServiceInfo) super.clone();
00721         } catch (CloneNotSupportedException exception) {
00722             // clone is supported
00723             return null;
00724         }
00725     }
00726 
00727 }


zeroconf_jmdns_suite
Author(s): Daniel Stonier
autogenerated on Thu Aug 27 2015 15:50:27