summaryrefslogtreecommitdiff
path: root/src/javax/jmdns/ServiceEvent.java
blob: d32df00e83e2f53de8bbd402d840b4c59d3217af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// Copyright 2003-2005 Arthur van Hoff, Rick Blair
// Licensed under Apache License version 2.0
// Original license LGPL

package javax.jmdns;

import java.util.EventObject;

/**
 *
 */
public abstract class ServiceEvent extends EventObject implements Cloneable {

    /**
     *
     */
    private static final long serialVersionUID = -8558445644541006271L;

    /**
     * Constructs a Service Event.
     * 
     * @param eventSource
     *            The object on which the Event initially occurred.
     * @exception IllegalArgumentException
     *                if source is null.
     */
    public ServiceEvent(final Object eventSource) {
        super(eventSource);
    }

    /**
     * Returns the JmDNS instance which originated the event.
     * 
     * @return JmDNS instance
     */
    public abstract JmDNS getDNS();

    /**
     * Returns the fully qualified type of the service.
     * 
     * @return type of the service.
     */
    public abstract String getType();

    /**
     * Returns the instance name of the service. Always returns null, if the event is sent to a service type listener.
     * 
     * @return name of the service
     */
    public abstract String getName();

    /**
     * Returns the service info record, or null if the service could not be resolved. Always returns null, if the event is sent to a service type listener.
     * 
     * @return service info record
     * @see javax.jmdns.ServiceEvent#getInfo()
     */
    public abstract ServiceInfo getInfo();

    /*
     * (non-Javadoc)
     * @see java.lang.Object#clone()
     */
    @Override
    public ServiceEvent clone() {
        try {
            return (ServiceEvent) super.clone();
        } catch (CloneNotSupportedException exception) {
            // clone is supported
            return null;
        }
    }

}