public class DomainDBDAO extends DomainDAO
The statements to create the tables are located in:
Modifier | Constructor and Description |
---|---|
protected |
DomainDBDAO()
Creates a database-based implementation of the DomainDAO.
|
Modifier and Type | Method and Description |
---|---|
protected void |
create(Connection connection,
Domain d)
Create a domain in persistent storage.
|
boolean |
exists(String domainName)
Check existence of a domain with the given domainName.
|
List<Long> |
findUsedConfigurations(Long domainID)
Read the used configurations name + seedslists for the domain.
|
List<AliasInfo> |
getAliases(String domain)
Return a list of AliasInfo objects.
|
List<AliasInfo> |
getAllAliases()
Get a list of all current alias-relations.
|
List<String> |
getAllDomainNames() |
Iterator<Domain> |
getAllDomains()
Gets list of all domains.
|
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.
|
int |
getCountDomains()
Get the total number of domains available.
|
String |
getDefaultDomainConfigurationName(String domainName)
Get the name of the default configuration for the given domain.
|
DomainConfiguration |
getDomainConfiguration(String domainName,
String configName)
Get the DomainConfiguration given a specific domainName and a configurationName.
|
DomainHistory |
getDomainHistory(String domainName)
Get the domainHistory for a specific domain.
|
HarvestInfo |
getDomainJobInfo(Job j,
String domainName,
String configName)
Get the HarvestInfo object for a certain job and DomainConfiguration defined by domainName and configName.
|
List<String> |
getDomains(String glob)
Use a glob-like matcher to find a subset of domains.
|
List<String> |
getDomains(String glob,
String searchField)
Use a glob-like matcher to find a subset of domains.
|
Iterator<HarvestInfo> |
getHarvestInfoBasedOnPreviousHarvestDefinition(HarvestDefinition previousHarvestDefinition)
Find all info about results of a harvest definition.
|
List<TLDInfo> |
getTLDs(int level)
Return all TLDs represented by the domains in the domains table.
|
List<DomainHarvestInfo> |
listDomainHarvestInfo(String domainName,
String orderBy,
boolean asc)
Get a list of info about harvests performed on a given domain.
|
boolean |
mayDelete(DomainConfiguration config)
Return whether the given configuration can be deleted.
|
protected Domain |
read(Connection c,
String domainName)
Read a domain from the persistent storage.
|
protected Domain |
readKnown(Connection c,
String domainName)
Read a domain from the persistent storage known to exist.
|
SparseDomain |
readSparse(String domainName)
Read a Domain from Database, and return the domain information as a SparseDomain object.
|
void |
renameAndUpdateConfig(Domain domain,
DomainConfiguration domainConf,
String configOldName)
Rename and update a DomainConfiguration for a specific domain.
|
void |
update(Domain d)
Update information about existing domain information.
|
create, create, getInstance, iterator, read, readKnown
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
protected DomainDBDAO()
IOFailure
- on trouble updating tables to new versions, or on tables with wrong versions that we don't know
how to change to expected version.protected void create(Connection connection, Domain d)
DomainDAO
public void update(Domain d)
DomainDAO
protected Domain read(Connection c, String domainName)
DomainDAO
protected Domain readKnown(Connection c, String domainName)
DomainDAO
public List<Long> findUsedConfigurations(Long domainID)
DomainDAO
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.
findUsedConfigurations
in class DomainDAO
domainID
- The domain to find the configurations for.public boolean exists(String domainName)
DomainDAO
public int getCountDomains()
DomainDAO
getCountDomains
in class DomainDAO
public Iterator<Domain> getAllDomains()
DomainDAO
getAllDomains
in class DomainDAO
public Iterator<Domain> getAllDomainsInSnapshotHarvestOrder()
DomainDAO
getAllDomainsInSnapshotHarvestOrder
in class DomainDAO
public List<String> getDomains(String glob)
DomainDAO
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.
getDomains
in class DomainDAO
glob
- A domain name with * and ? wildcardspublic boolean mayDelete(DomainConfiguration config)
DomainDAO
public String getDefaultDomainConfigurationName(String domainName)
DomainDAO
getDefaultDomainConfigurationName
in class DomainDAO
domainName
- a name of a domainpublic SparseDomain readSparse(String domainName)
DomainDAO
readSparse
in class DomainDAO
domainName
- a given domainpublic List<AliasInfo> getAliases(String domain)
DomainDAO
getAliases
in class DomainDAO
domain
- a given domainpublic List<AliasInfo> getAllAliases()
DomainDAO
getAllAliases
in class DomainDAO
public List<TLDInfo> getTLDs(int level)
getTLDs
in class DomainDAO
level
- maximum level of TLDDomainDAO.getTLDs(int)
public HarvestInfo getDomainJobInfo(Job j, String domainName, String configName)
DomainDAO
getDomainJobInfo
in class DomainDAO
j
- the jobdomainName
- the name of a given domainconfigName
- the name of a given configurationpublic List<DomainHarvestInfo> listDomainHarvestInfo(String domainName, String orderBy, boolean asc)
DomainDAO
Note that harvest info from before the DB DAOs are unreliable, as harvests cannot be told apart and no dates are available.
listDomainHarvestInfo
in class DomainDAO
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 DomainConfiguration getDomainConfiguration(String domainName, String configName)
DomainDAO
getDomainConfiguration
in class DomainDAO
domainName
- The name of a domainconfigName
- The name of a configuration for this domainpublic Iterator<HarvestInfo> getHarvestInfoBasedOnPreviousHarvestDefinition(HarvestDefinition previousHarvestDefinition)
DomainDAO
getHarvestInfoBasedOnPreviousHarvestDefinition
in class DomainDAO
previousHarvestDefinition
- A harvest definition that has already been run.public DomainHistory getDomainHistory(String domainName)
DomainDAO
getDomainHistory
in class DomainDAO
domainName
- A name of a specific domain.public List<String> getDomains(String glob, String searchField)
DomainDAO
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.
getDomains
in class DomainDAO
glob
- A domain name with * and ? wildcardssearchField
- The field in the Domain table to searchpublic void renameAndUpdateConfig(Domain domain, DomainConfiguration domainConf, String configOldName)
DomainDAO
renameAndUpdateConfig
in class DomainDAO
domain
- The given domaindomainConf
- The given domainConfigconfigOldName
- The old name of the domainConfigpublic List<String> getAllDomainNames()
getAllDomainNames
in class DomainDAO
Copyright © 2005–2016 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.