| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
package javax.jmdns.impl; |
| 5 |
|
|
| 6 |
|
import java.net.InetAddress; |
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 0 |
Complexity Density: - |
|
| 11 |
|
public interface NameRegister { |
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 0 |
Complexity Density: - |
|
| 16 |
|
public enum NameType { |
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
HOST, |
| 21 |
|
|
| 22 |
|
|
| 23 |
|
|
| 24 |
|
SERVICE, |
| 25 |
|
} |
| 26 |
|
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 3 |
Complexity Density: 1.5 |
|
| 27 |
|
public static class UniqueNamePerInterface implements NameRegister { |
| 28 |
|
|
| 29 |
|
|
| 30 |
|
|
| 31 |
|
@see |
| 32 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 33 |
0
|
@Override... |
| 34 |
|
public void register(InetAddress networkInterface, String name, NameType type) { |
| 35 |
|
|
| 36 |
|
|
| 37 |
|
} |
| 38 |
|
|
| 39 |
|
|
| 40 |
|
|
| 41 |
|
@see |
| 42 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 43 |
0
|
@Override... |
| 44 |
|
public boolean checkName(InetAddress networkInterface, String name, NameType type) { |
| 45 |
|
|
| 46 |
0
|
return false; |
| 47 |
|
} |
| 48 |
|
|
| 49 |
|
|
| 50 |
|
|
| 51 |
|
@see |
| 52 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 53 |
0
|
@Override... |
| 54 |
|
public String incrementHostName(InetAddress networkInterface, String name, NameType type) { |
| 55 |
|
|
| 56 |
0
|
return null; |
| 57 |
|
} |
| 58 |
|
|
| 59 |
|
} |
| 60 |
|
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 3 |
Complexity Density: 1.5 |
|
| 61 |
|
public static class UniqueNameAcrossInterface implements NameRegister { |
| 62 |
|
|
| 63 |
|
|
| 64 |
|
|
| 65 |
|
@see |
| 66 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 67 |
0
|
@Override... |
| 68 |
|
public void register(InetAddress networkInterface, String name, NameType type) { |
| 69 |
|
|
| 70 |
|
|
| 71 |
|
} |
| 72 |
|
|
| 73 |
|
|
| 74 |
|
|
| 75 |
|
@see |
| 76 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 77 |
0
|
@Override... |
| 78 |
|
public boolean checkName(InetAddress networkInterface, String name, NameType type) { |
| 79 |
|
|
| 80 |
0
|
return false; |
| 81 |
|
} |
| 82 |
|
|
| 83 |
|
|
| 84 |
|
|
| 85 |
|
@see |
| 86 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 87 |
0
|
@Override... |
| 88 |
|
public String incrementHostName(InetAddress networkInterface, String name, NameType type) { |
| 89 |
|
|
| 90 |
0
|
return null; |
| 91 |
|
} |
| 92 |
|
|
| 93 |
|
} |
| 94 |
|
|
|
|
|
| 0% |
Uncovered Elements: 15 (15) |
Complexity: 5 |
Complexity Density: 0.71 |
|
| 95 |
|
public static class Factory { |
| 96 |
|
|
| 97 |
|
private static volatile NameRegister _register; |
| 98 |
|
|
| 99 |
|
|
| 100 |
|
|
| 101 |
|
|
| 102 |
|
@param |
| 103 |
|
|
| 104 |
|
@throws |
| 105 |
|
|
| 106 |
|
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 3 |
Complexity Density: 0.75 |
|
| 107 |
0
|
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 |
|
|
| 118 |
|
|
| 119 |
|
@return |
| 120 |
|
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 121 |
0
|
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 |
|
|
| 132 |
|
|
| 133 |
|
@param |
| 134 |
|
|
| 135 |
|
@param |
| 136 |
|
|
| 137 |
|
@param |
| 138 |
|
|
| 139 |
|
|
| 140 |
|
public abstract void register(InetAddress networkInterface, String name, NameType type); |
| 141 |
|
|
| 142 |
|
|
| 143 |
|
|
| 144 |
|
|
| 145 |
|
@param |
| 146 |
|
|
| 147 |
|
@param |
| 148 |
|
|
| 149 |
|
@param |
| 150 |
|
|
| 151 |
|
@return |
| 152 |
|
|
| 153 |
|
public abstract boolean checkName(InetAddress networkInterface, String name, NameType type); |
| 154 |
|
|
| 155 |
|
|
| 156 |
|
|
| 157 |
|
|
| 158 |
|
@param |
| 159 |
|
|
| 160 |
|
@param |
| 161 |
|
|
| 162 |
|
@param |
| 163 |
|
|
| 164 |
|
@return |
| 165 |
|
|
| 166 |
|
public abstract String incrementHostName(InetAddress networkInterface, String name, NameType type); |
| 167 |
|
|
| 168 |
|
} |