Clover Coverage Report - JmDNS 3.4.1
Coverage timestamp: Thu Aug 25 2011 13:06:33 CEST
../../../img/srcFileCovDistChart0.png 77% of files have more coverage
11   168   11   1.38
6   54   1   1.6
8     1.38  
5    
 
  NameRegister       Line # 11 0 - 0 0 - -1.0
  NameRegister.NameType       Line # 16 0 - 0 0 - -1.0
  NameRegister.UniqueNamePerInterface       Line # 27 2 0% 3 5 0% 0.0
  NameRegister.UniqueNameAcrossInterface       Line # 61 2 0% 3 5 0% 0.0
  NameRegister.Factory       Line # 95 7 0% 5 15 0% 0.0
 
No Tests
 
1    /**
2    *
3    */
4    package javax.jmdns.impl;
5   
6    import java.net.InetAddress;
7   
8    /**
9    *
10    */
 
11    public interface NameRegister {
12   
13    /**
14    *
15    */
 
16    public enum NameType {
17    /**
18    * This name represents a host name
19    */
20    HOST,
21    /**
22    * This name represents a service name
23    */
24    SERVICE,
25    }
26   
 
27    public static class UniqueNamePerInterface implements NameRegister {
28   
29    /*
30    * (non-Javadoc)
31    * @see javax.jmdns.impl.NameRegister#register(java.net.InetAddress, java.lang.String, javax.jmdns.impl.NameRegister.NameType)
32    */
 
33  0 toggle @Override
34    public void register(InetAddress networkInterface, String name, NameType type) {
35    // TODO Auto-generated method stub
36   
37    }
38   
39    /*
40    * (non-Javadoc)
41    * @see javax.jmdns.impl.NameRegister#checkName(java.net.InetAddress, java.lang.String, javax.jmdns.impl.NameRegister.NameType)
42    */
 
43  0 toggle @Override
44    public boolean checkName(InetAddress networkInterface, String name, NameType type) {
45    // TODO Auto-generated method stub
46  0 return false;
47    }
48   
49    /*
50    * (non-Javadoc)
51    * @see javax.jmdns.impl.NameRegister#incrementHostName(java.net.InetAddress, java.lang.String, javax.jmdns.impl.NameRegister.NameType)
52    */
 
53  0 toggle @Override
54    public String incrementHostName(InetAddress networkInterface, String name, NameType type) {
55    // TODO Auto-generated method stub
56  0 return null;
57    }
58   
59    }
60   
 
61    public static class UniqueNameAcrossInterface implements NameRegister {
62   
63    /*
64    * (non-Javadoc)
65    * @see javax.jmdns.impl.NameRegister#register(java.net.InetAddress, java.lang.String, javax.jmdns.impl.NameRegister.NameType)
66    */
 
67  0 toggle @Override
68    public void register(InetAddress networkInterface, String name, NameType type) {
69    // TODO Auto-generated method stub
70   
71    }
72   
73    /*
74    * (non-Javadoc)
75    * @see javax.jmdns.impl.NameRegister#checkName(java.net.InetAddress, java.lang.String, javax.jmdns.impl.NameRegister.NameType)
76    */
 
77  0 toggle @Override
78    public boolean checkName(InetAddress networkInterface, String name, NameType type) {
79    // TODO Auto-generated method stub
80  0 return false;
81    }
82   
83    /*
84    * (non-Javadoc)
85    * @see javax.jmdns.impl.NameRegister#incrementHostName(java.net.InetAddress, java.lang.String, javax.jmdns.impl.NameRegister.NameType)
86    */
 
87  0 toggle @Override
88    public String incrementHostName(InetAddress networkInterface, String name, NameType type) {
89    // TODO Auto-generated method stub
90  0 return null;
91    }
92   
93    }
94   
 
95    public static class Factory {
96   
97    private static volatile NameRegister _register;
98   
99    /**
100    * Register a Name register.
101    *
102    * @param register
103    * new register
104    * @throws IllegalStateException
105    * the register can only be set once
106    */
 
107  0 toggle public static void setRegistry(NameRegister register) throws IllegalStateException {
108  0 if (_register != null) {
109  0 throw new IllegalStateException("The register can only be set once.");
110    }
111  0 if (register != null) {
112  0 _register = register;
113    }
114    }
115   
116    /**
117    * Returns the name register.
118    *
119    * @return name register
120    */
 
121  0 toggle public static NameRegister getRegistry() {
122  0 if (_register == null) {
123  0 _register = new UniqueNamePerInterface();
124    }
125  0 return _register;
126    }
127   
128    }
129   
130    /**
131    * Registers a name that is defended by this group of mDNS.
132    *
133    * @param networkInterface
134    * IP address to handle
135    * @param name
136    * name to register
137    * @param type
138    * name type to register
139    */
140    public abstract void register(InetAddress networkInterface, String name, NameType type);
141   
142    /**
143    * Checks a name that is defended by this group of mDNS.
144    *
145    * @param networkInterface
146    * IP address to handle
147    * @param name
148    * name to check
149    * @param type
150    * name type to check
151    * @return <code>true</code> if the name is not in conflict, <code>flase</code> otherwise.
152    */
153    public abstract boolean checkName(InetAddress networkInterface, String name, NameType type);
154   
155    /**
156    * Increments a name that is defended by this group of mDNS after it has been found in conflict.
157    *
158    * @param networkInterface
159    * IP address to handle
160    * @param name
161    * name to increment
162    * @param type
163    * name type to increments
164    * @return new name
165    */
166    public abstract String incrementHostName(InetAddress networkInterface, String name, NameType type);
167   
168    }