public static class LookupSession.LookupSessionBuilder extends Object
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.Modifier and Type | Method and Description |
---|---|
LookupSession |
build()
Create an instance of
LookupSession configured by this builder. |
LookupSession.LookupSessionBuilder |
cache(@NonNull Cache cache)
Enable caching using the supplied cache.
|
LookupSession.LookupSessionBuilder |
cache(@NonNull Integer dclass,
@NonNull Cache cache)
Deprecated.
use
cache(Cache) , the Cache already provides the class. |
LookupSession.LookupSessionBuilder |
caches(@NonNull Collection<Cache> caches)
Enable caching using the supplied caches.
|
LookupSession.LookupSessionBuilder |
caches(@NonNull Map<Integer,Cache> caches)
Deprecated.
use
cache(Cache) or caches(Collection) , the Cache
already provides the class. |
LookupSession.LookupSessionBuilder |
clearCaches()
Disables using a cache for lookups.
|
LookupSession.LookupSessionBuilder |
clearSearchPath()
Removes all search paths.
|
LookupSession.LookupSessionBuilder |
cycleResults(boolean cycleResults)
If set to
true , cached results with multiple records will be returned with the
starting point shifted one step per request. |
LookupSession.LookupSessionBuilder |
defaultHostsFileParser()
Enable querying the local hosts database using the system defaults.
|
LookupSession.LookupSessionBuilder |
executor(Executor executor)
The executor to use when running lookups.
|
LookupSession.LookupSessionBuilder |
hostsFileParser(HostsFileParser hostsFileParser)
Configures the local hosts database file parser to use within this session.
|
LookupSession.LookupSessionBuilder |
maxRedirects(int maxRedirects)
The maximum number of CNAME or DNAME redirects allowed before lookups will fail with
RedirectOverflowException . |
LookupSession.LookupSessionBuilder |
ndots(int ndots)
The threshold for the number of dots which must appear in a name before it is considered
absolute.
|
LookupSession.LookupSessionBuilder |
resolver(@NonNull Resolver resolver)
The
Resolver to use to look up records. |
LookupSession.LookupSessionBuilder |
searchPath(Collection<? extends Name> searchPath)
Configures the search path used to look up relative names with less than ndots dots.
|
LookupSession.LookupSessionBuilder |
searchPath(Name searchPath)
Configures the search path used to look up relative names with less than ndots dots.
|
public LookupSession.LookupSessionBuilder resolver(@NonNull @NonNull Resolver resolver)
Resolver
to use to look up records.this
.public LookupSession.LookupSessionBuilder maxRedirects(int maxRedirects)
RedirectOverflowException
. Defaults to 16.this
.public LookupSession.LookupSessionBuilder ndots(int ndots)
this
.public LookupSession.LookupSessionBuilder searchPath(Name searchPath)
this
.public LookupSession.LookupSessionBuilder searchPath(Collection<? extends Name> searchPath)
this
.public LookupSession.LookupSessionBuilder clearSearchPath()
this
.public LookupSession.LookupSessionBuilder cycleResults(boolean cycleResults)
true
, cached results with multiple records will be returned with the
starting point shifted one step per request.this
.public LookupSession.LookupSessionBuilder hostsFileParser(HostsFileParser hostsFileParser)
this
.public LookupSession.LookupSessionBuilder executor(Executor executor)
this
.public LookupSession.LookupSessionBuilder defaultHostsFileParser()
this
.HostsFileParser
public LookupSession.LookupSessionBuilder cache(@NonNull @NonNull Cache cache)
Cache
for the same class will be
replaced.this
.Cache
public LookupSession.LookupSessionBuilder caches(@NonNull @NonNull Collection<Cache> caches)
Cache
s for the same class will be
replaced.this
.Cache
public LookupSession.LookupSessionBuilder clearCaches()
this
.@Deprecated public LookupSession.LookupSessionBuilder cache(@NonNull @NonNull Integer dclass, @NonNull @NonNull Cache cache)
cache(Cache)
, the Cache
already provides the class.dclass
- unusedthis
.Cache
@Deprecated public LookupSession.LookupSessionBuilder caches(@NonNull @NonNull Map<Integer,Cache> caches)
cache(Cache)
or caches(Collection)
, the Cache
already provides the class.caches
- unusedthis
.Cache
public LookupSession build()
LookupSession
configured by this builder.Copyright © 2022 dnsjava.org. All rights reserved.