org.nhindirect.dns
Class ConfigServiceDNSStore

java.lang.Object
  extended by org.nhindirect.dns.ConfigServiceDNSStore
All Implemented Interfaces:
DNSStore

public class ConfigServiceDNSStore
extends Object
implements DNSStore

Implementation of the the DNStore interface that uses the Direct Project configuration web service to store DNS records.

Since:
1.0
Author:
Greg Meyer

Constructor Summary
ConfigServiceDNSStore(URL serviceURL)
          Creates a store using the provided URL to lookup DNS records in the configuration service.
 
Method Summary
 org.xbill.DNS.Message get(org.xbill.DNS.Message request)
          Processes a lookup request for DNS records.
static String getJCEProviderName()
          Gets the configured JCE crypto provider string for crypto operations.
static void setJCEProviderName(String name)
          Overrides the configured JCE crypto provider string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigServiceDNSStore

@Inject
public ConfigServiceDNSStore(URL serviceURL)
Creates a store using the provided URL to lookup DNS records in the configuration service.

Parameters:
serviceURL - The URL of the configuration service.
Method Detail

getJCEProviderName

public static String getJCEProviderName()
Gets the configured JCE crypto provider string for crypto operations. This is configured using the -Dorg.nhindirect.dns.JCEProviderName JVM parameters. If the parameter is not set or is empty, then the default string "BC" (BouncyCastle provider) is returned. By default the agent installs the BouncyCastle provider.

Returns:
The name of the JCE provider string.

setJCEProviderName

public static void setJCEProviderName(String name)
Overrides the configured JCE crypto provider string. If the name is empty or null, the default string "BC" (BouncyCastle provider) is used.

Parameters:
name - The name of the JCE provider.

get

public org.xbill.DNS.Message get(org.xbill.DNS.Message request)
                          throws DNSException
Processes a lookup request for DNS records.

Specified by:
get in interface DNSStore
Parameters:
request - The DSN request message.
Returns:
The DNS response message. Returns null for lookup requests if a matching record cannot be found.
Throws:
DNSException - Thrown is the request fails due to sever failure such as illegal request parameters or a failure accessing the physical record medium.


Copyright © 2010-2015 The Direct Project. All Rights Reserved.