Package org.xbill.DNS.lookup
Class LookupSession.LookupSessionBuilder
java.lang.Object
org.xbill.DNS.lookup.LookupSession.LookupSessionBuilder
- Enclosing class:
LookupSession
A builder for
LookupSession instances. An instance of this class is obtained by calling
LookupSession.builder() and configured using the methods with names corresponding to
the different properties. Once fully configured, a LookupSession instance is obtained
by calling build() on the builder instance.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Create an instance ofLookupSessionconfigured by this builder.Deprecated.Enable caching using the supplied cache.caches(@NonNull Collection<Cache> caches) Enable caching using the supplied caches.Deprecated.Disables using a cache for lookups.Removes all search paths.cycleResults(boolean cycleResults) If set totrue, cached results with multiple records will be returned with the starting point shifted one step per request.Enable querying the local hosts database using the system defaults.The executor to use when running lookups.hostsFileParser(HostsFileParser hostsFileParser) Configures the local hosts database file parser to use within this session.maxRedirects(int maxRedirects) The maximum number of CNAME or DNAME redirects allowed before lookups will fail withRedirectOverflowException.ndots(int ndots) The threshold for the number of dots which must appear in a name before it is considered absolute.TheResolverto use to look up records.searchPath(Collection<? extends Name> searchPath) Configures the search path used to look up relative names with less than ndots dots.searchPath(Name searchPath) Configures the search path used to look up relative names with less than ndots dots.toString()
-
Method Details
-
resolver
TheResolverto use to look up records.- Returns:
this.
-
maxRedirects
The maximum number of CNAME or DNAME redirects allowed before lookups will fail withRedirectOverflowException. Defaults to 16.- Returns:
this.
-
ndots
The threshold for the number of dots which must appear in a name before it is considered absolute. The default is 1, meaning that if there are any dots in a name, the name will be tried first as an absolute name.- Returns:
this.
-
searchPath
Configures the search path used to look up relative names with less than ndots dots.- Returns:
this.
-
searchPath
Configures the search path used to look up relative names with less than ndots dots.- Returns:
this.
-
clearSearchPath
Removes all search paths.- Returns:
this.
-
cycleResults
If set totrue, cached results with multiple records will be returned with the starting point shifted one step per request.- Returns:
this.
-
hostsFileParser
Configures the local hosts database file parser to use within this session.- Returns:
this.
-
executor
The executor to use when running lookups.- Returns:
this.
-
defaultHostsFileParser
Enable querying the local hosts database using the system defaults.- Returns:
this.- See Also:
-
cache
Enable caching using the supplied cache. An existingCachefor the same class will be replaced.- Returns:
this.- See Also:
-
caches
Enable caching using the supplied caches. ExistingCaches for the same class will be replaced.- Returns:
this.- See Also:
-
clearCaches
Disables using a cache for lookups.- Returns:
this.
-
cache
@Deprecated public LookupSession.LookupSessionBuilder cache(@NonNull @NonNull Integer dclass, @NonNull @NonNull Cache cache) Deprecated.usecache(Cache), theCachealready provides the class.Enable caching using the supplied cache for the given class.- Parameters:
dclass- unused- Returns:
this.- See Also:
-
caches
@Deprecated public LookupSession.LookupSessionBuilder caches(@NonNull @NonNull Map<Integer, Cache> caches) Deprecated.Enable caching using the supplied caches.- Parameters:
caches- unused- Returns:
this.- See Also:
-
build
Create an instance ofLookupSessionconfigured by this builder. -
toString
-
cache(Cache), theCachealready provides the class.