@Override public final Future<Void> release(Channel channel) { return release(channel, channel.eventLoop().<Void>newPromise()); }
@Override public final Future<Void> release(Channel channel) { return release(channel, channel.eventLoop().<Void>newPromise()); }
@Override public final Future<Void> release(Channel channel) { return release(channel, channel.eventLoop().<Void>newPromise()); }
public Future<Http2StreamChannel> open() { return open(channel.eventLoop().<Http2StreamChannel>newPromise()); }
/** * Sends a DNS query with the specified question using the specified name server list. */ public Future<AddressedEnvelope<DnsResponse, InetSocketAddress>> query( InetSocketAddress nameServerAddr, DnsQuestion question) { return query0(nameServerAddr, question, EMPTY_ADDITIONALS, true, ch.newPromise(), ch.eventLoop().<AddressedEnvelope<? extends DnsResponse, InetSocketAddress>>newPromise()); }
/** * Resolves the specified name into an address. * * @param inetHost the name to resolve * @param additionals additional records ({@code OPT}) * * @return the address as the result of the resolution */ public final Future<InetAddress> resolve(String inetHost, Iterable<DnsRecord> additionals) { return resolve(inetHost, additionals, executor().<InetAddress>newPromise()); }
/** * Resolves the specified host name and port into a list of address. * * @param inetHost the name to resolve * @param additionals additional records ({@code OPT}) * * @return the list of the address as the result of the resolution */ public final Future<List<InetAddress>> resolveAll(String inetHost, Iterable<DnsRecord> additionals) { return resolveAll(inetHost, additionals, executor().<List<InetAddress>>newPromise()); }
/** * Resolves the {@link DnsRecord}s that are matched by the specified {@link DnsQuestion}. Unlike * {@link #query(DnsQuestion)}, this method handles redirection, CNAMEs and multiple name servers. * If the specified {@link DnsQuestion} is {@code A} or {@code AAAA}, this method looks up the configured * {@link HostsFileEntries} before sending a query to the name servers. If a match is found in the * {@link HostsFileEntries}, a synthetic {@code A} or {@code AAAA} record will be returned. * * @param question the question * * @return the list of the {@link DnsRecord}s as the result of the resolution */ public final Future<List<DnsRecord>> resolveAll(DnsQuestion question) { return resolveAll(question, EMPTY_ADDITIONALS, executor().<List<DnsRecord>>newPromise()); }
/** * Resolves the {@link DnsRecord}s that are matched by the specified {@link DnsQuestion}. Unlike * {@link #query(DnsQuestion)}, this method handles redirection, CNAMEs and multiple name servers. * If the specified {@link DnsQuestion} is {@code A} or {@code AAAA}, this method looks up the configured * {@link HostsFileEntries} before sending a query to the name servers. If a match is found in the * {@link HostsFileEntries}, a synthetic {@code A} or {@code AAAA} record will be returned. * * @param question the question * @param additionals additional records ({@code OPT}) * * @return the list of the {@link DnsRecord}s as the result of the resolution */ public final Future<List<DnsRecord>> resolveAll(DnsQuestion question, Iterable<DnsRecord> additionals) { return resolveAll(question, additionals, executor().<List<DnsRecord>>newPromise()); }
/** * Sends a DNS query with the specified question with additional records using the specified name server list. */ public Future<AddressedEnvelope<DnsResponse, InetSocketAddress>> query( InetSocketAddress nameServerAddr, DnsQuestion question, Iterable<DnsRecord> additionals) { return query0(nameServerAddr, question, toArray(additionals, false), true, ch.newPromise(), ch.eventLoop().<AddressedEnvelope<? extends DnsResponse, InetSocketAddress>>newPromise()); }
/** * Resolves the specified host name and port into a list of address. * * @param inetHost the name to resolve * @param additionals additional records ({@code OPT}) * * @return the list of the address as the result of the resolution */ public final Future<List<InetAddress>> resolveAll(String inetHost, Iterable<DnsRecord> additionals) { return resolveAll(inetHost, additionals, executor().<List<InetAddress>>newPromise()); }
/** * Sends a DNS query with the specified question using the specified name server list. */ public Future<AddressedEnvelope<DnsResponse, InetSocketAddress>> query( InetSocketAddress nameServerAddr, DnsQuestion question) { return query0(nameServerAddr, question, EMPTY_ADDITIONALS, ch.eventLoop().<AddressedEnvelope<? extends DnsResponse, InetSocketAddress>>newPromise()); }
/** * Resolves the specified name into an address. * * @param inetHost the name to resolve * @param additionals additional records ({@code OPT}) * * @return the address as the result of the resolution */ public final Future<InetAddress> resolve(String inetHost, Iterable<DnsRecord> additionals) { return resolve(inetHost, additionals, executor().<InetAddress>newPromise()); }
/** * Resolves the {@link DnsRecord}s that are matched by the specified {@link DnsQuestion}. Unlike * {@link #query(DnsQuestion)}, this method handles redirection, CNAMEs and multiple name servers. * If the specified {@link DnsQuestion} is {@code A} or {@code AAAA}, this method looks up the configured * {@link HostsFileEntries} before sending a query to the name servers. If a match is found in the * {@link HostsFileEntries}, a synthetic {@code A} or {@code AAAA} record will be returned. * * @param question the question * * @return the list of the {@link DnsRecord}s as the result of the resolution */ public final Future<List<DnsRecord>> resolveAll(DnsQuestion question) { return resolveAll(question, EMPTY_ADDITIONALS, executor().<List<DnsRecord>>newPromise()); }
@Override public final Future<Channel> acquire() { return acquire(bootstrap.config().group().next().<Channel>newPromise()); }
private void doResolveUncached(String hostname, DnsRecord[] additionals, final Promise<InetAddress> promise, DnsCache resolveCache) { final Promise<List<InetAddress>> allPromise = executor().newPromise(); doResolveAllUncached(hostname, additionals, allPromise, resolveCache); allPromise.addListener(new FutureListener<List<InetAddress>>() { @Override public void operationComplete(Future<List<InetAddress>> future) { if (future.isSuccess()) { trySuccess(promise, future.getNow().get(0)); } else { tryFailure(promise, future.cause()); } } }); }
/** * Sends a DNS query with the specified question with additional records using the specified name server list. */ public Future<AddressedEnvelope<DnsResponse, InetSocketAddress>> query( InetSocketAddress nameServerAddr, DnsQuestion question, Iterable<DnsRecord> additionals) { return query0(nameServerAddr, question, toArray(additionals, false), ch.eventLoop().<AddressedEnvelope<? extends DnsResponse, InetSocketAddress>>newPromise()); }
@Override public final Future<Channel> acquire() { return acquire(bootstrap.config().group().next().<Channel>newPromise()); }
@Override public final Future<Channel> acquire() { return acquire(bootstrap.config().group().next().<Channel>newPromise()); }
@Override public void operationComplete(Future<List<T>> future) { Throwable cause = future.cause(); if (cause == null) { promise.trySuccess(future.getNow()); } else { if (DnsNameResolver.isTransportOrTimeoutError(cause)) { promise.tryFailure(new SearchDomainUnknownHostException(cause, hostname)); } else if (searchDomainIdx < searchDomains.length) { Promise<List<T>> newPromise = parent.executor().newPromise(); newPromise.addListener(this); doSearchDomainQuery(hostname + '.' + searchDomains[searchDomainIdx++], newPromise); } else if (!startWithoutSearchDomain) { internalResolve(hostname, promise); } else { promise.tryFailure(new SearchDomainUnknownHostException(cause, hostname)); } } } });