Package org.xbill.DNS

Examples of org.xbill.DNS.Cache$NegativeElement


    private AtomicInteger requestCounter;

    public BrowserMobHttpClient(StreamManager streamManager, AtomicInteger requestCounter) {
        this.requestCounter = requestCounter;
        SchemeRegistry schemeRegistry = new SchemeRegistry();
        hostNameResolver = new BrowserMobHostNameResolver(new Cache(DClass.ANY));

        this.socketFactory = new SimulatedSocketFactory(hostNameResolver, streamManager);
        this.sslSocketFactory = new TrustingSSLSocketFactory(hostNameResolver, streamManager);

        this.sslSocketFactory.setHostnameVerifier(new AllowAllHostnameVerifier());
View Full Code Here


      time = Integer.parseInt (ct) * 3600;
  } catch (NumberFormatException e) {
      logger.logWarn ("bad number for dnscachetime: '" + ct +
          "', using: " + (time / 3600) + " hours");
  }
  Cache dnsCache = Lookup.getDefaultCache (DClass.IN);
  dnsCache.setMaxCache (time);
  dnsCache.setMaxNCache (time);
    }
View Full Code Here

        return lookupStr;
    }

    public void clearLocalCache() {
        Cache cache = Lookup.getDefaultCache(DClass.IN);
        cache.clearCache();
    }
View Full Code Here

    public String getEnumTopDomain() {
        return myEnumTopDomain;
    }

    public void setDnsCacheSize(int newSize) {
        Cache cache = Lookup.getDefaultCache(DClass.IN);

        synchronized (cache) {
            cache.setMaxEntries(newSize);
        }
    }
View Full Code Here

    private AtomicInteger requestCounter;

    public BrowserMobHttpClient(StreamManager streamManager, AtomicInteger requestCounter) {
        this.requestCounter = requestCounter;
        SchemeRegistry schemeRegistry = new SchemeRegistry();
        hostNameResolver = new BrowserMobHostNameResolver(new Cache(DClass.ANY));

        this.socketFactory = new SimulatedSocketFactory(hostNameResolver, streamManager);
        this.sslSocketFactory = new TrustingSSLSocketFactory(hostNameResolver, streamManager);

        this.sslSocketFactory.setHostnameVerifier(new AllowAllHostnameVerifier());
View Full Code Here

        } else if (getSpfExecutorType() == STAGED_EXECUTOR || getSpfExecutorType() == STAGED_EXECUTOR_MULTITHREADED){
            executor = new StagedMultipleSPFExecutor(log, new DNSServiceAsynchSimulator(dns, getSpfExecutorType() == STAGED_EXECUTOR_MULTITHREADED));
        } else if (getSpfExecutorType() == STAGED_EXECUTOR_DNSJNIO) {
           
            // reset cache between usages of the asynchronous lookuper
            LookupAsynch.setDefaultCache(new Cache(), DClass.IN);
            // reset cache between usages of the asynchronous lookuper
            LookupAsynch.getDefaultCache(DClass.IN).clearCache();

            try {
                ExtendedNonblockingResolver resolver;
View Full Code Here

        } catch (UnknownHostException uhe) {
            logger.error("DNS service could not be initialized.  The DNS servers specified are not recognized hosts.", uhe);
            throw uhe;
        }

        cache = new Cache (DClass.IN);
        cache.setMaxEntries(maxCacheSize);
       
        if (setAsDNSJavaDefault) {
            Lookup.setDefaultResolver(resolver);
            Lookup.setDefaultCache(cache, DClass.IN);
View Full Code Here

        } catch (UnknownHostException uhe) {
            getLogger().fatalError("DNS service could not be initialized.  The DNS servers specified are not recognized hosts.", uhe);
            throw uhe;
        }

        cache = new Cache (DClass.IN);

        getLogger().debug("DNSServer ...init end");
    }
View Full Code Here

  int count = 0;

  @Test
  public void testCache() throws UnknownHostException {

    final Cache cache = new Cache() {
      @Override
      public SetResponse lookupRecords(Name name, int type, int minCred) {
        final SetResponse setResponse = super.lookupRecords(name, type, minCred);
        if (count++ == 0) {
          assertThat(setResponse.isUnknown(), is(true));
View Full Code Here

        ConnManagerParams.setMaxTotalConnections(params, 30);
        ConnPerRouteBean connPerRoute = new ConnPerRouteBean(6);
        ConnManagerParams.setMaxConnectionsPerRoute(params, connPerRoute);

        SchemeRegistry schemeRegistry = new SchemeRegistry();
        hostNameResolver = new BrowserMobHostNameResolver(new Cache(DClass.ANY));

        this.socketFactory = new SimulatedSocketFactory(hostNameResolver);
        schemeRegistry.register(new Scheme("http", socketFactory, 80));
        this.sslSocketFactory = new TrustingSSLSocketFactory(hostNameResolver);
        TrustingSSLSocketFactory sslSocketFactory = this.sslSocketFactory;
View Full Code Here

TOP

Related Classes of org.xbill.DNS.Cache$NegativeElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.