dns_sd

16:35:24.888 INFO  jd.cli.Main - Decompiling dns_sd.jar
package com.apple.dnssd;

class AppleBrowser
  extends AppleService
{
  public AppleBrowser(int paramInt1, int paramInt2, String paramString1, String paramString2, BrowseListener paramBrowseListener)
    throws DNSSDException
  {
    super(paramBrowseListener);
    ThrowOnErr(CreateBrowser(paramInt1, paramInt2, paramString1, paramString2));
    if (!AppleDNSSD.hasAutoCallbacks) {
      new Thread(this).start();
    }
  }
  
  protected native int CreateBrowser(int paramInt1, int paramInt2, String paramString1, String paramString2);
}

/* Location:
 * Qualified Name:     com.apple.dnssd.AppleBrowser
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.apple.dnssd;

class AppleDNSRecord
  implements DNSRecord
{
  protected long fRecord;
  protected AppleService fOwner;
  
  public AppleDNSRecord(AppleService paramAppleService)
  {
    fOwner = paramAppleService;
    fRecord = 0L;
  }
  
  public void update(int paramInt1, byte[] paramArrayOfByte, int paramInt2)
    throws DNSSDException
  {
    ThrowOnErr(Update(paramInt1, paramArrayOfByte, paramInt2));
  }
  
  public void remove()
    throws DNSSDException
  {
    ThrowOnErr(Remove());
  }
  
  protected void ThrowOnErr(int paramInt)
    throws DNSSDException
  {
    if (paramInt != 0) {
      throw new AppleDNSSDException(paramInt);
    }
  }
  
  protected native int Update(int paramInt1, byte[] paramArrayOfByte, int paramInt2);
  
  protected native int Remove();
}

/* Location:
 * Qualified Name:     com.apple.dnssd.AppleDNSRecord
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.apple.dnssd;

class AppleDNSSD
  extends DNSSD
{
  public static boolean hasAutoCallbacks;
  
  static
  {
    System.loadLibrary("jdns_sd");
    
    int i = InitLibrary(2);
    if (i != 0) {
      throw new InternalError("cannot instantiate DNSSD: " + new AppleDNSSDException(i).getMessage());
    }
  }
  
  protected DNSSDService _makeBrowser(int paramInt1, int paramInt2, String paramString1, String paramString2, BrowseListener paramBrowseListener)
    throws DNSSDException
  {
    return new AppleBrowser(paramInt1, paramInt2, paramString1, paramString2, paramBrowseListener);
  }
  
  protected DNSSDService _resolve(int paramInt1, int paramInt2, String paramString1, String paramString2, String paramString3, ResolveListener paramResolveListener)
    throws DNSSDException
  {
    return new AppleResolver(paramInt1, paramInt2, paramString1, paramString2, paramString3, paramResolveListener);
  }
  
  protected DNSSDRegistration _register(int paramInt1, int paramInt2, String paramString1, String paramString2, String paramString3, String paramString4, int paramInt3, TXTRecord paramTXTRecord, RegisterListener paramRegisterListener)
    throws DNSSDException
  {
    return new AppleRegistration(paramInt1, paramInt2, paramString1, paramString2, paramString3, paramString4, paramInt3, paramTXTRecord != null ? paramTXTRecord.getRawBytes() : null, paramRegisterListener);
  }
  
  protected DNSSDRecordRegistrar _createRecordRegistrar(RegisterRecordListener paramRegisterRecordListener)
    throws DNSSDException
  {
    return new AppleRecordRegistrar(paramRegisterRecordListener);
  }
  
  protected DNSSDService _queryRecord(int paramInt1, int paramInt2, String paramString, int paramInt3, int paramInt4, QueryListener paramQueryListener)
    throws DNSSDException
  {
    return new AppleQuery(paramInt1, paramInt2, paramString, paramInt3, paramInt4, paramQueryListener);
  }
  
  protected DNSSDService _enumerateDomains(int paramInt1, int paramInt2, DomainListener paramDomainListener)
    throws DNSSDException
  {
    return new AppleDomainEnum(paramInt1, paramInt2, paramDomainListener);
  }
  
  protected String _constructFullName(String paramString1, String paramString2, String paramString3)
    throws DNSSDException
  {
    String[] arrayOfString = new String[1];
    
    int i = ConstructName(paramString1, paramString2, paramString3, arrayOfString);
    if (i != 0) {
      throw new AppleDNSSDException(i);
    }
    return arrayOfString[0];
  }
  
  protected void _reconfirmRecord(int paramInt1, int paramInt2, String paramString, int paramInt3, int paramInt4, byte[] paramArrayOfByte)
  {
    ReconfirmRecord(paramInt1, paramInt2, paramString, paramInt3, paramInt4, paramArrayOfByte);
  }
  
  protected String _getNameForIfIndex(int paramInt)
  {
    return GetNameForIfIndex(paramInt);
  }
  
  protected int _getIfIndexForName(String paramString)
  {
    return GetIfIndexForName(paramString);
  }
  
  protected native int ConstructName(String paramString1, String paramString2, String paramString3, String[] paramArrayOfString);
  
  protected native void ReconfirmRecord(int paramInt1, int paramInt2, String paramString, int paramInt3, int paramInt4, byte[] paramArrayOfByte);
  
  protected native String GetNameForIfIndex(int paramInt);
  
  protected native int GetIfIndexForName(String paramString);
  
  protected static native int InitLibrary(int paramInt);
}

/* Location:
 * Qualified Name:     com.apple.dnssd.AppleDNSSD
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.apple.dnssd;

class AppleDNSSDException
  extends DNSSDException
{
  protected int fErrorCode;
  
  public AppleDNSSDException(int paramInt)
  {
    fErrorCode = paramInt;
  }
  
  public int getErrorCode()
  {
    return fErrorCode;
  }
  
  public String getMessage()
  {
    String[] arrayOfString = { "UNKNOWN", "NO_SUCH_NAME", "NO_MEMORY", "BAD_PARAM", "BAD_REFERENCE", "BAD_STATE", "BAD_FLAGS", "UNSUPPORTED", "NOT_INITIALIZED", "NO_CACHE", "ALREADY_REGISTERED", "NAME_CONFLICT", "INVALID", "FIREWALL", "INCOMPATIBLE", "BAD_INTERFACE_INDEX", "REFUSED", "NOSUCHRECORD", "NOAUTH", "NOSUCHKEY", "NATTRAVERSAL", "DOUBLENAT", "BADTIME", "BADSIG", "BADKEY", "TRANSIENT", "SERVICENOTRUNNING", "NATPORTMAPPINGUNSUPPORTED", "NATPORTMAPPINGDISABLED" };
    if ((fErrorCode <= -65537) && (fErrorCode > -65537 - arrayOfString.length)) {
      return "DNS-SD Error " + String.valueOf(fErrorCode) + ": " + arrayOfString[(-65537 - fErrorCode)];
    }
    return super.getMessage() + "(" + String.valueOf(fErrorCode) + ")";
  }
}

/* Location:
 * Qualified Name:     com.apple.dnssd.AppleDNSSDException
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.apple.dnssd;

class AppleDomainEnum
  extends AppleService
{
  public AppleDomainEnum(int paramInt1, int paramInt2, DomainListener paramDomainListener)
    throws DNSSDException
  {
    super(paramDomainListener);
    ThrowOnErr(BeginEnum(paramInt1, paramInt2));
    if (!AppleDNSSD.hasAutoCallbacks) {
      new Thread(this).start();
    }
  }
  
  protected native int BeginEnum(int paramInt1, int paramInt2);
}

/* Location:
 * Qualified Name:     com.apple.dnssd.AppleDomainEnum
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.apple.dnssd;

class AppleQuery
  extends AppleService
{
  public AppleQuery(int paramInt1, int paramInt2, String paramString, int paramInt3, int paramInt4, QueryListener paramQueryListener)
    throws DNSSDException
  {
    super(paramQueryListener);
    ThrowOnErr(CreateQuery(paramInt1, paramInt2, paramString, paramInt3, paramInt4));
    if (!AppleDNSSD.hasAutoCallbacks) {
      new Thread(this).start();
    }
  }
  
  protected native int CreateQuery(int paramInt1, int paramInt2, String paramString, int paramInt3, int paramInt4);
}

/* Location:
 * Qualified Name:     com.apple.dnssd.AppleQuery
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.apple.dnssd;

class AppleRecordRegistrar
  extends AppleService
  implements DNSSDRecordRegistrar
{
  public AppleRecordRegistrar(RegisterRecordListener paramRegisterRecordListener)
    throws DNSSDException
  {
    super(paramRegisterRecordListener);
    ThrowOnErr(CreateConnection());
    if (!AppleDNSSD.hasAutoCallbacks) {
      new Thread(this).start();
    }
  }
  
  public DNSRecord registerRecord(int paramInt1, int paramInt2, String paramString, int paramInt3, int paramInt4, byte[] paramArrayOfByte, int paramInt5)
    throws DNSSDException
  {
    AppleDNSRecord localAppleDNSRecord = new AppleDNSRecord(this);
    
    ThrowOnErr(RegisterRecord(paramInt1, paramInt2, paramString, paramInt3, paramInt4, paramArrayOfByte, paramInt5, localAppleDNSRecord));
    return localAppleDNSRecord;
  }
  
  protected native int CreateConnection();
  
  protected native int RegisterRecord(int paramInt1, int paramInt2, String paramString, int paramInt3, int paramInt4, byte[] paramArrayOfByte, int paramInt5, AppleDNSRecord paramAppleDNSRecord);
}

/* Location:
 * Qualified Name:     com.apple.dnssd.AppleRecordRegistrar
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.apple.dnssd;

class AppleRegistration
  extends AppleService
  implements DNSSDRegistration
{
  public AppleRegistration(int paramInt1, int paramInt2, String paramString1, String paramString2, String paramString3, String paramString4, int paramInt3, byte[] paramArrayOfByte, RegisterListener paramRegisterListener)
    throws DNSSDException
  {
    super(paramRegisterListener);
    ThrowOnErr(BeginRegister(paramInt2, paramInt1, paramString1, paramString2, paramString3, paramString4, paramInt3, paramArrayOfByte));
    if (!AppleDNSSD.hasAutoCallbacks) {
      new Thread(this).start();
    }
  }
  
  public DNSRecord addRecord(int paramInt1, int paramInt2, byte[] paramArrayOfByte, int paramInt3)
    throws DNSSDException
  {
    AppleDNSRecord localAppleDNSRecord = new AppleDNSRecord(this);
    
    ThrowOnErr(AddRecord(paramInt1, paramInt2, paramArrayOfByte, paramInt3, localAppleDNSRecord));
    return localAppleDNSRecord;
  }
  
  public DNSRecord getTXTRecord()
    throws DNSSDException
  {
    return new AppleDNSRecord(this);
  }
  
  protected native int BeginRegister(int paramInt1, int paramInt2, String paramString1, String paramString2, String paramString3, String paramString4, int paramInt3, byte[] paramArrayOfByte);
  
  protected native int AddRecord(int paramInt1, int paramInt2, byte[] paramArrayOfByte, int paramInt3, AppleDNSRecord paramAppleDNSRecord);
}

/* Location:
 * Qualified Name:     com.apple.dnssd.AppleRegistration
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.apple.dnssd;

class AppleResolver
  extends AppleService
{
  public AppleResolver(int paramInt1, int paramInt2, String paramString1, String paramString2, String paramString3, ResolveListener paramResolveListener)
    throws DNSSDException
  {
    super(paramResolveListener);
    ThrowOnErr(CreateResolver(paramInt1, paramInt2, paramString1, paramString2, paramString3));
    if (!AppleDNSSD.hasAutoCallbacks) {
      new Thread(this).start();
    }
  }
  
  protected native int CreateResolver(int paramInt1, int paramInt2, String paramString1, String paramString2, String paramString3);
}

/* Location:
 * Qualified Name:     com.apple.dnssd.AppleResolver
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.apple.dnssd;

class AppleService
  implements DNSSDService, Runnable
{
  protected long fNativeContext;
  protected BaseListener fListener;
  
  public AppleService(BaseListener paramBaseListener)
  {
    fNativeContext = 0L;fListener = paramBaseListener;
  }
  
  public void stop()
  {
    HaltOperation();
  }
  
  protected native int BlockForData();
  
  protected native int ProcessResults();
  
  protected synchronized native void HaltOperation();
  
  protected void ThrowOnErr(int paramInt)
    throws DNSSDException
  {
    if (paramInt != 0) {
      throw new AppleDNSSDException(paramInt);
    }
  }
  
  public void run()
  {
    for (;;)
    {
      int i = BlockForData();
      synchronized (this)
      {
        if (fNativeContext != 0L) {
          if (i != 0)
          {
            i = ProcessResults();
            if (fNativeContext != 0L) {
              if (i != 0) {
                fListener.operationFailed(this, i);
              }
            }
          }
        }
      }
    }
  }
}

/* Location:
 * Qualified Name:     com.apple.dnssd.AppleService
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.apple.dnssd;

public abstract interface BaseListener
{
  public abstract void operationFailed(DNSSDService paramDNSSDService, int paramInt);
}

/* Location:
 * Qualified Name:     com.apple.dnssd.BaseListener
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.apple.dnssd;

public abstract interface BrowseListener
  extends BaseListener
{
  public abstract void serviceFound(DNSSDService paramDNSSDService, int paramInt1, int paramInt2, String paramString1, String paramString2, String paramString3);
  
  public abstract void serviceLost(DNSSDService paramDNSSDService, int paramInt1, int paramInt2, String paramString1, String paramString2, String paramString3);
}

/* Location:
 * Qualified Name:     com.apple.dnssd.BrowseListener
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.apple.dnssd;

public abstract interface DNSRecord
{
  public abstract void update(int paramInt1, byte[] paramArrayOfByte, int paramInt2)
    throws DNSSDException;
  
  public abstract void remove()
    throws DNSSDException;
}

/* Location:
 * Qualified Name:     com.apple.dnssd.DNSRecord
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.apple.dnssd;

public abstract class DNSSD
{
  public static final int MORE_COMING = 1;
  public static final int DEFAULT = 4;
  public static final int NO_AUTO_RENAME = 8;
  public static final int SHARED = 16;
  public static final int UNIQUE = 32;
  public static final int BROWSE_DOMAINS = 64;
  public static final int REGISTRATION_DOMAINS = 128;
  public static final int MAX_DOMAIN_NAME = 1009;
  public static final int ALL_INTERFACES = 0;
  public static final int LOCALHOST_ONLY = -1;
  protected static DNSSD fInstance;
  
  public static DNSSDService browse(int paramInt1, int paramInt2, String paramString1, String paramString2, BrowseListener paramBrowseListener)
    throws DNSSDException
  {
    return getInstance()._makeBrowser(paramInt1, paramInt2, paramString1, paramString2, paramBrowseListener);
  }
  
  public static DNSSDService browse(String paramString, BrowseListener paramBrowseListener)
    throws DNSSDException
  {
    return browse(0, 0, paramString, "", paramBrowseListener);
  }
  
  public static DNSSDService resolve(int paramInt1, int paramInt2, String paramString1, String paramString2, String paramString3, ResolveListener paramResolveListener)
    throws DNSSDException
  {
    return getInstance()._resolve(paramInt1, paramInt2, paramString1, paramString2, paramString3, paramResolveListener);
  }
  
  public static DNSSDRegistration register(int paramInt1, int paramInt2, String paramString1, String paramString2, String paramString3, String paramString4, int paramInt3, TXTRecord paramTXTRecord, RegisterListener paramRegisterListener)
    throws DNSSDException
  {
    return getInstance()._register(paramInt1, paramInt2, paramString1, paramString2, paramString3, paramString4, paramInt3, paramTXTRecord, paramRegisterListener);
  }
  
  public static DNSSDRegistration register(String paramString1, String paramString2, int paramInt, RegisterListener paramRegisterListener)
    throws DNSSDException
  {
    return register(0, 0, paramString1, paramString2, null, null, paramInt, null, paramRegisterListener);
  }
  
  public static DNSSDRecordRegistrar createRecordRegistrar(RegisterRecordListener paramRegisterRecordListener)
    throws DNSSDException
  {
    return getInstance()._createRecordRegistrar(paramRegisterRecordListener);
  }
  
  public static DNSSDService queryRecord(int paramInt1, int paramInt2, String paramString, int paramInt3, int paramInt4, QueryListener paramQueryListener)
    throws DNSSDException
  {
    return getInstance()._queryRecord(paramInt1, paramInt2, paramString, paramInt3, paramInt4, paramQueryListener);
  }
  
  public static DNSSDService enumerateDomains(int paramInt1, int paramInt2, DomainListener paramDomainListener)
    throws DNSSDException
  {
    return getInstance()._enumerateDomains(paramInt1, paramInt2, paramDomainListener);
  }
  
  public static String constructFullName(String paramString1, String paramString2, String paramString3)
    throws DNSSDException
  {
    return getInstance()._constructFullName(paramString1, paramString2, paramString3);
  }
  
  public static void reconfirmRecord(int paramInt1, int paramInt2, String paramString, int paramInt3, int paramInt4, byte[] paramArrayOfByte)
  {
    getInstance()._reconfirmRecord(paramInt1, paramInt2, paramString, paramInt3, paramInt4, paramArrayOfByte);
  }
  
  public static String getNameForIfIndex(int paramInt)
  {
    return getInstance()._getNameForIfIndex(paramInt);
  }
  
  public static int getIfIndexForName(String paramString)
  {
    return getInstance()._getIfIndexForName(paramString);
  }
  
  protected static final DNSSD getInstance()
  {
    SecurityManager localSecurityManager = System.getSecurityManager();
    if (localSecurityManager != null) {
      localSecurityManager.checkPermission(new RuntimePermission("getDNSSDInstance"));
    }
    return fInstance;
  }
  
  protected abstract DNSSDService _makeBrowser(int paramInt1, int paramInt2, String paramString1, String paramString2, BrowseListener paramBrowseListener)
    throws DNSSDException;
  
  protected abstract DNSSDService _resolve(int paramInt1, int paramInt2, String paramString1, String paramString2, String paramString3, ResolveListener paramResolveListener)
    throws DNSSDException;
  
  protected abstract DNSSDRegistration _register(int paramInt1, int paramInt2, String paramString1, String paramString2, String paramString3, String paramString4, int paramInt3, TXTRecord paramTXTRecord, RegisterListener paramRegisterListener)
    throws DNSSDException;
  
  protected abstract DNSSDRecordRegistrar _createRecordRegistrar(RegisterRecordListener paramRegisterRecordListener)
    throws DNSSDException;
  
  protected abstract DNSSDService _queryRecord(int paramInt1, int paramInt2, String paramString, int paramInt3, int paramInt4, QueryListener paramQueryListener)
    throws DNSSDException;
  
  protected abstract DNSSDService _enumerateDomains(int paramInt1, int paramInt2, DomainListener paramDomainListener)
    throws DNSSDException;
  
  protected abstract String _constructFullName(String paramString1, String paramString2, String paramString3)
    throws DNSSDException;
  
  protected abstract void _reconfirmRecord(int paramInt1, int paramInt2, String paramString, int paramInt3, int paramInt4, byte[] paramArrayOfByte);
  
  protected abstract String _getNameForIfIndex(int paramInt);
  
  protected abstract int _getIfIndexForName(String paramString);
  
  static
  {
    try
    {
      String str = System.getProperty("com.apple.dnssd.DNSSD");
      if (str == null) {
        str = "com.apple.dnssd.AppleDNSSD";
      }
      fInstance = (DNSSD)Class.forName(str).newInstance();
    }
    catch (Exception localException)
    {
      throw new InternalError("cannot instantiate DNSSD" + localException);
    }
  }
}

/* Location:
 * Qualified Name:     com.apple.dnssd.DNSSD
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.apple.dnssd;

public abstract class DNSSDException
  extends Exception
{
  public static final int NO_ERROR = 0;
  public static final int UNKNOWN = -65537;
  public static final int NO_SUCH_NAME = -65538;
  public static final int NO_MEMORY = -65539;
  public static final int BAD_PARAM = -65540;
  public static final int BAD_REFERENCE = -65541;
  public static final int BAD_STATE = -65542;
  public static final int BAD_FLAGS = -65543;
  public static final int UNSUPPORTED = -65544;
  public static final int NOT_INITIALIZED = -65545;
  public static final int NO_CACHE = -65546;
  public static final int ALREADY_REGISTERED = -65547;
  public static final int NAME_CONFLICT = -65548;
  public static final int INVALID = -65549;
  public static final int FIREWALL = -65550;
  public static final int INCOMPATIBLE = -65551;
  public static final int BAD_INTERFACE_INDEX = -65552;
  public static final int REFUSED = -65553;
  public static final int NOSUCHRECORD = -65554;
  public static final int NOAUTH = -65555;
  public static final int NOSUCHKEY = -65556;
  public static final int NATTRAVERSAL = -65557;
  public static final int DOUBLENAT = -65558;
  public static final int BADTIME = -65559;
  public static final int BADSIG = -65560;
  public static final int BADKEY = -65561;
  public static final int TRANSIENT = -65562;
  public static final int SERVICENOTRUNNING = -65563;
  public static final int NATPORTMAPPINGUNSUPPORTED = -65564;
  public static final int NATPORTMAPPINGDISABLED = -65565;
  
  public abstract int getErrorCode();
}

/* Location:
 * Qualified Name:     com.apple.dnssd.DNSSDException
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.apple.dnssd;

public abstract interface DNSSDRecordRegistrar
  extends DNSSDService
{
  public abstract DNSRecord registerRecord(int paramInt1, int paramInt2, String paramString, int paramInt3, int paramInt4, byte[] paramArrayOfByte, int paramInt5)
    throws DNSSDException;
}

/* Location:
 * Qualified Name:     com.apple.dnssd.DNSSDRecordRegistrar
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.apple.dnssd;

public abstract interface DNSSDRegistration
  extends DNSSDService
{
  public abstract DNSRecord getTXTRecord()
    throws DNSSDException;
  
  public abstract DNSRecord addRecord(int paramInt1, int paramInt2, byte[] paramArrayOfByte, int paramInt3)
    throws DNSSDException;
}

/* Location:
 * Qualified Name:     com.apple.dnssd.DNSSDRegistration
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.apple.dnssd;

public abstract interface DNSSDService
{
  public abstract void stop();
}

/* Location:
 * Qualified Name:     com.apple.dnssd.DNSSDService
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.apple.dnssd;

public abstract interface DomainListener
  extends BaseListener
{
  public abstract void domainFound(DNSSDService paramDNSSDService, int paramInt1, int paramInt2, String paramString);
  
  public abstract void domainLost(DNSSDService paramDNSSDService, int paramInt1, int paramInt2, String paramString);
}

/* Location:
 * Qualified Name:     com.apple.dnssd.DomainListener
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.apple.dnssd;

public abstract interface QueryListener
  extends BaseListener
{
  public abstract void queryAnswered(DNSSDService paramDNSSDService, int paramInt1, int paramInt2, String paramString, int paramInt3, int paramInt4, byte[] paramArrayOfByte, int paramInt5);
}

/* Location:
 * Qualified Name:     com.apple.dnssd.QueryListener
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.apple.dnssd;

public abstract interface RegisterListener
  extends BaseListener
{
  public abstract void serviceRegistered(DNSSDRegistration paramDNSSDRegistration, int paramInt, String paramString1, String paramString2, String paramString3);
}

/* Location:
 * Qualified Name:     com.apple.dnssd.RegisterListener
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.apple.dnssd;

public abstract interface RegisterRecordListener
  extends BaseListener
{
  public abstract void recordRegistered(DNSRecord paramDNSRecord, int paramInt);
}

/* Location:
 * Qualified Name:     com.apple.dnssd.RegisterRecordListener
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.apple.dnssd;

public abstract interface ResolveListener
  extends BaseListener
{
  public abstract void serviceResolved(DNSSDService paramDNSSDService, int paramInt1, int paramInt2, String paramString1, String paramString2, int paramInt3, TXTRecord paramTXTRecord);
}

/* Location:
 * Qualified Name:     com.apple.dnssd.ResolveListener
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.apple.dnssd;

import java.io.UnsupportedEncodingException;

public class TXTRecord
{
  protected static final byte kAttrSep = 61;
  protected byte[] fBytes;
  
  public TXTRecord()
  {
    fBytes = new byte[0];
  }
  
  public TXTRecord(byte[] paramArrayOfByte)
  {
    fBytes = ((byte[])paramArrayOfByte.clone());
  }
  
  public void set(String paramString1, String paramString2)
  {
    byte[] arrayOfByte = paramString2 != null ? paramString2.getBytes() : null;
    set(paramString1, arrayOfByte);
  }
  
  public void set(String paramString, byte[] paramArrayOfByte)
  {
    int i = paramArrayOfByte != null ? paramArrayOfByte.length : 0;
    byte[] arrayOfByte;
    try
    {
      arrayOfByte = paramString.getBytes("US-ASCII");
    }
    catch (UnsupportedEncodingException localUnsupportedEncodingException)
    {
      throw new IllegalArgumentException();
    }
    for (int j = 0; j < arrayOfByte.length; j++) {
      if (arrayOfByte[j] == 61) {
        throw new IllegalArgumentException();
      }
    }
    if (arrayOfByte.length + i >= 255) {
      throw new ArrayIndexOutOfBoundsException();
    }
    j = remove(paramString);
    if (j == -1) {
      j = size();
    }
    insert(arrayOfByte, paramArrayOfByte, j);
  }
  
  protected void insert(byte[] paramArrayOfByte1, byte[] paramArrayOfByte2, int paramInt)
  {
    byte[] arrayOfByte = fBytes;
    int i = paramArrayOfByte2 != null ? paramArrayOfByte2.length : 0;
    int j = 0;
    for (int n = 0; (n < paramInt) && (j < fBytes.length); n++) {
      j += (0xFF & fBytes[j] + 1);
    }
    int m = paramArrayOfByte1.length + i + (paramArrayOfByte2 != null ? 1 : 0);
    int k = m + arrayOfByte.length + 1;
    
    fBytes = new byte[k];
    System.arraycopy(arrayOfByte, 0, fBytes, 0, j);
    n = arrayOfByte.length - j;
    System.arraycopy(arrayOfByte, j, fBytes, k - n, n);
    fBytes[j] = ((byte)m);
    System.arraycopy(paramArrayOfByte1, 0, fBytes, j + 1, paramArrayOfByte1.length);
    if (paramArrayOfByte2 != null)
    {
      fBytes[(j + 1 + paramArrayOfByte1.length)] = 61;
      System.arraycopy(paramArrayOfByte2, 0, fBytes, j + paramArrayOfByte1.length + 2, i);
    }
  }
  
  public int remove(String paramString)
  {
    int i = 0;
    for (int j = 0; i < fBytes.length; j++)
    {
      int k = fBytes[i];
      if ((paramString.length() <= k) && ((paramString.length() == k) || (fBytes[(i + paramString.length() + 1)] == 61)))
      {
        String str = new String(fBytes, i + 1, paramString.length());
        if (0 == paramString.compareToIgnoreCase(str))
        {
          byte[] arrayOfByte = fBytes;
          fBytes = new byte[arrayOfByte.length - k - 1];
          System.arraycopy(arrayOfByte, 0, fBytes, 0, i);
          System.arraycopy(arrayOfByte, i + k + 1, fBytes, i, arrayOfByte.length - i - k - 1);
          return j;
        }
      }
      i += (0xFF & k + 1);
    }
    return -1;
  }
  
  public int size()
  {
    int i = 0;
    for (int j = 0; j < fBytes.length; i++) {
      j += (0xFF & fBytes[j] + 1);
    }
    return i;
  }
  
  public boolean contains(String paramString)
  {
    String str = null;
    for (int i = 0; null != (str = getKey(i)); i++) {
      if (0 == paramString.compareToIgnoreCase(str)) {
        return true;
      }
    }
    return false;
  }
  
  public String getKey(int paramInt)
  {
    int i = 0;
    for (int j = 0; (j < paramInt) && (i < fBytes.length); j++) {
      i += fBytes[i] + 1;
    }
    if (i < fBytes.length)
    {
      j = fBytes[i];
      int k = 0;
      for (k = 0; k < j; k++) {
        if (fBytes[(i + k + 1)] == 61) {
          break;
        }
      }
      return new String(fBytes, i + 1, k);
    }
    return null;
  }
  
  public byte[] getValue(int paramInt)
  {
    int i = 0;
    byte[] arrayOfByte = null;
    for (int j = 0; (j < paramInt) && (i < fBytes.length); j++) {
      i += fBytes[i] + 1;
    }
    if (i < fBytes.length)
    {
      j = fBytes[i];
      int k = 0;
      for (k = 0; k < j; k++) {
        if (fBytes[(i + k + 1)] == 61)
        {
          arrayOfByte = new byte[j - k - 1];
          System.arraycopy(fBytes, i + k + 2, arrayOfByte, 0, j - k - 1);
          break;
        }
      }
    }
    return arrayOfByte;
  }
  
  public String getValueAsString(int paramInt)
  {
    byte[] arrayOfByte = getValue(paramInt);
    return arrayOfByte != null ? new String(arrayOfByte) : null;
  }
  
  public byte[] getValue(String paramString)
  {
    String str = null;
    for (int i = 0; null != (str = getKey(i)); i++) {
      if (0 == paramString.compareToIgnoreCase(str)) {
        return getValue(i);
      }
    }
    return null;
  }
  
  public String getValueAsString(String paramString)
  {
    byte[] arrayOfByte = getValue(paramString);
    return arrayOfByte != null ? new String(arrayOfByte) : null;
  }
  
  public byte[] getRawBytes()
  {
    return (byte[])fBytes.clone();
  }
  
  public String toString()
  {
    Object localObject = null;
    String str1;
    for (int i = 0; null != (str1 = getKey(i)); i++)
    {
      String str2 = String.valueOf(i) + "={" + str1;
      String str3 = getValueAsString(i);
      if (str3 != null) {
        str2 = str2 + "=" + str3 + "}";
      } else {
        str2 = str2 + "}";
      }
      if (localObject == null) {
        localObject = str2;
      } else {
        localObject = (String)localObject + ", " + str2;
      }
    }
    return (String)(localObject != null ? localObject : "");
  }
}

/* Location:
 * Qualified Name:     com.apple.dnssd.TXTRecord
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
1

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd