NameRegister.java
Go to the documentation of this file.
00001 
00004 package javax.jmdns.impl;
00005 
00006 import java.net.InetAddress;
00007 
00011 public interface NameRegister {
00012 
00016     public enum NameType {
00020         HOST,
00024         SERVICE,
00025     }
00026 
00027     public static class UniqueNamePerInterface implements NameRegister {
00028 
00029         /*
00030          * (non-Javadoc)
00031          * @see javax.jmdns.impl.NameRegister#register(java.net.InetAddress, java.lang.String, javax.jmdns.impl.NameRegister.NameType)
00032          */
00033         @Override
00034         public void register(InetAddress networkInterface, String name, NameType type) {
00035             // TODO Auto-generated method stub
00036 
00037         }
00038 
00039         /*
00040          * (non-Javadoc)
00041          * @see javax.jmdns.impl.NameRegister#checkName(java.net.InetAddress, java.lang.String, javax.jmdns.impl.NameRegister.NameType)
00042          */
00043         @Override
00044         public boolean checkName(InetAddress networkInterface, String name, NameType type) {
00045             // TODO Auto-generated method stub
00046             return false;
00047         }
00048 
00049         /*
00050          * (non-Javadoc)
00051          * @see javax.jmdns.impl.NameRegister#incrementHostName(java.net.InetAddress, java.lang.String, javax.jmdns.impl.NameRegister.NameType)
00052          */
00053         @Override
00054         public String incrementHostName(InetAddress networkInterface, String name, NameType type) {
00055             // TODO Auto-generated method stub
00056             return null;
00057         }
00058 
00059     }
00060 
00061     public static class UniqueNameAcrossInterface implements NameRegister {
00062 
00063         /*
00064          * (non-Javadoc)
00065          * @see javax.jmdns.impl.NameRegister#register(java.net.InetAddress, java.lang.String, javax.jmdns.impl.NameRegister.NameType)
00066          */
00067         @Override
00068         public void register(InetAddress networkInterface, String name, NameType type) {
00069             // TODO Auto-generated method stub
00070 
00071         }
00072 
00073         /*
00074          * (non-Javadoc)
00075          * @see javax.jmdns.impl.NameRegister#checkName(java.net.InetAddress, java.lang.String, javax.jmdns.impl.NameRegister.NameType)
00076          */
00077         @Override
00078         public boolean checkName(InetAddress networkInterface, String name, NameType type) {
00079             // TODO Auto-generated method stub
00080             return false;
00081         }
00082 
00083         /*
00084          * (non-Javadoc)
00085          * @see javax.jmdns.impl.NameRegister#incrementHostName(java.net.InetAddress, java.lang.String, javax.jmdns.impl.NameRegister.NameType)
00086          */
00087         @Override
00088         public String incrementHostName(InetAddress networkInterface, String name, NameType type) {
00089             // TODO Auto-generated method stub
00090             return null;
00091         }
00092 
00093     }
00094 
00095     public static class Factory {
00096 
00097         private static volatile NameRegister _register;
00098 
00107         public static void setRegistry(NameRegister register) throws IllegalStateException {
00108             if (_register != null) {
00109                 throw new IllegalStateException("The register can only be set once.");
00110             }
00111             if (register != null) {
00112                 _register = register;
00113             }
00114         }
00115 
00121         public static NameRegister getRegistry() {
00122             if (_register == null) {
00123                 _register = new UniqueNamePerInterface();
00124             }
00125             return _register;
00126         }
00127 
00128     }
00129 
00140     public abstract void register(InetAddress networkInterface, String name, NameType type);
00141 
00153     public abstract boolean checkName(InetAddress networkInterface, String name, NameType type);
00154 
00166     public abstract String incrementHostName(InetAddress networkInterface, String name, NameType type);
00167 
00168 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends


zeroconf_jmdns
Author(s): Daniel Stonier
autogenerated on Tue Nov 6 2012 13:08:26