|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.harvester.datamodel.DomainDAO dk.netarkivet.harvester.datamodel.DomainDBDAO
public class DomainDBDAO
A database-based implementation of the DomainDAO. The statements to create the tables are located in:
Constructor Summary | |
---|---|
protected |
DomainDBDAO()
Creates a database-based implementation of the DomainDAO. |
Method Summary | |
---|---|
protected void |
create(java.sql.Connection connection,
Domain d)
Create a domain in persistent storage. |
boolean |
exists(java.lang.String domainName)
Check existence of a domain with the given domainName. |
java.util.List<AliasInfo> |
getAliases(java.lang.String domain)
Return a list of AliasInfo objects. |
java.util.List<AliasInfo> |
getAllAliases()
Get a list of all current alias-relations. |
java.util.Iterator<Domain> |
getAllDomains()
Gets list of all domains. |
java.util.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. |
DomainConfiguration |
getDomainConfiguration(java.lang.String domainName,
java.lang.String configName)
Get the DomainConfiguration given a specific domainName and a configurationName. |
java.util.List<DomainHarvestInfo> |
getDomainHarvestInfo(java.lang.String domainName,
boolean latestFirst)
Get a list of info about harvests performed on a given domain. |
DomainHistory |
getDomainHistory(java.lang.String domainName)
Get the domainHistory for a specific domain. |
HarvestInfo |
getDomainJobInfo(Job j,
java.lang.String domainName,
java.lang.String configName)
Get the HarvestInfo object for a certain job and DomainConfiguration defined by domainName and configName. |
java.util.List<java.lang.String> |
getDomains(java.lang.String glob)
Use a glob-like matcher to find a subset of domains. |
java.util.List<java.lang.String> |
getDomains(java.lang.String glob,
java.lang.String searchField)
Use a glob-like matcher to find a subset of domains. |
java.util.Iterator<HarvestInfo> |
getHarvestInfoBasedOnPreviousHarvestDefinition(HarvestDefinition previousHarvestDefinition)
Find all info about results of a harvest definition. |
java.util.List<TLDInfo> |
getTLDs(int level)
Return all TLDs represented by the domains in the domains table. |
boolean |
mayDelete(DomainConfiguration config)
Return whether the given configuration can be deleted. |
protected Domain |
read(java.sql.Connection c,
java.lang.String domainName)
Read a domain from the persistent storage. |
SparseDomain |
readSparse(java.lang.String domainName)
Read a Domain from Database, and return the domain information as a SparseDomain object. |
void |
update(Domain d)
Update information about existing domain information. |
Methods inherited from class dk.netarkivet.harvester.datamodel.DomainDAO |
---|
create, create, getInstance, iterator, read, resetSingleton |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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.Method Detail |
---|
protected void create(java.sql.Connection connection, Domain d)
DomainDAO
create
in class DomainDAO
connection
- a connection to the harvest definition database.d
- a given Domain
object.public void update(Domain d)
DomainDAO
update
in class DomainDAO
d
- the domain to updateprotected Domain read(java.sql.Connection c, java.lang.String domainName)
DomainDAO
read
in class DomainDAO
c
- a connection to the harvest definition database.domainName
- the name of the domain to retrieve
public boolean exists(java.lang.String domainName)
DomainDAO
exists
in class DomainDAO
domainName
- A given domain name.
public int getCountDomains()
DomainDAO
getCountDomains
in class DomainDAO
public java.util.Iterator<Domain> getAllDomains()
DomainDAO
getAllDomains
in class DomainDAO
public java.util.Iterator<Domain> getAllDomainsInSnapshotHarvestOrder()
DomainDAO
getAllDomainsInSnapshotHarvestOrder
in class DomainDAO
public java.util.List<java.lang.String> getDomains(java.lang.String glob)
DomainDAO
getDomains
in class DomainDAO
glob
- A domain name with * and ? wildcards
public boolean mayDelete(DomainConfiguration config)
DomainDAO
mayDelete
in class DomainDAO
config
- the given configuration
public SparseDomain readSparse(java.lang.String domainName)
DomainDAO
readSparse
in class DomainDAO
domainName
- a given domain
public java.util.List<AliasInfo> getAliases(java.lang.String domain)
DomainDAO
getAliases
in class DomainDAO
domain
- a given domain
public java.util.List<AliasInfo> getAllAliases()
DomainDAO
getAllAliases
in class DomainDAO
public java.util.List<TLDInfo> getTLDs(int level)
getTLDs
in class DomainDAO
level
- maximum level of TLD
DomainDAO.getTLDs(int)
public HarvestInfo getDomainJobInfo(Job j, java.lang.String domainName, java.lang.String configName)
DomainDAO
getDomainJobInfo
in class DomainDAO
j
- the jobdomainName
- the name of a given domainconfigName
- the name of a given configuration
public java.util.List<DomainHarvestInfo> getDomainHarvestInfo(java.lang.String domainName, boolean latestFirst)
DomainDAO
getDomainHarvestInfo
in class DomainDAO
domainName
- Domain to get info for.latestFirst
- true if histories are to be returned sorted with the
most recent harvests first, false if they are to be sorted with the
oldest harvests first.
public DomainConfiguration getDomainConfiguration(java.lang.String domainName, java.lang.String configName)
DomainDAO
getDomainConfiguration
in class DomainDAO
domainName
- The name of a domainconfigName
- The name of a configuration for this domain
public java.util.Iterator<HarvestInfo> getHarvestInfoBasedOnPreviousHarvestDefinition(HarvestDefinition previousHarvestDefinition)
DomainDAO
getHarvestInfoBasedOnPreviousHarvestDefinition
in class DomainDAO
previousHarvestDefinition
- A harvest definition that has already
been run.
public DomainHistory getDomainHistory(java.lang.String domainName)
DomainDAO
getDomainHistory
in class DomainDAO
domainName
- A name of a specific domain.
public java.util.List<java.lang.String> getDomains(java.lang.String glob, java.lang.String searchField)
DomainDAO
getDomains
in class DomainDAO
glob
- A domain name with * and ? wildcardssearchField
- The field in the Domain table to search
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |