|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ServiceEventImpl | Line # 19 | 20 | 0% | 7 | 0 | 100% |
1.0
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (19) | |||
| Result | |||
|
0.8888889
|
javax.jmdns.test.JmDNSTest.testUnregisterAndReregisterService
javax.jmdns.test.JmDNSTest.testUnregisterAndReregisterService
|
1 PASS | |
|
0.8888889
|
javax.jmdns.test.JmDNSTest.testWaitAndQueryForServiceOnOtherRegistry
javax.jmdns.test.JmDNSTest.testWaitAndQueryForServiceOnOtherRegistry
|
1 PASS | |
|
0.8888889
|
javax.jmdns.test.JmDNSTest.testQueryMyService
javax.jmdns.test.JmDNSTest.testQueryMyService
|
1 PASS | |
|
0.8888889
|
javax.jmdns.test.JmDNSTest.testListenForMyService
javax.jmdns.test.JmDNSTest.testListenForMyService
|
1 PASS | |
|
0.8148148
|
javax.jmdns.test.JmDNSTest.testRegisterAndListServiceOnOtherRegistry
javax.jmdns.test.JmDNSTest.testRegisterAndListServiceOnOtherRegistry
|
1 PASS | |
|
0.5925926
|
javax.jmdns.test.TextUpdateTest.testSubtype
javax.jmdns.test.TextUpdateTest.testSubtype
|
1 PASS | |
|
0.5925926
|
javax.jmdns.test.TextUpdateTest.testListenForTextUpdateOnOtherRegistry
javax.jmdns.test.TextUpdateTest.testListenForTextUpdateOnOtherRegistry
|
1 PASS | |
|
0.5925926
|
javax.jmdns.test.TextUpdateTest.testRegisterCaseSensitiveField
javax.jmdns.test.TextUpdateTest.testRegisterCaseSensitiveField
|
1 PASS | |
|
0.5925926
|
javax.jmdns.test.TextUpdateTest.testRenewExpiringRequests
javax.jmdns.test.TextUpdateTest.testRenewExpiringRequests
|
1 PASS | |
|
0.5925926
|
javax.jmdns.test.TextUpdateTest.testRegisterEmptyTXTField
javax.jmdns.test.TextUpdateTest.testRegisterEmptyTXTField
|
1 PASS | |
|
0.4814815
|
javax.jmdns.test.JmDNSTest.testUnregisterService
javax.jmdns.test.JmDNSTest.testUnregisterService
|
1 PASS | |
|
0.4814815
|
javax.jmdns.test.JmDNSTest.testListMyServiceWithToLowerCase
javax.jmdns.test.JmDNSTest.testListMyServiceWithToLowerCase
|
1 PASS | |
|
0.4814815
|
javax.jmdns.test.JmDNSTest.testListMyService
javax.jmdns.test.JmDNSTest.testListMyService
|
1 PASS | |
|
0.4814815
|
javax.jmdns.test.JmDNSTest.testListMyServiceWithoutLowerCase
javax.jmdns.test.JmDNSTest.testListMyServiceWithoutLowerCase
|
1 PASS | |
|
0.4814815
|
javax.jmdns.test.JmDNSTest.testListenForMyServiceAndList
javax.jmdns.test.JmDNSTest.testListenForMyServiceAndList
|
1 PASS | |
|
0.4814815
|
javax.jmdns.test.JmDNSTest.testListMyServiceIPV6
javax.jmdns.test.JmDNSTest.testListMyServiceIPV6
|
1 PASS | |
|
0.4814815
|
javax.jmdns.test.JmDNSTest.testListenForServiceOnOtherRegistry
javax.jmdns.test.JmDNSTest.testListenForServiceOnOtherRegistry
|
1 PASS | |
|
0.4074074
|
javax.jmdns.test.JmDNSTest.testRegisterServiceTwice
javax.jmdns.test.JmDNSTest.testRegisterServiceTwice
|
1 PASS | |
|
0.4074074
|
javax.jmdns.test.JmDNSTest.testRegisterService
javax.jmdns.test.JmDNSTest.testRegisterService
|
1 PASS | |
| 1 | // /Copyright 2003-2005 Arthur van Hoff, Rick Blair | |
| 2 | // Licensed under Apache License version 2.0 | |
| 3 | // Original license LGPL | |
| 4 | ||
| 5 | package javax.jmdns.impl; | |
| 6 | ||
| 7 | import javax.jmdns.JmDNS; | |
| 8 | import javax.jmdns.ServiceEvent; | |
| 9 | import javax.jmdns.ServiceInfo; | |
| 10 | ||
| 11 | /** | |
| 12 | * ServiceEvent. | |
| 13 | * | |
| 14 | * @author Werner Randelshofer, Rick Blair | |
| 15 | */ | |
| 16 | /** | |
| 17 | * | |
| 18 | */ | |
| 19 | public class ServiceEventImpl extends ServiceEvent { | |
| 20 | /** | |
| 21 | * | |
| 22 | */ | |
| 23 | private static final long serialVersionUID = 7107973622016897488L; | |
| 24 | // private static Logger logger = Logger.getLogger(ServiceEvent.class.getName()); | |
| 25 | /** | |
| 26 | * The type name of the service. | |
| 27 | */ | |
| 28 | private final String _type; | |
| 29 | /** | |
| 30 | * The instance name of the service. Or null, if the event was fired to a service type listener. | |
| 31 | */ | |
| 32 | private final String _name; | |
| 33 | /** | |
| 34 | * The service info record, or null if the service could be be resolved. This is also null, if the event was fired to a service type listener. | |
| 35 | */ | |
| 36 | private final ServiceInfo _info; | |
| 37 | ||
| 38 | /** | |
| 39 | * Creates a new instance. | |
| 40 | * | |
| 41 | * @param jmDNS | |
| 42 | * the JmDNS instance which originated the event. | |
| 43 | * @param type | |
| 44 | * the type name of the service. | |
| 45 | * @param name | |
| 46 | * the instance name of the service. | |
| 47 | * @param info | |
| 48 | * the service info record, or null if the service could be be resolved. | |
| 49 | */ | |
| 50 | 229 |
public ServiceEventImpl(JmDNSImpl jmDNS, String type, String name, ServiceInfo info) { |
| 51 | 227 | super(jmDNS); |
| 52 | 229 | this._type = type; |
| 53 | 228 | this._name = name; |
| 54 | 229 | this._info = info; |
| 55 | } | |
| 56 | ||
| 57 | /* | |
| 58 | * (non-Javadoc) | |
| 59 | * @see javax.jmdns.ServiceEvent#getDNS() | |
| 60 | */ | |
| 61 | 31 |
@Override |
| 62 | public JmDNS getDNS() { | |
| 63 | 31 | return (JmDNS) getSource(); |
| 64 | } | |
| 65 | ||
| 66 | /* | |
| 67 | * (non-Javadoc) | |
| 68 | * @see javax.jmdns.ServiceEvent#getType() | |
| 69 | */ | |
| 70 | 326 |
@Override |
| 71 | public String getType() { | |
| 72 | 327 | return _type; |
| 73 | } | |
| 74 | ||
| 75 | /* | |
| 76 | * (non-Javadoc) | |
| 77 | * @see javax.jmdns.ServiceEvent#getName() | |
| 78 | */ | |
| 79 | 290 |
@Override |
| 80 | public String getName() { | |
| 81 | 290 | return _name; |
| 82 | } | |
| 83 | ||
| 84 | /* | |
| 85 | * (non-Javadoc) | |
| 86 | * @see java.util.EventObject#toString() | |
| 87 | */ | |
| 88 | 7 |
@Override |
| 89 | public String toString() { | |
| 90 | 7 | StringBuilder buf = new StringBuilder(); |
| 91 | 7 | buf.append("[" + this.getClass().getSimpleName() + "@" + System.identityHashCode(this) + " "); |
| 92 | 7 | buf.append("\n\tname: '"); |
| 93 | 7 | buf.append(this.getName()); |
| 94 | 7 | buf.append("' type: '"); |
| 95 | 7 | buf.append(this.getType()); |
| 96 | 7 | buf.append("' info: '"); |
| 97 | 7 | buf.append(this.getInfo()); |
| 98 | 7 | buf.append("']"); |
| 99 | // buf.append("' source: "); | |
| 100 | // buf.append("\n\t" + source + ""); | |
| 101 | // buf.append("\n]"); | |
| 102 | 7 | return buf.toString(); |
| 103 | } | |
| 104 | ||
| 105 | /* | |
| 106 | * (non-Javadoc) | |
| 107 | * @see javax.jmdns.ServiceEvent#getInfo() | |
| 108 | */ | |
| 109 | 304 |
@Override |
| 110 | public ServiceInfo getInfo() { | |
| 111 | 305 | return _info; |
| 112 | } | |
| 113 | ||
| 114 | /* | |
| 115 | * (non-Javadoc) | |
| 116 | * @see javax.jmdns.ServiceEvent#clone() | |
| 117 | */ | |
| 118 | 14 |
@Override |
| 119 | public ServiceEventImpl clone() { | |
| 120 | 14 | ServiceInfoImpl newInfo = new ServiceInfoImpl(this.getInfo()); |
| 121 | 14 | return new ServiceEventImpl((JmDNSImpl) this.getDNS(), this.getType(), this.getName(), newInfo); |
| 122 | } | |
| 123 | ||
| 124 | } | |
|
||||||||||||