|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.harvester.datamodel.DomainConfiguration
public class DomainConfiguration
This class describes a configuration for harvesting a domain. It combines a number of seedlists, a number of passwords, an order template, and some specialised settings to define the way to harvest a domain.
Constructor Summary | |
---|---|
DomainConfiguration(java.lang.String theConfigName,
Domain domain,
java.util.List<SeedList> seedlists,
java.util.List<Password> passwords)
Create a new configuration for a domain. |
Method Summary | |
---|---|
void |
addHarvestInfo(HarvestInfo hi)
Adds harvest information to the configurations history. |
void |
addPassword(Password password)
Add password. |
void |
addSeedList(SeedList seedlist)
Add a new seedlist to the configuration. |
java.lang.String |
getComments()
Returns comments. |
Domain |
getDomain()
Returns the domain aggregating this configuration. |
long |
getExpectedNumberOfObjects(long objectLimit,
long byteLimit)
Gets the best expectation for how many objects a harvest using this configuration will retrieve, given a job with a maximum limit pr. |
(package private) long |
getID()
Get the ID of this configuration. |
long |
getMaxBytes()
Returns the maximum number of bytes to download during a single harvest of a domain. |
long |
getMaxObjects()
Returns the maximum number of objects to harvest from the domain. |
int |
getMaxRequestRate()
Returns the maximum request rate to use when harvesting the domain. |
java.lang.String |
getName()
Get the configuration name. |
java.lang.String |
getOrderXmlName()
Returns the name of the order xml file used by the domain. |
java.util.Iterator<Password> |
getPasswords()
Get an iterator of passwords used in this configuration. |
java.util.Iterator<SeedList> |
getSeedLists()
Get an iterator of seedlists used in this configuration. |
(package private) boolean |
hasID()
Check if this configuration has an ID set yet (doesn't happen until the DBDAO persists it). |
long |
minObjectsBytesLimit(long objectLimit,
long byteLimit,
long expectedObjectSize)
Return the lowest limit for the two values, or MAX_DOMAIN_SIZE if both are infinite, which is the max size we harvest from this domain. |
void |
removePassword(java.lang.String passwordName)
Remove a password from the list of passwords used in this domain. |
void |
setComments(java.lang.String comments)
Set the comments field. |
(package private) void |
setID(long id)
Set the ID of this configuration. |
void |
setMaxBytes(long maxBytes)
Specify the maximum number of bytes to download from a domain in a single harvest. |
void |
setMaxObjects(long max)
Specify the maximum number of objects to retrieve from the domain. |
void |
setMaxRequestRate(int maxrate)
Specify the maximum request rate to use when harvesting data. |
void |
setOrderXmlName(java.lang.String ordername)
Specify the name of the order.xml template to use. |
void |
setPasswords(java.util.List<Password> passwords)
Sets the used passwords to the given list. |
void |
setSeedLists(java.util.List<SeedList> seedlists)
Sets the used seedlists to the given list. |
java.lang.String |
toString()
ToString of DomainConfiguration class. |
boolean |
usesPassword(java.lang.String passwordName)
Check whether this domain uses a given password. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DomainConfiguration(java.lang.String theConfigName, Domain domain, java.util.List<SeedList> seedlists, java.util.List<Password> passwords)
theConfigName
- The name of this configurationdomain
- The domain thet this configuration is forseedlists
- Seedlists to use in this configuration.passwords
- Passwords to use in this configuration.Method Detail |
---|
public void setOrderXmlName(java.lang.String ordername)
ordername
- order.xml template name
ArgumentNotValid
- if filename null or emptypublic void setMaxObjects(long max)
max
- maximum number of objects to retrieve
ArgumentNotValid
- if max<-1public void setMaxRequestRate(int maxrate)
maxrate
- the maximum request rate
ArgumentNotValid
- if maxrate<0public void setMaxBytes(long maxBytes)
maxBytes
- Maximum number of bytes to download, or -1 for no limit.
ArgumentNotValid
- if maxBytes < -1public java.lang.String getName()
getName
in interface Named
public java.lang.String getComments()
getComments
in interface Named
public java.lang.String getOrderXmlName()
public long getMaxObjects()
public int getMaxRequestRate()
public long getMaxBytes()
public Domain getDomain()
public void addHarvestInfo(HarvestInfo hi)
hi
- HarvestInfo to add to Domain.public java.util.Iterator<SeedList> getSeedLists()
public void addSeedList(SeedList seedlist)
seedlist
- the seedlist to add
ArgumentNotValid
- if the seedlist is null
UnknownID
- if the seedlist is not defined on the domain
PermissionDenied
- if the seedlist is different from the one
on the domain.public java.util.Iterator<Password> getPasswords()
public void addPassword(Password password)
password
- to addpublic long getExpectedNumberOfObjects(long objectLimit, long byteLimit)
objectLimit
- The maximum limit, or
Constants.HERITRIX_MAXOBJECTS_INFINITY for no limit. This limit overrides
the limit set on the configuration, unless override is in effect.byteLimit
- The maximum number of bytes that will be used as
limit in the harvest. This limit overrides the limit set on the
configuration, unless override is in effect.
public long minObjectsBytesLimit(long objectLimit, long byteLimit, long expectedObjectSize)
objectLimit
- A long value defining an object limit, or 0 for
infinitebyteLimit
- A long value defining a byte limit, or
HarvesterSettings.MAX_DOMAIN_SIZE for infinite.expectedObjectSize
- The expected number of bytes per object
public void setComments(java.lang.String comments)
comments
- User-entered free-form comments.public void removePassword(java.lang.String passwordName)
passwordName
- Password to Remove.public boolean usesPassword(java.lang.String passwordName)
passwordName
- The given password
public void setSeedLists(java.util.List<SeedList> seedlists)
seedlists
- The seedlists to use.
ArgumentNotValid
- if the seedslists are nullpublic void setPasswords(java.util.List<Password> passwords)
passwords
- The passwords to use.
ArgumentNotValid
- if the passwords are nulllong getID()
void setID(long id)
id
- use this id for this configurationboolean hasID()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |