|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdk.netarkivet.harvester.datamodel.HarvestChannel
public class HarvestChannel
Harvest channels are used to dispatch harvest jobs to specific pools of crawlers.
Channels can accept either only snapshot jobs or only focused jobs. Snapshot crawls all
use a single hard-coded channel.
Harvest channels names must only contain alphanumeric characters, the constraint
is enforced at creation time.
HarvestDefinition
s are mapped to a HarvestChannel
,
and HarvestController
s listen to jobs sent on a specific channel.
Harvest channels are stored in the harvest database, as well as mappings to
HarvestDefinition
s and HarvestController
s through two association
tables.
There must be exactly one channel defined as default for every type of
job (snapshot and focused). This constraint will be enforced by the DAO.
Field Summary | |
---|---|
static java.lang.String |
ACCEPTABLE_NAME_PATTERN
Defines acceptable channel names: at least one word character (see Pattern ). |
Constructor Summary | |
---|---|
HarvestChannel(long id,
java.lang.String name,
boolean isSnapshot,
boolean isDefault,
java.lang.String comments)
Constructor from persistent storage |
|
HarvestChannel(java.lang.String name,
boolean isSnapshot,
boolean isDefault,
java.lang.String comments)
Constructor from name and comments |
Method Summary | |
---|---|
java.lang.String |
getComments()
|
long |
getId()
|
java.lang.String |
getName()
|
static java.lang.String |
getSnapshotDescription(javax.servlet.jsp.PageContext context)
Renders a localized description for the #SNAPSHOT singleton. |
static boolean |
isAcceptableName(java.lang.String input)
Returns true if the given input is an acceptable channel name. |
boolean |
isDefault()
|
boolean |
isSnapshot()
|
void |
setComments(java.lang.String comments)
Sets the associated comments |
void |
setDefault(boolean isDefault)
Set whether if the channel is the default one for the harvest type (snapshot or focused). |
void |
setName(java.lang.String name)
Sets the harvest channel name |
void |
setSnapshot(boolean isSnapshot)
Set the harvest type to snapshot or focused. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ACCEPTABLE_NAME_PATTERN
Pattern
).
Constructor Detail |
---|
public HarvestChannel(java.lang.String name, boolean isSnapshot, boolean isDefault, java.lang.String comments)
name
- channel nameisSnapshot
- whether this channels type is snapshot or focusedisDefault
- whether this channel is the default onecomments
- user comments
(snapshot or focused)
ArgumentNotValid
- if the name is incorrect.public HarvestChannel(long id, java.lang.String name, boolean isSnapshot, boolean isDefault, java.lang.String comments)
id
- the channel idname
- channel nameisSnapshot
- whether this channels type is snapshot or focusedisDefault
- whether this channel is the default one for the given typecomments
- user comments
ArgumentNotValid
- if the name is incorrect.Method Detail |
---|
public long getId()
public java.lang.String getName()
public void setName(java.lang.String name)
name
- the name to setpublic boolean isSnapshot()
public void setSnapshot(boolean isSnapshot)
isSnapshot
- true if snapshot, false if focusedpublic boolean isDefault()
public void setDefault(boolean isDefault)
isDefault
- true if default, false otherwisepublic java.lang.String getComments()
public void setComments(java.lang.String comments)
comments
- the comments to setpublic static java.lang.String getSnapshotDescription(javax.servlet.jsp.PageContext context)
#SNAPSHOT
singleton.
context
-
public static boolean isAcceptableName(java.lang.String input)
input
- the candidate name.
ACCEPTABLE_NAME_PATTERN
, false
otherwisepublic 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 |