ServiceEventImpl.java
Go to the documentation of this file.
00001 // /Copyright 2003-2005 Arthur van Hoff, Rick Blair
00002 // Licensed under Apache License version 2.0
00003 // Original license LGPL
00004 
00005 package javax.jmdns.impl;
00006 
00007 import javax.jmdns.JmDNS;
00008 import javax.jmdns.ServiceEvent;
00009 import javax.jmdns.ServiceInfo;
00010 
00019 public class ServiceEventImpl extends ServiceEvent {
00023     private static final long serialVersionUID = 7107973622016897488L;
00024     // private static Logger logger = Logger.getLogger(ServiceEvent.class.getName());
00028     private final String      _type;
00032     private final String      _name;
00036     private final ServiceInfo _info;
00037 
00050     public ServiceEventImpl(JmDNSImpl jmDNS, String type, String name, ServiceInfo info) {
00051         super(jmDNS);
00052         this._type = type;
00053         this._name = name;
00054         this._info = info;
00055     }
00056 
00057     /*
00058      * (non-Javadoc)
00059      * @see javax.jmdns.ServiceEvent#getDNS()
00060      */
00061     @Override
00062     public JmDNS getDNS() {
00063         return (JmDNS) getSource();
00064     }
00065 
00066     /*
00067      * (non-Javadoc)
00068      * @see javax.jmdns.ServiceEvent#getType()
00069      */
00070     @Override
00071     public String getType() {
00072         return _type;
00073     }
00074 
00075     /*
00076      * (non-Javadoc)
00077      * @see javax.jmdns.ServiceEvent#getName()
00078      */
00079     @Override
00080     public String getName() {
00081         return _name;
00082     }
00083 
00084     /*
00085      * (non-Javadoc)
00086      * @see java.util.EventObject#toString()
00087      */
00088     @Override
00089     public String toString() {
00090         StringBuilder buf = new StringBuilder();
00091         buf.append("[" + this.getClass().getSimpleName() + "@" + System.identityHashCode(this) + " ");
00092         buf.append("\n\tname: '");
00093         buf.append(this.getName());
00094         buf.append("' type: '");
00095         buf.append(this.getType());
00096         buf.append("' info: '");
00097         buf.append(this.getInfo());
00098         buf.append("']");
00099         // buf.append("' source: ");
00100         // buf.append("\n\t" + source + "");
00101         // buf.append("\n]");
00102         return buf.toString();
00103     }
00104 
00105     /*
00106      * (non-Javadoc)
00107      * @see javax.jmdns.ServiceEvent#getInfo()
00108      */
00109     @Override
00110     public ServiceInfo getInfo() {
00111         return _info;
00112     }
00113 
00114     /*
00115      * (non-Javadoc)
00116      * @see javax.jmdns.ServiceEvent#clone()
00117      */
00118     @Override
00119     public ServiceEventImpl clone() {
00120         ServiceInfoImpl newInfo = new ServiceInfoImpl(this.getInfo());
00121         return new ServiceEventImpl((JmDNSImpl) this.getDNS(), this.getType(), this.getName(), newInfo);
00122     }
00123 
00124 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends


zeroconf_jmdns
Author(s): Daniel Stonier
autogenerated on Tue Nov 6 2012 14:18:57