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
-
public class JobDao extends AbstractDao
Provides a DAO for the Collaboration Job entity.- Since:
- 4.0.0
- See Also:
Job
-
-
Field Summary
-
Fields inherited from class com.avoka.core.dao.BaseDao
FETCH_LIMIT, STATEMENT_MAX_NO_PARAMETERS
-
-
Constructor Summary
Constructors Constructor Description JobDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
getFinishedJobCount()
Return the number of finished collaboration jobsJob
getJobForKey(String jobKey)
Return the Job object for the given job key or null if not found.Job
getJobForPK(Object id)
Return the Job object for the given primary key or null if not found.Job
getJobForReferenceNumber(String referenceNumber)
Return the first Job object for the given reference number or null if not found.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.List<Job>
getJobList(String keyword, String jobStatus, Date fromDate, Portal portal)
Deprecated.List<Job>
getJobList(String keyword, String jobStatus, Date fromDate, Portal portal, String loginName)
Deprecated.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.org.apache.cayenne.ResultIterator<Job>
getJobsForLicensing()
Return up to 100,000 collaboration jobs that have not yet been published for licensingList<Job>
getJobsReadyToProcess()
Return 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.List<Long>
getPurgeJobIdList(int fetchLimit)
Return the list of Job ID to purge.void
recalcJobPurgeTime(int maxAgeInDays)
Recalculate job purge times if the global purge policy has changed.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
-
-
-
-
Method Detail
-
getJobForPK
public Job getJobForPK(Object id)
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
public Job getJobForKey(String jobKey)
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
public Job getJobForReferenceNumber(String referenceNumber)
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
public List<Job> 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
public List<Job> getJobList(String keyword, String jobStatus, Date fromDate, Portal portal)
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
public 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. 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
-
getPurgeJobIdList
public List<Long> getPurgeJobIdList(int fetchLimit)
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
-
updateJobPurgeTime
public void updateJobPurgeTime(Job job)
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
-
getFinishedJobCount
public int getFinishedJobCount()
Return the number of finished collaboration jobs- Returns:
- the number of finished collaboration jobs
- Since:
- 4.3.3
-
getJobsForLicensing
public org.apache.cayenne.ResultIterator<Job> 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
-
-