public class HarvestChannel extends Object implements Serializable
Harvest channels names must only contain alphanumeric characters, the constraint is enforced at creation time.
HarvestDefinition
s are mapped to a HarvestChannel
, and HarvestControllers listen to jobs sent
on a specific channel.
Harvest channels are stored in the harvest database, as well as mappings to HarvestDefinition
s and
HarvestControllers 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.
Modifier and Type | Field and Description |
---|---|
static String |
ACCEPTABLE_NAME_PATTERN
Defines acceptable channel names: at least one word character.
|
Constructor and Description |
---|
HarvestChannel(long id,
String name,
boolean isSnapshot,
boolean isDefault,
String comments)
Constructor from persistent storage.
|
HarvestChannel(String name,
boolean isSnapshot,
boolean isDefault,
String comments)
Constructor from name and comments.
|
Modifier and Type | Method and Description |
---|---|
String |
getComments() |
long |
getId() |
String |
getName() |
static String |
getSnapshotDescription(javax.servlet.jsp.PageContext context)
Renders a localized description for the singleton.
|
static boolean |
isAcceptableName(String input)
Returns true if the given input is an acceptable channel name.
|
boolean |
isDefault() |
boolean |
isSnapshot() |
void |
setComments(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(String name)
Sets the harvest channel name
|
void |
setSnapshot(boolean isSnapshot)
Set the harvest type to snapshot or focused.
|
String |
toString() |
public static final String ACCEPTABLE_NAME_PATTERN
public HarvestChannel(String name, boolean isSnapshot, boolean isDefault, 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, String name, boolean isSnapshot, boolean isDefault, 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 commentsArgumentNotValid
- if the name is incorrect.public long getId()
public void setName(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 String getComments()
public void setComments(String comments)
comments
- the comments to setpublic static String getSnapshotDescription(javax.servlet.jsp.PageContext context)
context
- public static boolean isAcceptableName(String input)
input
- the candidate name.ACCEPTABLE_NAME_PATTERN
, false otherwiseCopyright © 2005–2018 The Royal Danish Library, the National Library of France and the Austrian National Library.. All rights reserved.