org.dspace.harvest
Class HarvestedCollection

java.lang.Object
  extended by org.dspace.harvest.HarvestedCollection

public class HarvestedCollection
extends Object

Author:
Alexey Maslov

Field Summary
static int STATUS_BUSY
           
static int STATUS_OAI_ERROR
           
static int STATUS_QUEUED
           
static int STATUS_READY
           
static int STATUS_UNKNOWN_ERROR
           
static int TYPE_DMD
           
static int TYPE_DMDREF
           
static int TYPE_FULL
           
static int TYPE_NONE
           
 
Method Summary
static HarvestedCollection create(Context c, int collectionId)
          Create a new harvest instance row for a specified collection.
 void delete()
           
static void exists(Context c)
           
static HarvestedCollection find(Context c, int collectionId)
          Find the harvest settings corresponding to this collection
static List<Integer> findAll(Context c)
          Find all collections that are set up for harvesting return: list of collection id's
static List<Integer> findByStatus(Context c, int status)
          Find all collections with the specified status flag
static Integer findNewestHarvest(Context c)
          Find the collection that was harvested most recently.
static Integer findOldestHarvest(Context c)
          Find the collection that was harvested the longest time ago.
static List<Integer> findReady(Context c)
          Find all collections that are ready for harvesting return: list of collection id's
 int getCollectionId()
           
 Date getHarvestDate()
           
 String getHarvestMessage()
           
 String getHarvestMetadataConfig()
           
 Date getHarvestStartTime()
           
 int getHarvestStatus()
           
 int getHarvestType()
           
 String getOaiSetId()
           
 String getOaiSource()
           
 boolean isHarvestable()
          Returns whether this harvest instance is actually harvestable, i.e.
static boolean isHarvestable(Context c, int collectionId)
          Returns whether the specified collection is harvestable, i.e.
 boolean isReady()
           
static boolean isReady(Context c, int collectionId)
          Returns whether the specified collection is ready for immediate harvest.
 void setHarvestMessage(String message)
           
 void setHarvestMetadataConfig(String mdConfigId)
           
 void setHarvestParams(int type, String oaiSource, String oaiSetId, String mdConfigId)
          A function to set all harvesting-related parameters at once
 void setHarvestResult(Date date, String message)
           
 void setHarvestStartTime(Date date)
           
 void setHarvestStatus(int status)
          Sets the current status of the collection.
 void setHarvestType(int type)
           
 void setOaiSetId(String oaiSetId)
           
 void setOaiSource(String oaiSource)
           
 void update()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_NONE

public static final int TYPE_NONE
See Also:
Constant Field Values

TYPE_DMD

public static final int TYPE_DMD
See Also:
Constant Field Values

TYPE_DMDREF

public static final int TYPE_DMDREF
See Also:
Constant Field Values

TYPE_FULL

public static final int TYPE_FULL
See Also:
Constant Field Values

STATUS_READY

public static final int STATUS_READY
See Also:
Constant Field Values

STATUS_BUSY

public static final int STATUS_BUSY
See Also:
Constant Field Values

STATUS_QUEUED

public static final int STATUS_QUEUED
See Also:
Constant Field Values

STATUS_OAI_ERROR

public static final int STATUS_OAI_ERROR
See Also:
Constant Field Values

STATUS_UNKNOWN_ERROR

public static final int STATUS_UNKNOWN_ERROR
See Also:
Constant Field Values
Method Detail

exists

public static void exists(Context c)
                   throws SQLException
Throws:
SQLException

find

public static HarvestedCollection find(Context c,
                                       int collectionId)
                                throws SQLException
Find the harvest settings corresponding to this collection

Returns:
a HarvestInstance object corresponding to this collection's settings, null if not found.
Throws:
SQLException

create

public static HarvestedCollection create(Context c,
                                         int collectionId)
                                  throws SQLException
Create a new harvest instance row for a specified collection.

Returns:
a new HarvestInstance object
Throws:
SQLException

isHarvestable

public static boolean isHarvestable(Context c,
                                    int collectionId)
                             throws SQLException
Returns whether the specified collection is harvestable, i.e. whether its harvesting options are set up correctly. This is distinct from "ready", since this collection may be in process of being harvested.

Throws:
SQLException

isHarvestable

public boolean isHarvestable()
                      throws SQLException
Returns whether this harvest instance is actually harvestable, i.e. whether its settings options are set up correctly. This is distinct from "ready", since this collection may be in process of being harvested.

Throws:
SQLException

isReady

public static boolean isReady(Context c,
                              int collectionId)
                       throws SQLException
Returns whether the specified collection is ready for immediate harvest.

Throws:
SQLException

isReady

public boolean isReady()
                throws SQLException
Throws:
SQLException

findAll

public static List<Integer> findAll(Context c)
                             throws SQLException
Find all collections that are set up for harvesting return: list of collection id's

Throws:
SQLException

findReady

public static List<Integer> findReady(Context c)
                               throws SQLException
Find all collections that are ready for harvesting return: list of collection id's

Throws:
SQLException

findByStatus

public static List<Integer> findByStatus(Context c,
                                         int status)
                                  throws SQLException
Find all collections with the specified status flag

Parameters:
c -
status, - see HarvestInstance.STATUS_...
Returns:
Throws:
SQLException

findOldestHarvest

public static Integer findOldestHarvest(Context c)
                                 throws SQLException
Find the collection that was harvested the longest time ago.

Throws:
SQLException

findNewestHarvest

public static Integer findNewestHarvest(Context c)
                                 throws SQLException
Find the collection that was harvested most recently.

Throws:
SQLException

setHarvestParams

public void setHarvestParams(int type,
                             String oaiSource,
                             String oaiSetId,
                             String mdConfigId)
A function to set all harvesting-related parameters at once


setHarvestType

public void setHarvestType(int type)

setHarvestStatus

public void setHarvestStatus(int status)
Sets the current status of the collection.

Parameters:
status - a HarvestInstance.STATUS_... constant

setOaiSource

public void setOaiSource(String oaiSource)

setOaiSetId

public void setOaiSetId(String oaiSetId)

setHarvestMetadataConfig

public void setHarvestMetadataConfig(String mdConfigId)

setHarvestResult

public void setHarvestResult(Date date,
                             String message)

setHarvestMessage

public void setHarvestMessage(String message)

setHarvestStartTime

public void setHarvestStartTime(Date date)

getCollectionId

public int getCollectionId()

getHarvestType

public int getHarvestType()

getHarvestStatus

public int getHarvestStatus()

getOaiSource

public String getOaiSource()

getOaiSetId

public String getOaiSetId()

getHarvestMetadataConfig

public String getHarvestMetadataConfig()

getHarvestMessage

public String getHarvestMessage()

getHarvestDate

public Date getHarvestDate()

getHarvestStartTime

public Date getHarvestStartTime()

delete

public void delete()
            throws SQLException
Throws:
SQLException

update

public void update()
            throws SQLException,
                   IOException,
                   AuthorizeException
Throws:
SQLException
IOException
AuthorizeException


Copyright © 2010 DuraSpace. All Rights Reserved.