Package com.avoka.fc.core.dao
Class JobDao
java.lang.Object
com.avoka.core.dao.BaseDao
com.avoka.fc.core.dao.AbstractDao
com.avoka.fc.core.dao.JobDao
Provides a DAO for the Collaboration Job entity.
- Since:
- 4.0.0
- See Also:
-
Field Summary
Fields inherited from class com.avoka.core.dao.BaseDao
FETCH_LIMIT, STATEMENT_MAX_NO_PARAMETERS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Return the number of finished collaboration jobsgetJobForKey
(String jobKey) Return the Job object for the given job key or null if not found.getJobForPK
(Object id) Return the Job object for the given primary key or null if not found.getJobForReferenceNumber
(String referenceNumber) Return the first Job object for the given reference number or null if not found.getJobList
(String clientId, String searchString, String status, String serviceId, Date startDate, Date endDate) Return the list of jobs matching the specified search criteria.getJobList
(String keyword, String jobStatus, Date fromDate, Portal portal) Deprecated.Deprecated.getJobListForKeywordOrProperty
(String clientId, String jobKeyword, String jobStatus, Date startDate, Date endDate, String propertyName, String propertyValue) Return the list of jobs which match the specified search criteria.org.apache.cayenne.ResultIterator
<Job> Return up to 100,000 collaboration jobs that have not yet been published for licensingReturn the list of jobs ready to process.int
getNumberOfJobsCreated
(Date startDate, Date endDate, Client client) Return the number of jobs created within a certain date range and optionally matching a specific client.getPurgeJobDataJobList
(int fetchLimit, Date cutoffDate) Return the list of Job of which job data can be purgedgetPurgeJobIdList
(int fetchLimit) Return the list of Job ID to purge.void
recalcJobAbandonTime
(Long clientId, int maxAgeInDays, boolean calcOnTimeCreated) Recalculate job abandon times if the global Abandon policy has changed.void
recalcJobDataPurgeTime
(Long clientId, int maxAgeInDays) Recalc job data purge timevoid
recalcJobPurgeTime
(int maxAgeInDays) Recalculate job purge times if the global purge policy has changed.void
updateJobAbandonTime
(Job job) Updates the job Abandon time based on the job status and deployment setting (i.e.void
Set the job data purge time based on the job status.void
updateJobPurgeTime
(Job job) Updates the job purge time based on the job status.Methods inherited from class com.avoka.fc.core.dao.AbstractDao
andFilterClientExcludeNull, andFilterClientIncludeNull, andFilterClientOnly, isClientAccessAllowed, performQueryConfigCached
Methods inherited from class com.avoka.core.dao.BaseDao
addOrdering, addOrderingCaseInsensitive, addOrderingCaseSensitive, andQueryBetween, andQueryInExp, andQueryInExp, andQueryLikeIgnoreCaseExp, andQueryMatchDbExp, andQueryMatchExp, andQueryMatchIsNotNull, andQueryMatchIsNull, andQueryNoMatchExp, andQueryNotTrue, deleteObject, deleteObjects, findObject, getDataContext, getFetchLimit, getLogger, getObjectForPK, newObject, orQueryLikeIgnoreCaseExp, orQueryMatchExp, performNamedQuery, performNamedQuery, performNamedQuery, performNamedQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performQuery, performQuery, performQuery, registerNewObject, setCacheStrategy, setFetchLimit, setLocalCacheStrategy, setLocalCacheStrategy, setSharedCacheStrategy, toMap, toMap
-
Constructor Details
-
JobDao
public JobDao()
-
-
Method Details
-
getJobForPK
Return the Job object for the given primary key or null if not found.- Parameters:
id
- the Job ID- Returns:
- the Job object for the given primary key or null if not found
-
getJobForKey
Return the Job object for the given job key or null if not found.- Parameters:
jobKey
- the Job Key- Returns:
- the Job object for the given job key or null if not found
-
getJobForReferenceNumber
Return the first Job object for the given reference number or null if not found.- Parameters:
referenceNumber
- the Job Key- Returns:
- the first Job object for the given reference number or null if not found
- Since:
- 4.2.1
-
getJobsReadyToProcess
Return the list of jobs ready to process. To ensure the job processing is fairly balanced across all jobs needing processing this method will return a result list ordered by unprocessed job, then jobs last processed time.- Returns:
- the list of jobs ready to process
-
getJobList
public List<Job> getJobList(String clientId, String searchString, String status, String serviceId, Date startDate, Date endDate) Return the list of jobs matching the specified search criteria. The list of results will be sorted by creation time in descending order.- Parameters:
clientId
- the client ID to filter on (optional; if not set, user-specific client filtering will be applied)searchString
- the search string entered by the user (optional)status
- the status (optional)serviceId
- the controller Service Definition IDstartDate
- the lower bound on the creation timeendDate
- the upper bound on the creation time- Returns:
- the list of matching jobs
-
getJobListForKeywordOrProperty
public List<Job> getJobListForKeywordOrProperty(String clientId, String jobKeyword, String jobStatus, Date startDate, Date endDate, String propertyName, String propertyValue) Return the list of jobs which match the specified search criteria. If the jobKeyword is specified this will be used to search for the job name using a like match expression, or the job reference number using an exact match expression, or the job key if the keyword is a 32 character alphanumeric expression. If the propertyName and propertyValue criteria is specified then the search will filter on job with job properties which have the specified property name (exact match) and job property value (like match).- Parameters:
clientId
- the client ID (optional)jobKeyword
- the job keyword (optional)jobStatus
- the job status (optional)startDate
- the job creation start date (optional)endDate
- the job creation end date (optional)propertyName
- the job property name (optional)propertyValue
- the job property value (optional)- Returns:
- the list of jobs which match the specified search criteria
- Since:
- 4.3.4
-
getJobList
Deprecated.Return the list of Jobs for the given search criteria.- Parameters:
keyword
- the search keywordjobStatus
- the job statusfromDate
- the start dateportal
- the portals client associations- Returns:
- the list Jobs for the given search criteria.
-
getJobList
public List<Job> getJobList(String keyword, String jobStatus, Date fromDate, Portal portal, String loginName) Deprecated.Return the list of Jobs for the given search criteria.- Parameters:
keyword
- the search keywordjobStatus
- the job statusfromDate
- the start dateportal
- the portals client associationsloginName
- the login name to filter on (optional)- Returns:
- the list of jobs for the given search criteria
- Since:
- 4.3.1
-
getNumberOfJobsCreated
Return the number of jobs created within a certain date range and optionally matching a specific client. Other attributes such as current job status are not considered.- Parameters:
startDate
- the start date (required, inclusive)endDate
- the end date (required, exclusive)client
- the organization to match (optional)- Returns:
- the number of jobs created during the specified period
- Since:
- 4.2.0
-
getPurgeJobDataJobList
Return the list of Job of which job data can be purged- Parameters:
fetchLimit
- the query fetch limitcutoffDate
- the query cut off date- Returns:
- the list of Job to purge job data
- Since:
- 24.4.0
-
getPurgeJobIdList
Return the list of Job ID to purge.- Parameters:
fetchLimit
- the query fetch limit- Returns:
- the list of Job ID to purge
- Since:
- 4.3.3
-
recalcJobPurgeTime
public void recalcJobPurgeTime(int maxAgeInDays) Recalculate job purge times if the global purge policy has changed.- Parameters:
maxAgeInDays
- the new maximum age of a collaboration job- Since:
- 4.3.3
-
updateJobDataPurgeTime
Set the job data purge time based on the job status. Set job data purge time if the job is finished (Completed, Cancelled, Expired)- Parameters:
job
- the job (required)- Since:
- 24.4.0
-
updateJobPurgeTime
Updates the job purge time based on the job status. Note that if the job is finished (completed, cancelled, expired), the finished time should be set for purge time calculation.- Parameters:
job
- the job (required)- Since:
- 4.3.3
-
recalcJobAbandonTime
Recalculate job abandon times if the global Abandon policy has changed.- Parameters:
clientId
- the client id (optional; if clientId is not set, it is assumed that the system policy has changed)maxAgeInDays
- the new maximum age of a collaboration jobcalcOnTimeCreated
- value based on which the abandon time is calculated from time created or last processed- Since:
- 22.4.0
-
recalcJobDataPurgeTime
Recalc job data purge time- Parameters:
clientId
- the client idmaxAgeInDays
- the new maximum age of a collaboration job data- Since:
- 24.4.0
-
updateJobAbandonTime
Updates the job Abandon time based on the job status and deployment setting (i.e. based on time created or time last processed). Note that if the job is not cancelled, completed, Error, expired, based on the deployment setting Abandon time is calculated from time created or time last processed.- Parameters:
job
- the job (required)- Since:
- 22.4.0
-
getFinishedJobCount
public int getFinishedJobCount()Return the number of finished collaboration jobs- Returns:
- the number of finished collaboration jobs
- Since:
- 4.3.3
-
getJobsForLicensing
Return up to 100,000 collaboration jobs that have not yet been published for licensing- Returns:
- a result iterator for matching jobs
- Since:
- 4.3.4
-