|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.harvester.datamodel.DomainDAO
public abstract class DomainDAO
Persistent storage for Domain objects. Configuration information and seeds are stored as well.
Constructor Summary | |
---|---|
protected |
DomainDAO()
protected constructor for singleton class. |
Method Summary | |
---|---|
protected abstract void |
create(java.sql.Connection connection,
Domain domain)
Create a domain in persistent storage. |
void |
create(Domain domain)
Create a domain in persistent storage. |
void |
create(java.util.List<Domain> domains)
Create a list of domains in persistent storage. |
abstract boolean |
exists(java.lang.String domainName)
Check existence of a domain with the given domainName. |
abstract java.util.List<AliasInfo> |
getAliases(java.lang.String domain)
Return a list of AliasInfo objects. |
abstract java.util.List<AliasInfo> |
getAllAliases()
Get a list of all current alias-relations. |
abstract java.util.Iterator<Domain> |
getAllDomains()
Gets list of all domains. |
abstract 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. |
abstract int |
getCountDomains()
Get the total number of domains available. |
abstract java.util.List<DomainHarvestInfo> |
getDomainHarvestInfo(java.lang.String domainName,
boolean latestFirst)
Get a list of info about harvests performed on a given domain. |
abstract HarvestInfo |
getDomainJobInfo(Job job,
java.lang.String domainName,
java.lang.String configName)
Get the HarvestInfo object for a certain job and DomainConfiguration defined by domainName and configName. |
abstract java.util.List<java.lang.String> |
getDomains(java.lang.String glob)
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. |
static DomainDAO |
getInstance()
Get the singleton DomainDAO instance. |
abstract java.util.List<TLDInfo> |
getTLDs(int level)
Get a list of all TLDs present in the domains table. |
java.util.Iterator<Domain> |
iterator()
Gets an iterator of all domains. |
abstract boolean |
mayDelete(DomainConfiguration config)
Return whether the given configuration can be deleted. |
protected abstract Domain |
read(java.sql.Connection connection,
java.lang.String domainName)
Read a domain from the persistent storage. |
Domain |
read(java.lang.String domainName)
Read a domain from the persistent storage. |
abstract SparseDomain |
readSparse(java.lang.String domainName)
Read a Domain from Database, and return the domain information as a SparseDomain object. |
(package private) static void |
resetSingleton()
Reset the singleton. |
abstract void |
update(Domain domain)
Update information about existing domain information. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected DomainDAO()
Method Detail |
---|
public static DomainDAO getInstance()
public void create(Domain domain)
domain
- a given Domain
object.public void create(java.util.List<Domain> domains)
domains
- a list of Domain
objects.protected abstract void create(java.sql.Connection connection, Domain domain)
connection
- a connection to the harvest definition database.domain
- a given Domain
object.public Domain read(java.lang.String domainName)
domainName
- the name of the domain to retrieve
protected abstract Domain read(java.sql.Connection connection, java.lang.String domainName)
connection
- a connection to the harvest definition database.domainName
- the name of the domain to retrieve
public abstract boolean exists(java.lang.String domainName)
domainName
- A given domain name.
ArgumentNotValid
- if domainName is null or empty.public abstract void update(Domain domain)
domain
- the domain to update
ArgumentNotValid
- if domain is null
UnknownID
- if the Domain domain has not been added previously to persistent storage.public abstract int getCountDomains()
public abstract java.util.Iterator<Domain> getAllDomains()
public java.util.Iterator<Domain> iterator()
iterator
in interface java.lang.Iterable<Domain>
public abstract java.util.Iterator<Domain> getAllDomainsInSnapshotHarvestOrder()
static void resetSingleton()
public java.util.Iterator<HarvestInfo> getHarvestInfoBasedOnPreviousHarvestDefinition(HarvestDefinition previousHarvestDefinition)
previousHarvestDefinition
- A harvest definition that has already
been run.
public abstract java.util.List<java.lang.String> getDomains(java.lang.String glob)
glob
- A domain name with * and ? wildcards
public abstract boolean mayDelete(DomainConfiguration config)
config
- the given configuration
public abstract SparseDomain readSparse(java.lang.String domainName)
domainName
- a given domain
ArgumentNotValid
- if domainName is null or empty.
UnknownID
- if domain does not existpublic abstract java.util.List<AliasInfo> getAliases(java.lang.String domain)
domain
- a given domain
UnknownID
- If the given domain does not exist. (!DomainDAO.exists(domain))
ArgumentNotValid
- if domainName is nullpublic abstract java.util.List<AliasInfo> getAllAliases()
public abstract java.util.List<TLDInfo> getTLDs(int level)
level
- maximum level of TLD
public abstract HarvestInfo getDomainJobInfo(Job job, java.lang.String domainName, java.lang.String configName)
domainName
- the name of a given domainconfigName
- the name of a given configurationjob
- the job
public abstract java.util.List<DomainHarvestInfo> getDomainHarvestInfo(java.lang.String domainName, boolean latestFirst)
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |