Package org.jgroups.protocols.dns
Class DNS_PING
java.lang.Object
org.jgroups.stack.Protocol
org.jgroups.protocols.Discovery
org.jgroups.protocols.dns.DNS_PING
- All Implemented Interfaces:
Lifecycle
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jgroups.protocols.Discovery
Discovery.DiscoveryCacheDisseminationTask -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected DNSResolverprivate intprotected booleanprivate intFields inherited from class org.jgroups.protocols.Discovery
async_discovery, async_discovery_use_separate_thread_per_request, break_on_coord_rsp, cluster_name, current_coord, discovery_req_futures, discovery_rsp_callback, discovery_rsp_expiry_time, is_coord, is_leaving, is_server, max_members_in_discovery_request, max_rank_to_reply, num_discovery_requests, num_discovery_runs, ping_responses, return_entire_cache, send_cache_on_join, sends_can_block, stagger_timeout, timer, transport, transport_supports_multicasting, use_disk_cache, view, WHITESPACEFields inherited from class org.jgroups.stack.Protocol
after_creation_hook, down_prot, ergonomics, id, local_addr, log, policies, stack, stats, up_prot -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()This method is called on aJChannel.close().voidfindMembers(List<Address> members, boolean initial_discovery, Responses responses) Fetches information (e.g.getMembers(String dns_query, DNSResolver.DNSRecordType dns_record_type) Gets a list of IP addresses for the provided DNS query list and record type.voidinit()Called after a protocol has been created and before the protocol is started.booleanprotected voidsetDNSQuery(String query) setDNSResolver(DNSResolver resolver) protected voidMethods inherited from class org.jgroups.protocols.Discovery
addDiscoveryResponseToCaches, addResponse, addResponse, addressAsString, addToCache, breakOnCoordResponse, breakOnCoordResponse, callFindMembersInAllDiscoveryProtocols, clearRequestFutures, deserialize, discoveryRequestReceived, discoveryRspExpiryTime, disseminateDiscoveryInformation, down, dumpCache, findInitialMembersAsString, findMembers, findTopmostDiscoveryProtocol, getClusterName, getCurrentCoord, getNumberOfDiscoveryRequestsSent, getView, getViewId, handle, handleConnect, handleDisconnect, handleDiscoveryResponse, handleDiscoveryResponse, isCoord, isMergeRunning, marshal, marshal, marshal, print, providedUpServices, read, readPingData, resetStats, returnEntireCache, returnEntireCache, sendCacheInformation, sendCacheOnJoin, sendCacheOnJoin, sendDiscoveryResponse, sendDiscoveryResponse, serializeWithoutView, setClusterName, staggerTimeout, staggerTimeout, start, startCacheDissemination, stop, up, up, up, useDiskCache, useDiskCache, weedOutCompletedDiscoveryResponses, writeMethods inherited from class org.jgroups.stack.Protocol
accept, addPolicy, addr, addr, afterCreationHook, down, down, enableStats, getAddress, getComponents, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getPolicies, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, policies, providedDownServices, removePolicy, requiredDownServices, requiredUpServices, resetStatistics, setAddress, setDownProtocol, setErgonomics, setId, setLevel, setPolicies, setProtocolStack, setSocketFactory, setUpProtocol, setValue, statsEnabled, toString
-
Field Details
-
DEFAULT_DNS_FACTORY
- See Also:
-
DEFAULT_DNS_RECORD_TYPE
- See Also:
-
dns_context_factory
-
dns_address
-
dns_record_type
-
dns_query
-
probe_transport_ports
protected boolean probe_transport_ports -
dns_resolver
-
transportPort
private int transportPort -
portRange
private int portRange
-
-
Constructor Details
-
DNS_PING
public DNS_PING()
-
-
Method Details
-
init
Description copied from class:ProtocolCalled after a protocol has been created and before the protocol is started. Attributes are already set. Other protocols are not yet connected and events cannot yet be sent. -
setDNSResolver
-
setDNSQuery
-
getDNSContextFactory
-
getDNSAddress
-
validateProperties
protected void validateProperties() -
destroy
public void destroy()Description copied from class:ProtocolThis method is called on aJChannel.close(). Does some cleanup; after the call, the VM will terminate -
isDynamic
public boolean isDynamic() -
getMembers
Gets a list of IP addresses for the provided DNS query list and record type.- Parameters:
dns_query- A comma-separated list of DNS queries. Must not benull.dns_record_type- The DNS record type.- Returns:
- A list of IP addresses corresponding to the provided DNS query list and record type. An empty list is returned if the provided DNS query does not resolve to any IP addresses.
- Throws:
NullPointerException- if dns_query isnull.
-
fetchFromDns
-
findMembers
Description copied from class:DiscoveryFetches information (e.g. physical address, logical name) for the given member addresses. Needs to add responses to theResponsesobject. IfDiscovery.async_discoveryis true, this method will be called in a separate thread, otherwise the caller's thread will be used.- Specified by:
findMembersin classDiscovery- Parameters:
members- A list of logical addresses (typicallyUUIDs). If null, then information for all members is fetchedinitial_discovery- Set to true if this is for the initial membership discovery. Some protocols (e.g. file based ones) may return only the information for the coordinator(s).responses- The list to which responses should be added
-
sendDiscoveryRequest
-