|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdk.netarkivet.harvester.datamodel.HarvestChannelDAO
dk.netarkivet.harvester.datamodel.HarvestChannelDBDAO
public class HarvestChannelDBDAO
Implementation class for the DAO handling the persistence of HarvestChannel
instances.
Constructor Summary | |
---|---|
protected |
HarvestChannelDBDAO()
Create a new HarvestChannelDAO implemented using database. |
Method Summary | |
---|---|
void |
create(HarvestChannel harvestChan)
Creates a HarvestChannel object in the storage backend. |
boolean |
defaultFocusedChannelExists()
Returns true if a default channel exists for focused jobs. |
java.util.Iterator<HarvestChannel> |
getAll(boolean includeSnapshot)
Returns harvest channels by type, sorted first by type (focused first, then broad) and then by name. |
HarvestChannel |
getById(long id)
Retrieves a HarvestChannel by its UID. |
HarvestChannel |
getByName(java.lang.String name)
Retrieves a HarvestChannel by its unique name. |
HarvestChannel |
getChannelForHarvestDefinition(long harvestDefinitionId)
Returns the HarvestChannel mapped to the given HarvestDefinition id. |
HarvestChannel |
getDefaultChannel(boolean isSnapshot)
Returns the default HarvestChannel for the given type of harvest. |
java.util.Iterator<HarvestChannel> |
iterator()
|
void |
update(HarvestChannel harvestChan)
Updates a HarvestChannel object in the storage backend. |
Methods inherited from class dk.netarkivet.harvester.datamodel.HarvestChannelDAO |
---|
getInstance |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected HarvestChannelDBDAO()
IllegalState
exception, if default channels are missing in the DB.
Method Detail |
---|
public HarvestChannel getById(long id) throws ArgumentNotValid, UnknownID
HarvestChannelDAO
HarvestChannel
by its UID.
getById
in class HarvestChannelDAO
id
- the UID to look for
ArgumentNotValid
- if not ID is supplied
UnknownID
- if the ID is not present in the persistent storage.public HarvestChannel getByName(java.lang.String name) throws ArgumentNotValid, UnknownID
HarvestChannelDAO
HarvestChannel
by its unique name.
getByName
in class HarvestChannelDAO
name
- the name to look for
ArgumentNotValid
- if not name is supplied
UnknownID
- if the name is not present in the persistent storage.public void create(HarvestChannel harvestChan)
HarvestChannelDAO
HarvestChannel
object in the storage backend.
create
in class HarvestChannelDAO
harvestChan
- the HarvestChannel
objectpublic void update(HarvestChannel harvestChan)
HarvestChannelDAO
HarvestChannel
object in the storage backend.
update
in class HarvestChannelDAO
harvestChan
- the HarvestChannel
objectpublic java.util.Iterator<HarvestChannel> iterator()
iterator
in interface java.lang.Iterable<HarvestChannel>
iterator
in class HarvestChannelDAO
public java.util.Iterator<HarvestChannel> getAll(boolean includeSnapshot)
HarvestChannelDAO
getAll
in class HarvestChannelDAO
includeSnapshot
- if true, returns the single snapshot channel in the iterator.
HarvestChannel
.public boolean defaultFocusedChannelExists()
HarvestChannelDAO
defaultFocusedChannelExists
in class HarvestChannelDAO
public HarvestChannel getDefaultChannel(boolean isSnapshot)
HarvestChannelDAO
HarvestChannel
for the given type of harvest.
getDefaultChannel
in class HarvestChannelDAO
isSnapshot
- snapshot or partial harvest
HarvestChannel
public HarvestChannel getChannelForHarvestDefinition(long harvestDefinitionId)
HarvestChannelDAO
HarvestChannel
mapped to the given HarvestDefinition
id.
If no mapping was explicitly defined, returns null.
getChannelForHarvestDefinition
in class HarvestChannelDAO
harvestDefinitionId
- the HarvestDefinition
id to look for
HarvestChannel
id or null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |