org.nhindirect.config.service.impl
Class DNSServiceImpl

java.lang.Object
  extended by org.nhindirect.config.service.impl.DNSServiceImpl
All Implemented Interfaces:
DNSService

public class DNSServiceImpl
extends Object
implements DNSService

Web service implementation of the DNSService.

Since:
1.1
Author:
Greg Meyer

Constructor Summary
DNSServiceImpl()
           
 
Method Summary
 void addDNS(Collection<org.nhindirect.config.store.DNSRecord> records)
          Adds multiple new DNS records to the store.
 org.nhindirect.config.store.dao.DNSDao getDao()
          Return the value of the DNSDao object.
 Collection<org.nhindirect.config.store.DNSRecord> getDNSByName(String name)
          Gets DNS records by record name.
 Collection<org.nhindirect.config.store.DNSRecord> getDNSByNameAndType(String name, int type)
          Gets DNS records by record name and a specific record type.
 org.nhindirect.config.store.DNSRecord getDNSByRecordId(long recordId)
          Gets a single DNS record for an internal record id.
 Collection<org.nhindirect.config.store.DNSRecord> getDNSByRecordIds(long[] recordIds)
          Gets DNS records by the internal record ids.
 Collection<org.nhindirect.config.store.DNSRecord> getDNSByType(int type)
          Gets all DNS records or a given type.
 int getDNSCount()
          Gets the number of records in the DNS store.
 void init()
          Initialization method.
 void removeDNS(Collection<org.nhindirect.config.store.DNSRecord> records)
          Removes DNS records matching the DNS records' name and type.
 void removeDNSByRecordId(long recordId)
          Removes a single DNS record by an existing internal record id.
 void removeDNSByRecordIds(long[] recordIds)
          Removes DNS records by existing internal record ids.
 void setDao(org.nhindirect.config.store.dao.DNSDao dao)
          Set the value of the DNSDao object.
 void updateDNS(long recordId, org.nhindirect.config.store.DNSRecord record)
          Update a DNS record for a specific internal id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DNSServiceImpl

public DNSServiceImpl()
Method Detail

init

public void init()
Initialization method.


addDNS

public void addDNS(Collection<org.nhindirect.config.store.DNSRecord> records)
            throws ConfigurationServiceException
Adds multiple new DNS records to the store. The type cannot be ANY.

Specified by:
addDNS in interface DNSService
Parameters:
records - The records to add the store. If a record already exists, then an exception is thrown.
Throws:
ConfigurationServiceException

getDNSByName

public Collection<org.nhindirect.config.store.DNSRecord> getDNSByName(String name)
                                                               throws ConfigurationServiceException
Gets DNS records by record name.

Specified by:
getDNSByName in interface DNSService
Parameters:
name - The record name.
Returns:
A collection of records matching the name and of any type.
Throws:
ConfigurationServiceException

getDNSByNameAndType

public Collection<org.nhindirect.config.store.DNSRecord> getDNSByNameAndType(String name,
                                                                             int type)
                                                                      throws ConfigurationServiceException
Gets DNS records by record name and a specific record type.

Specified by:
getDNSByNameAndType in interface DNSService
Parameters:
name - The record name.
type - The record type to search for.
Returns:
A collection of records matching the name and record type.
Throws:
ConfigurationServiceException

getDNSByRecordId

public org.nhindirect.config.store.DNSRecord getDNSByRecordId(long recordId)
                                                       throws ConfigurationServiceException
Gets a single DNS record for an internal record id.

Specified by:
getDNSByRecordId in interface DNSService
Parameters:
recordId - The internal record id to search for.
Returns:
A DNS record matching the record id.
Throws:
ConfigurationServiceException

getDNSByRecordIds

public Collection<org.nhindirect.config.store.DNSRecord> getDNSByRecordIds(long[] recordIds)
                                                                    throws ConfigurationServiceException
Gets DNS records by the internal record ids.

Specified by:
getDNSByRecordIds in interface DNSService
Parameters:
recordIds - Array of record ids to search for.
Returns:
A collection of records matching the record ids.
Throws:
ConfigurationServiceException

getDNSByType

public Collection<org.nhindirect.config.store.DNSRecord> getDNSByType(int type)
                                                               throws ConfigurationServiceException
Gets all DNS records or a given type. Using type ANY will return all records in the store.

Specified by:
getDNSByType in interface DNSService
Parameters:
type - The record type to search for.
Returns:
A collection of records matching the record type.
Throws:
ConfigurationServiceException

getDNSCount

public int getDNSCount()
                throws ConfigurationServiceException
Gets the number of records in the DNS store.

Specified by:
getDNSCount in interface DNSService
Returns:
The number of records in the DNS store.
Throws:
ConfigurationServiceException

removeDNS

public void removeDNS(Collection<org.nhindirect.config.store.DNSRecord> records)
               throws ConfigurationServiceException
Removes DNS records matching the DNS records' name and type.

Specified by:
removeDNS in interface DNSService
Parameters:
records - Records to delete. Matching is done by name and type.
Throws:
ConfigurationServiceException

removeDNSByRecordId

public void removeDNSByRecordId(long recordId)
                         throws ConfigurationServiceException
Removes a single DNS record by an existing internal record id.

Specified by:
removeDNSByRecordId in interface DNSService
Parameters:
recordId - The internal record id to delete.
Throws:
ConfigurationServiceException

removeDNSByRecordIds

public void removeDNSByRecordIds(long[] recordIds)
                          throws ConfigurationServiceException
Removes DNS records by existing internal record ids.

Specified by:
removeDNSByRecordIds in interface DNSService
Parameters:
recordIds - The internal record ids to delete.
Throws:
ConfigurationServiceException

updateDNS

public void updateDNS(long recordId,
                      org.nhindirect.config.store.DNSRecord record)
               throws ConfigurationServiceException
Update a DNS record for a specific internal id. If a record does not exist, then an exception is thrown. The type cannot be ANY.

Specified by:
updateDNS in interface DNSService
Parameters:
recordId - The internal record id to update.
record - Data to update the record with.
Throws:
ConfigurationServiceException

setDao

public void setDao(org.nhindirect.config.store.dao.DNSDao dao)
Set the value of the DNSDao object.

Parameters:
dao - the value of the DNSDao object.

getDao

public org.nhindirect.config.store.dao.DNSDao getDao()
Return the value of the DNSDao object.

Returns:
the value of the DNSDao object.


Copyright © 2013. All Rights Reserved.