Modifier | Constructor and Description |
---|---|
protected |
DomainDAO()
protected constructor for singleton class.
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
create(Connection connection,
Domain domain)
Create a domain in persistent storage.
|
void |
create(Domain domain)
Create a domain in persistent storage.
|
void |
create(List<Domain> domains)
Create a list of domains in persistent storage.
|
abstract boolean |
exists(String domainName)
Check existence of a domain with the given domainName.
|
abstract List<Long> |
findUsedConfigurations(Long domainID)
Read the used configurations name + seedslists for the domain.
|
abstract List<AliasInfo> |
getAliases(String domain)
Return a list of AliasInfo objects.
|
abstract List<AliasInfo> |
getAllAliases()
Get a list of all current alias-relations.
|
abstract Iterator<Domain> |
getAllDomains()
Gets list of all domains.
|
abstract Iterator<Domain> |
getAllDomainsInSnapshotHarvestOrder()
Gets list of all domains in the order expected by snapshot harvest job generation, that is order by template
name, then byte limit (descending), then domain name.
|
abstract int |
getCountDomains()
Get the total number of domains available.
|
abstract DomainConfiguration |
getDomainConfiguration(String domainName,
String configName)
Get the DomainConfiguration given a specific domainName and a configurationName.
|
abstract DomainHistory |
getDomainHistory(String domainName)
Get the domainHistory for a specific domain.
|
abstract HarvestInfo |
getDomainJobInfo(Job job,
String domainName,
String configName)
Get the HarvestInfo object for a certain job and DomainConfiguration defined by domainName and configName.
|
abstract List<String> |
getDomains(String glob)
Use a glob-like matcher to find a subset of domains.
|
abstract List<String> |
getDomains(String glob,
String searchField)
Use a glob-like matcher to find a subset of domains.
|
abstract Iterator<HarvestInfo> |
getHarvestInfoBasedOnPreviousHarvestDefinition(HarvestDefinition previousHarvestDefinition)
Find all info about results of a harvest definition.
|
static DomainDAO |
getInstance()
Get the singleton DomainDAO instance.
|
abstract List<TLDInfo> |
getTLDs(int level)
Get a list of all TLDs present in the domains table.
|
Iterator<Domain> |
iterator()
Gets an iterator of all domains.
|
abstract List<DomainHarvestInfo> |
listDomainHarvestInfo(String domainName,
String orderBy,
boolean asc)
Get a list of info about harvests performed on a given domain.
|
abstract boolean |
mayDelete(DomainConfiguration config)
Return whether the given configuration can be deleted.
|
protected abstract Domain |
read(Connection connection,
String domainName)
Read a domain from the persistent storage.
|
Domain |
read(String domainName)
Read a domain from the persistent storage.
|
protected abstract Domain |
readKnown(Connection connection,
String domainName)
Read a domain from the persistent storage known to exist.
|
Domain |
readKnown(String domainName)
Read a domain from the persistent storage known to exist.
|
abstract SparseDomain |
readSparse(String domainName)
Read a Domain from Database, and return the domain information as a SparseDomain object.
|
abstract void |
update(Domain domain)
Update information about existing domain information.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
protected DomainDAO()
public static DomainDAO getInstance()
public void create(Domain domain)
domain
- a given Domain
object.public void create(List<Domain> domains)
domains
- a list of Domain
objects.protected abstract void create(Connection connection, Domain domain)
connection
- a connection to the harvest definition database.domain
- a given Domain
object.public Domain read(String domainName)
domainName
- the name of the domain to retrievepublic Domain readKnown(String domainName)
domainName
- the name of the domain to retrieveprotected abstract Domain read(Connection connection, String domainName)
connection
- a connection to the harvest definition database.domainName
- the name of the domain to retrieveprotected abstract Domain readKnown(Connection connection, String domainName)
connection
- a connection to the harvest definition database.domainName
- the name of the domain to retrievepublic abstract boolean exists(String domainName)
domainName
- A given domain name.ArgumentNotValid
- if domainName is null or empty.public abstract void update(Domain domain)
domain
- the domain to updateArgumentNotValid
- if domain is nullUnknownID
- if the Domain domain has not been added previously to persistent storage.public abstract int getCountDomains()
public abstract Iterator<Domain> getAllDomains()
public Iterator<Domain> iterator()
public abstract Iterator<Domain> getAllDomainsInSnapshotHarvestOrder()
public abstract Iterator<HarvestInfo> getHarvestInfoBasedOnPreviousHarvestDefinition(HarvestDefinition previousHarvestDefinition)
previousHarvestDefinition
- A harvest definition that has already been run.public abstract List<String> getDomains(String glob)
In this simple matcher, * stands for any number of arbitrary characters, and ? stands for one arbitrary character. Including these, the given string must match the entire domain name.
glob
- A domain name with * and ? wildcardspublic abstract boolean mayDelete(DomainConfiguration config)
config
- the given configurationpublic abstract SparseDomain readSparse(String domainName)
domainName
- a given domainArgumentNotValid
- if domainName is null or empty.UnknownID
- if domain does not existpublic abstract List<AliasInfo> getAliases(String domain)
domain
- a given domainUnknownID
- If the given domain does not exist. (!DomainDAO.exists(domain))ArgumentNotValid
- if domainName is nullpublic abstract List<AliasInfo> getAllAliases()
public abstract List<TLDInfo> getTLDs(int level)
level
- maximum level of TLDpublic abstract HarvestInfo getDomainJobInfo(Job job, String domainName, String configName)
domainName
- the name of a given domainconfigName
- the name of a given configurationjob
- the jobpublic abstract List<DomainHarvestInfo> listDomainHarvestInfo(String domainName, String orderBy, boolean asc)
Note that harvest info from before the DB DAOs are unreliable, as harvests cannot be told apart and no dates are available.
domainName
- Domain to get info for.orderBy
- The column attribute to order by.asc
- true if the results should be ordered according to the natural order, false if they are to be sorted
in reverse.public abstract DomainConfiguration getDomainConfiguration(String domainName, String configName)
domainName
- The name of a domainconfigName
- The name of a configuration for this domainpublic abstract DomainHistory getDomainHistory(String domainName)
domainName
- A name of a specific domain.public abstract List<String> getDomains(String glob, String searchField)
In this simple matcher, * stands for any number of arbitrary characters, and ? stands for one arbitrary character. Including these, the given string must match the entire domain name.
glob
- A domain name with * and ? wildcardssearchField
- The field in the Domain table to searchpublic abstract List<Long> findUsedConfigurations(Long domainID)
DomainConfiguration
object are returned, only the name + seeds lists are set.
A used configuration is the default configuration + configurations used in a active harvest definition.
domainID
- The domain to find the configurations for.Copyright © 2005–2015 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.