org.nhindirect.config.store.dao
Interface DNSDao

All Known Implementing Classes:
DNSDaoImpl

public interface DNSDao

DAO interface for DNS records

Since:
1.1
Author:
Greg Meyer

Method Summary
 void add(Collection<DNSRecord> records)
          Adds multiple new DNS records to the store.
 int count()
          Gets the number of records in the DNS store.
 Collection<DNSRecord> get(int type)
          Gets all DNS records or a given type.
 DNSRecord get(long recordId)
          Gets a single DNS record for an internal record id.
 Collection<DNSRecord> get(long[] recordIds)
          Gets DNS records by the internal record ids.
 Collection<DNSRecord> get(String name)
          Gets DNS records by record name.
 Collection<DNSRecord> get(String name, int type)
          Gets DNS records by record name and a specific record type.
 void remove(Collection<DNSRecord> records)
          Removes DNS records matching the DNS records' name and type.
 void remove(long recordId)
          Removes a single DNS record by an existing internal record id.
 void remove(long[] recordIds)
          Removes DNS records by existing internal record ids.
 void update(long id, DNSRecord record)
          Update a DNS record for a specific internal id.
 

Method Detail

count

int count()
Gets the number of records in the DNS store.

Returns:
The number of records in the DNS store.

get

Collection<DNSRecord> get(String name)
Gets DNS records by record name.

Parameters:
name - The record name.
Returns:
A collection of records matching the name and of any type.

get

Collection<DNSRecord> get(String name,
                          int type)
Gets DNS records by record name and a specific record type.

Parameters:
name - The record name.
type - The record type to search for.
Returns:
A collection of records matching the name and record type.

get

Collection<DNSRecord> get(int type)
Gets all DNS records or a given type. Using type ANY will return all records in the store.

Parameters:
type - The record type to search for.
Returns:
A collection of records matching the record type.

get

Collection<DNSRecord> get(long[] recordIds)
Gets DNS records by the internal record ids.

Parameters:
recordIds - Array of record ids to search for.
Returns:
A collection of records matching the record ids.

get

DNSRecord get(long recordId)
Gets a single DNS record for an internal record id.

Parameters:
recordId - The internal record id to search for.
Returns:
A DNS record matching the record id.

add

void add(Collection<DNSRecord> records)
Adds multiple new DNS records to the store. The type cannot be ANY.

Parameters:
records - The records to add the store. If a record already exists, then an exception is thrown.

remove

void remove(long recordId)
Removes a single DNS record by an existing internal record id.

Parameters:
recordId - The internal record id to delete.

remove

void remove(long[] recordIds)
Removes DNS records by existing internal record ids.

Parameters:
recordIds - The internal record ids to delete.

remove

void remove(Collection<DNSRecord> records)
Removes DNS records matching the DNS records' name and type.

Parameters:
records - Records to delete. Matching is done by name and type.

update

void update(long id,
            DNSRecord record)
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.

Parameters:
id - The internal record id to update.
record - Data to update the record with.


Copyright © 2011. All Rights Reserved.