dk.netarkivet.harvester.datamodel
Class GlobalCrawlerTrapListDBDAO

java.lang.Object
  extended by dk.netarkivet.harvester.datamodel.GlobalCrawlerTrapListDAO
      extended by dk.netarkivet.harvester.datamodel.GlobalCrawlerTrapListDBDAO

public class GlobalCrawlerTrapListDBDAO
extends GlobalCrawlerTrapListDAO

A singleton giving access to global crawler traps.


Constructor Summary
protected GlobalCrawlerTrapListDBDAO()
          protected constructor of this class.
 
Method Summary
 int create(GlobalCrawlerTrapList trapList)
          This method creates the object in the database and has the side effect of setting the trapLists id field to the auto-generated id in the database.
 void delete(int id)
          Deletes a crawler trap list from the database.
 boolean exists(java.lang.String name)
          Does crawlertrap with this name already exist.
 java.util.List<GlobalCrawlerTrapList> getAllActive()
          Get all active crawler traps.
 java.util.List<java.lang.String> getAllActiveTrapExpressions()
          Get a merged list (without duplicates) of all currently-active crawler trap expressions.
 java.util.List<GlobalCrawlerTrapList> getAllInActive()
          Get all inactive crawler traps.
 GlobalCrawlerTrapList read(int id)
          Get a traplist from the database.
 void update(GlobalCrawlerTrapList trapList)
          Update a trap list.
 
Methods inherited from class dk.netarkivet.harvester.datamodel.GlobalCrawlerTrapListDAO
getInstance, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlobalCrawlerTrapListDBDAO

protected GlobalCrawlerTrapListDBDAO()
protected constructor of this class. Checks if any migration are needed before operation starts.

Method Detail

getAllActive

public java.util.List<GlobalCrawlerTrapList> getAllActive()
Description copied from class: GlobalCrawlerTrapListDAO
Get all active crawler traps.

Specified by:
getAllActive in class GlobalCrawlerTrapListDAO
Returns:
a list of all active crawler traps.

getAllInActive

public java.util.List<GlobalCrawlerTrapList> getAllInActive()
Description copied from class: GlobalCrawlerTrapListDAO
Get all inactive crawler traps.

Specified by:
getAllInActive in class GlobalCrawlerTrapListDAO
Returns:
a list of all inactive crawler traps.

getAllActiveTrapExpressions

public java.util.List<java.lang.String> getAllActiveTrapExpressions()
Description copied from class: GlobalCrawlerTrapListDAO
Get a merged list (without duplicates) of all currently-active crawler trap expressions.

Specified by:
getAllActiveTrapExpressions in class GlobalCrawlerTrapListDAO
Returns:
a list os all active crawler trap expressions.

create

public int create(GlobalCrawlerTrapList trapList)
Description copied from class: GlobalCrawlerTrapListDAO
This method creates the object in the database and has the side effect of setting the trapLists id field to the auto-generated id in the database.

Specified by:
create in class GlobalCrawlerTrapListDAO
Parameters:
trapList - The list to persist
Returns:
the id of the created list

delete

public void delete(int id)
Description copied from class: GlobalCrawlerTrapListDAO
Deletes a crawler trap list from the database.

Specified by:
delete in class GlobalCrawlerTrapListDAO
Parameters:
id - the id of the list to be deleted

update

public void update(GlobalCrawlerTrapList trapList)
Update a trap list. In order to update the trap expressions for this list, we first delete all the existing trap expressions for the list then add all those in the updated version.

Specified by:
update in class GlobalCrawlerTrapListDAO
Parameters:
trapList - the trap list to update

read

public GlobalCrawlerTrapList read(int id)
Description copied from class: GlobalCrawlerTrapListDAO
Get a traplist from the database.

Specified by:
read in class GlobalCrawlerTrapListDAO
Parameters:
id - the id of the traplist to be read.
Returns:
the trap list.

exists

public boolean exists(java.lang.String name)
Does crawlertrap with this name already exist.

Specified by:
exists in class GlobalCrawlerTrapListDAO
Parameters:
name - The name for a crawlertrap
Returns:
true, if a crawlertrap with the given name already exists in the database; otherwise false