org.nhindirect.config.store.dao.impl
Class DNSDaoImpl

java.lang.Object
  extended by org.nhindirect.config.store.dao.impl.DNSDaoImpl
All Implemented Interfaces:
DNSDao

@Repository
public class DNSDaoImpl
extends Object
implements DNSDao

JPA implementation of the DNSDao interface.

Since:
1.1
Author:
Greg Meyer

Constructor Summary
DNSDaoImpl()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DNSDaoImpl

public DNSDaoImpl()
Method Detail

add

@Transactional(readOnly=false)
public void add(Collection<DNSRecord> records)
Adds multiple new DNS records to the store. The type cannot be ANY.}

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

count

@Transactional(readOnly=true)
public int count()
Gets the number of records in the DNS store.}

Specified by:
count in interface DNSDao
Returns:
The number of records in the DNS store.

get

@Transactional(readOnly=true)
public Collection<DNSRecord> get(int type)
Gets all DNS records or a given type. Using type ANY will return all records in the store.}

Specified by:
get in interface DNSDao
Parameters:
type - The record type to search for.
Returns:
A collection of records matching the record type.

get

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

Specified by:
get in interface DNSDao
Parameters:
recordId - The internal record id to search for.
Returns:
A DNS record matching the record id.

get

@Transactional(readOnly=true)
public Collection<DNSRecord> get(long[] recordIds)
Gets DNS records by the internal record ids.}

Specified by:
get in interface DNSDao
Parameters:
recordIds - Array of record ids to search for.
Returns:
A collection of records matching the record ids.

get

@Transactional(readOnly=true)
public Collection<DNSRecord> get(String name,
                                               int type)
Gets DNS records by record name and a specific record type.}

Specified by:
get in interface DNSDao
Parameters:
name - The record name.
type - The record type to search for.
Returns:
A collection of records matching the name and record type.

get

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

Specified by:
get in interface DNSDao
Parameters:
name - The record name.
Returns:
A collection of records matching the name and of any type.

remove

@Transactional(readOnly=false)
public void remove(Collection<DNSRecord> records)
Removes DNS records matching the DNS records' name and type.}

Specified by:
remove in interface DNSDao
Parameters:
records - Records to delete. Matching is done by name and type.

remove

@Transactional(readOnly=false)
public void remove(long recordId)
Removes a single DNS record by an existing internal record id.}

Specified by:
remove in interface DNSDao
Parameters:
recordId - The internal record id to delete.

remove

@Transactional(readOnly=false)
public void remove(long[] recordIds)
Removes DNS records by existing internal record ids.}

Specified by:
remove in interface DNSDao
Parameters:
recordIds - The internal record ids to delete.

update

@Transactional(readOnly=false)
public 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.}

Specified by:
update in interface DNSDao
Parameters:
id - The internal record id to update.
record - Data to update the record with.


Copyright © 2011. All Rights Reserved.