public class OccurrenceJobUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
COMPLETED |
static String |
FAILED |
protected static org.apache.log4j.Logger |
logger |
static String |
PENDING |
static String |
RUNNING |
| Constructor and Description |
|---|
OccurrenceJobUtil() |
| Modifier and Type | Method and Description |
|---|---|
static int |
changeStatusOccurrenceJobById(String jobIdentifier,
DownloadState state,
OccurrenceJobPersistence occurrencesJobDao)
Change status occurrence job by id.
|
static SaveFileFormat |
converFileFormat(String fileFormat)
Conver file format.
|
static OccurrencesSaveEnum |
convertCsvType(String csvType)
Convert csv type.
|
static JobOccurrencesModel |
convertJob(OccurrencesJob job,
org.gcube.data.spd.model.service.types.CompleteJobStatus statusResponse,
OccurrenceJobPersistence occurrencesJobDao)
Convert job.
|
static String |
convertListKeyIntoStoreXMLString(List<String> keys)
Convert list key into store xml string.
|
static JobOccurrencesModel |
createOccurrenceJobOnServiceByKeys(JobOccurrencesModel jobModel,
SpeciesService taxonomyService,
OccurrenceJobPersistence occurrencesJobDao,
List<String> keys,
List<DataSource> dataSources,
SaveFileFormat saveFileFormat,
OccurrencesSaveEnum csvType,
int expectedOccurrence)
Creates the occurrence job on service by keys.
|
static int |
deleteOccurrenceJobById(String jobIdentifier,
OccurrenceJobPersistence occurrencesJobDao)
Delete occurrence job by id.
|
static DownloadState |
getDownloadState(org.gcube.data.spd.model.service.types.JobStatus status)
Gets the download state.
|
static List<String> |
getListOfSelectedKey(FetchingSession<ResultRow> searchSession)
Gets the list of selected key.
|
static OccurrenceKeys |
getListOfSelectedKeyByDataSource(String dataSource,
org.gcube.application.framework.core.session.ASLSession session)
Gets the list of selected key by data source.
|
static List<String> |
revertListKeyFromStoredXMLString(String storedKeysAsXml)
Revert list key from stored xml string.
|
public static final String COMPLETED
public static final String FAILED
public static final String RUNNING
public static final String PENDING
protected static org.apache.log4j.Logger logger
public static JobOccurrencesModel convertJob(OccurrencesJob job, org.gcube.data.spd.model.service.types.CompleteJobStatus statusResponse, OccurrenceJobPersistence occurrencesJobDao)
job - the jobstatusResponse - the status responseoccurrencesJobDao - the occurrences job daopublic static DownloadState getDownloadState(org.gcube.data.spd.model.service.types.JobStatus status)
status - the statuspublic static OccurrencesSaveEnum convertCsvType(String csvType)
csvType - the csv typepublic static SaveFileFormat converFileFormat(String fileFormat)
fileFormat - the file formatpublic static int deleteOccurrenceJobById(String jobIdentifier, OccurrenceJobPersistence occurrencesJobDao)
jobIdentifier - the job identifieroccurrencesJobDao - the occurrences job daopublic static int changeStatusOccurrenceJobById(String jobIdentifier, DownloadState state, OccurrenceJobPersistence occurrencesJobDao)
jobIdentifier - the job identifierstate - the stateoccurrencesJobDao - the occurrences job daopublic static List<String> getListOfSelectedKey(FetchingSession<ResultRow> searchSession) throws Exception
searchSession - the search sessionException - the exceptionpublic static OccurrenceKeys getListOfSelectedKeyByDataSource(String dataSource, org.gcube.application.framework.core.session.ASLSession session)
dataSource - the data sourcesession - the sessionpublic static JobOccurrencesModel createOccurrenceJobOnServiceByKeys(JobOccurrencesModel jobModel, SpeciesService taxonomyService, OccurrenceJobPersistence occurrencesJobDao, List<String> keys, List<DataSource> dataSources, SaveFileFormat saveFileFormat, OccurrencesSaveEnum csvType, int expectedOccurrence)
jobModel - the job modeltaxonomyService - the taxonomy serviceoccurrencesJobDao - the occurrences job daokeys - the keysdataSources - the data sourcessaveFileFormat - the save file formatcsvType - the csv typeexpectedOccurrence - the expected occurrencepublic static String convertListKeyIntoStoreXMLString(List<String> keys)
keys - the keysCopyright © 2021. All Rights Reserved.