public class HarvestStatusQuery extends Object
The semantics of the date filters is as follows:
The class enforces that end date is set at a date posterior to start date.
Additionally a sort order (applied to job IDs) can be set (ascending or descending), and the query can be limited to a certain row number and a start index.
Modifier and Type | Class and Description |
---|---|
static class |
HarvestStatusQuery.SORT_ORDER
Enum class defining the different sort-orders.
|
static class |
HarvestStatusQuery.UI_FIELD
Defines the UI fields and their default values.
|
Modifier and Type | Field and Description |
---|---|
static String |
CALENDAR_UI_DATE_FORMAT
The date format used by the calendar widget.
|
static long |
DATE_NONE
Value used to define date undefined.
|
static String |
HARVEST_NAME_ALL
The String code to select all harvests.
|
static String |
HARVEST_NAME_WILDCARD
String to check, if there is a wildcard in the harvestname.
|
static String |
JOBSTATUS_ALL
The String code to select all states.
|
static long |
PAGE_SIZE_NONE
Value used to define page size undefined.
|
Constructor and Description |
---|
HarvestStatusQuery()
Builds a default query that will select all jobs.
|
HarvestStatusQuery(long harvestId,
long harvestRunNumber)
Builds a default query that will find jobs for a given run of a harvest.
|
HarvestStatusQuery(javax.servlet.ServletRequest req)
Builds a query from a servlet request.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getCaseSensitiveHarvestName() |
long |
getEndDate() |
String |
getEndDateAsString() |
Long |
getHarvestId() |
String |
getHarvestName() |
Long |
getHarvestRunNumber() |
String |
getJobIdRange() |
long |
getPageSize() |
List<String> |
getPartialJobIdRangeAsList(boolean isRange)
return only the ids or only the range
if isRange is true : 2,3,5-9,14-18 -> 5-9,14-18
if isRange is false : 2,3,5-9,14-18 -> 2,3
|
JobStatus[] |
getSelectedJobStatuses() |
Set<JobStatus> |
getSelectedJobStatusesAsSet() |
long |
getStartDate() |
String |
getStartDateAsString() |
long |
getStartPageIndex() |
boolean |
isSortAscending() |
void |
setCaseSensitiveHarvestName(boolean isHarvestNameCaseSensitive)
Define whether or not the harvest name is case sensitive.
|
void |
setHarvestName(String harvestName)
Set the harvest name.
|
void |
setJobStatus(Set<JobStatus> chosenStates)
Set the selected states in the query.
|
void |
setPageSize(long pageSize)
Sets the page size.
|
public static final String JOBSTATUS_ALL
public static final String HARVEST_NAME_ALL
public static final String HARVEST_NAME_WILDCARD
public static final long PAGE_SIZE_NONE
public static final long DATE_NONE
public static final String CALENDAR_UI_DATE_FORMAT
public HarvestStatusQuery()
public HarvestStatusQuery(long harvestId, long harvestRunNumber)
harvestId
- A given harvestIdharvestRunNumber
- a given harvestRunNumberpublic HarvestStatusQuery(javax.servlet.ServletRequest req)
req
- a servlet requestpublic JobStatus[] getSelectedJobStatuses()
public Set<JobStatus> getSelectedJobStatusesAsSet()
public String getHarvestName()
public void setHarvestName(String harvestName)
harvestName
- The harvest namepublic Long getHarvestId()
public Long getHarvestRunNumber()
public long getStartDate()
DATE_NONE
if start date is
undefinedpublic long getEndDate()
DATE_NONE
if end date is
undefinedpublic String getJobIdRange()
public List<String> getPartialJobIdRangeAsList(boolean isRange)
public String getStartDateAsString()
public String getEndDateAsString()
public boolean isSortAscending()
public long getPageSize()
public void setPageSize(long pageSize)
pageSize
- a number > 0.public long getStartPageIndex()
public void setCaseSensitiveHarvestName(boolean isHarvestNameCaseSensitive)
isHarvestNameCaseSensitive
- If true, harvestname is case sensitive, otherwise not.public boolean getCaseSensitiveHarvestName()
public void setJobStatus(Set<JobStatus> chosenStates)
chosenStates
- the set of selected states.Copyright © 2005–2016 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.