The lookup keys are:
"name|93.184.216.34" ->
"example.com"."name|93.184.216.34" ->
"example.com"."address|example.com" ->
"93.184.216.34".address|hostname.
Using a StringLookup from the StringLookupFactory:
StringLookupFactory.INSTANCE.dnsStringLookup().lookup("address|apache.org");
Using a StringSubstitutor:
StringSubstitutor.createInterpolator().replace("... ${dns:address|apache.org} ..."));
The above examples convert "address|apache.org" to "95.216.24.32 (or "40.79.78.1").
Public access is through StringLookupFactory.
StringLookupFactory
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final DnsStringLookup | INSTANCE
Defines the singleton for this class. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: The DNS value.the key to be looked up, may be null key)Implements org. Looks up the DNS value of the key. |
| INSTANCE | back to summary |
|---|---|
| pack-priv static final DnsStringLookup INSTANCE Defines the singleton for this class. | |
| DnsStringLookup | back to summary |
|---|---|
| private DnsStringLookup() No need to build instances for now. | |
| lookup | back to summary |
|---|---|
| public String lookup(final String key) Implements org. Looks up the DNS value of the key. | |