Class BackgroundTaskLocalServiceUtil
com.liferay.portal.background.task.service.impl.BackgroundTaskLocalServiceImpl and
is an access point for service operations in application layer code running
on the local server. Methods of this service will not have security checks
based on the propagated JAAS credentials because this service can only be
accessed from within the same VM.- See Also:
- Generated:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BackgroundTaskaddBackgroundTask(long userId, long groupId, String name, String[] servletContextNames, Class<?> taskExecutorClass, Map<String, Serializable> taskContextMap, com.liferay.portal.kernel.service.ServiceContext serviceContext) static BackgroundTaskaddBackgroundTask(long userId, long groupId, String name, String taskExecutorClassName, Map<String, Serializable> taskContextMap, com.liferay.portal.kernel.service.ServiceContext serviceContext) static BackgroundTaskaddBackgroundTask(BackgroundTask backgroundTask) Adds the background task to the database.static voidaddBackgroundTaskAttachment(long userId, long backgroundTaskId, String fileName, File file) static voidaddBackgroundTaskAttachment(long userId, long backgroundTaskId, String fileName, InputStream inputStream) static BackgroundTaskamendBackgroundTask(long backgroundTaskId, Map<String, Serializable> taskContextMap, int status, com.liferay.portal.kernel.service.ServiceContext serviceContext) static BackgroundTaskamendBackgroundTask(long backgroundTaskId, Map<String, Serializable> taskContextMap, int status, String statusMessage, com.liferay.portal.kernel.service.ServiceContext serviceContext) static voidcleanUpBackgroundTask(long backgroundTaskId, int status) static voidstatic BackgroundTaskcreateBackgroundTask(long backgroundTaskId) Creates a new background task with the primary key.static com.liferay.portal.kernel.model.PersistedModelcreatePersistedModel(Serializable primaryKeyObj) static BackgroundTaskdeleteBackgroundTask(long backgroundTaskId) Deletes the background task with the primary key from the database.static BackgroundTaskdeleteBackgroundTask(BackgroundTask backgroundTask) Deletes the background task from the database.static voiddeleteCompanyBackgroundTasks(long companyId) static voiddeleteGroupBackgroundTasks(long groupId) static voiddeleteGroupBackgroundTasks(long groupId, String name, String taskExecutorClassName) static com.liferay.portal.kernel.model.PersistedModeldeletePersistedModel(com.liferay.portal.kernel.model.PersistedModel persistedModel) static <T> TdslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) static intdslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) static com.liferay.portal.kernel.dao.orm.DynamicQuerystatic <T> List<T> dynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) Performs a dynamic query on the database and returns the matching rows.static <T> List<T> dynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end) Performs a dynamic query on the database and returns a range of the matching rows.static <T> List<T> dynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) Performs a dynamic query on the database and returns an ordered range of the matching rows.static longdynamicQueryCount(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) Returns the number of rows matching the dynamic query.static longdynamicQueryCount(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, com.liferay.portal.kernel.dao.orm.Projection projection) Returns the number of rows matching the dynamic query.static BackgroundTaskfetchBackgroundTask(long backgroundTaskId) static BackgroundTaskfetchFirstBackgroundTask(long groupId, String taskExecutorClassName, boolean completed, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator) static BackgroundTaskfetchFirstBackgroundTask(String taskExecutorClassName, int status) static BackgroundTaskfetchFirstBackgroundTask(String taskExecutorClassName, int status, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator) static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuerystatic BackgroundTaskgetBackgroundTask(long backgroundTaskId) Returns the background task with the primary key.static List<BackgroundTask> getBackgroundTasks(int start, int end) Returns a range of all the background tasks.static List<BackgroundTask> getBackgroundTasks(long[] groupIds, String[] taskExecutorClassNames) static List<BackgroundTask> getBackgroundTasks(long[] groupIds, String[] taskExecutorClassNames, boolean completed) static List<BackgroundTask> getBackgroundTasks(long[] groupIds, String[] taskExecutorClassNames, boolean completed, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator) static List<BackgroundTask> getBackgroundTasks(long[] groupIds, String[] taskExecutorClassNames, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator) static List<BackgroundTask> getBackgroundTasks(long[] groupIds, String name, String[] taskExecutorClassNames, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator) static List<BackgroundTask> getBackgroundTasks(long[] groupIds, String name, String taskExecutorClassName, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator) static List<BackgroundTask> getBackgroundTasks(long groupId, int status) static List<BackgroundTask> getBackgroundTasks(long groupId, String taskExecutorClassName) static List<BackgroundTask> getBackgroundTasks(long groupId, String[] taskExecutorClassNames, int status) static List<BackgroundTask> getBackgroundTasks(long groupId, String taskExecutorClassName, boolean completed, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator) static List<BackgroundTask> getBackgroundTasks(long groupId, String taskExecutorClassName, int status) static List<BackgroundTask> getBackgroundTasks(long groupId, String taskExecutorClassName, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator) static List<BackgroundTask> getBackgroundTasks(long groupId, String name, String taskExecutorClassName, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator) static List<BackgroundTask> getBackgroundTasks(String[] taskExecutorClassNames, int status) static List<BackgroundTask> getBackgroundTasks(String[] taskExecutorClassNames, int status, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator) static List<BackgroundTask> getBackgroundTasks(String taskExecutorClassName, int status) static List<BackgroundTask> getBackgroundTasks(String taskExecutorClassName, int status, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator) static List<BackgroundTask> getBackgroundTasksByDuration(long[] groupIds, String[] taskExecutorClassNames, boolean completed, int start, int end, boolean orderByType) static List<BackgroundTask> getBackgroundTasksByDuration(long[] groupIds, String[] taskExecutorClassNames, int start, int end, boolean orderByType) static intReturns the number of background tasks.static intgetBackgroundTasksCount(long[] groupIds, String[] taskExecutorClassNames) static intgetBackgroundTasksCount(long[] groupIds, String[] taskExecutorClassNames, boolean completed) static intgetBackgroundTasksCount(long[] groupIds, String name, String taskExecutorClassName) static intgetBackgroundTasksCount(long[] groupIds, String name, String[] taskExecutorClassName) static intgetBackgroundTasksCount(long[] groupIds, String name, String taskExecutorClassName, boolean completed) static intgetBackgroundTasksCount(long groupId, String taskExecutorClassName) static intgetBackgroundTasksCount(long groupId, String taskExecutorClassName, boolean completed) static intgetBackgroundTasksCount(long groupId, String name, String taskExecutorClassName) static intgetBackgroundTasksCount(long groupId, String name, String taskExecutorClassName, boolean completed) static StringgetBackgroundTaskStatusJSON(long backgroundTaskId) static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuerystatic StringReturns the OSGi service identifier.static com.liferay.portal.kernel.model.PersistedModelgetPersistedModel(Serializable primaryKeyObj) static BackgroundTaskLocalServicestatic voidresumeBackgroundTask(long backgroundTaskId) static voidtriggerBackgroundTask(long backgroundTaskId) static BackgroundTaskupdateBackgroundTask(BackgroundTask backgroundTask) Updates the background task in the database or adds it if it does not yet exist.
-
Constructor Details
-
BackgroundTaskLocalServiceUtil
public BackgroundTaskLocalServiceUtil()
-
-
Method Details
-
addBackgroundTask
Adds the background task to the database. Also notifies the appropriate model listeners.Important: Inspect BackgroundTaskLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Parameters:
backgroundTask- the background task- Returns:
- the background task that was added
-
addBackgroundTask
public static BackgroundTask addBackgroundTask(long userId, long groupId, String name, String taskExecutorClassName, Map<String, Serializable> taskContextMap, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException- Throws:
com.liferay.portal.kernel.exception.PortalException
-
addBackgroundTask
public static BackgroundTask addBackgroundTask(long userId, long groupId, String name, String[] servletContextNames, Class<?> taskExecutorClass, Map<String, Serializable> taskContextMap, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException- Throws:
com.liferay.portal.kernel.exception.PortalException
-
addBackgroundTaskAttachment
public static void addBackgroundTaskAttachment(long userId, long backgroundTaskId, String fileName, File file) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addBackgroundTaskAttachment
public static void addBackgroundTaskAttachment(long userId, long backgroundTaskId, String fileName, InputStream inputStream) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
amendBackgroundTask
public static BackgroundTask amendBackgroundTask(long backgroundTaskId, Map<String, Serializable> taskContextMap, int status, com.liferay.portal.kernel.service.ServiceContext serviceContext) -
amendBackgroundTask
public static BackgroundTask amendBackgroundTask(long backgroundTaskId, Map<String, Serializable> taskContextMap, int status, String statusMessage, com.liferay.portal.kernel.service.ServiceContext serviceContext) -
cleanUpBackgroundTask
public static void cleanUpBackgroundTask(long backgroundTaskId, int status) -
cleanUpBackgroundTasks
public static void cleanUpBackgroundTasks() -
createBackgroundTask
Creates a new background task with the primary key. Does not add the background task to the database.- Parameters:
backgroundTaskId- the primary key for the new background task- Returns:
- the new background task
-
createPersistedModel
public static com.liferay.portal.kernel.model.PersistedModel createPersistedModel(Serializable primaryKeyObj) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteBackgroundTask
public static BackgroundTask deleteBackgroundTask(BackgroundTask backgroundTask) throws com.liferay.portal.kernel.exception.PortalException Deletes the background task from the database. Also notifies the appropriate model listeners.Important: Inspect BackgroundTaskLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Parameters:
backgroundTask- the background task- Returns:
- the background task that was removed
- Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteBackgroundTask
public static BackgroundTask deleteBackgroundTask(long backgroundTaskId) throws com.liferay.portal.kernel.exception.PortalException Deletes the background task with the primary key from the database. Also notifies the appropriate model listeners.Important: Inspect BackgroundTaskLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Parameters:
backgroundTaskId- the primary key of the background task- Returns:
- the background task that was removed
- Throws:
com.liferay.portal.kernel.exception.PortalException- if a background task with the primary key could not be found
-
deleteCompanyBackgroundTasks
public static void deleteCompanyBackgroundTasks(long companyId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteGroupBackgroundTasks
public static void deleteGroupBackgroundTasks(long groupId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteGroupBackgroundTasks
public static void deleteGroupBackgroundTasks(long groupId, String name, String taskExecutorClassName) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
deletePersistedModel
public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(com.liferay.portal.kernel.model.PersistedModel persistedModel) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
dslQuery
public static <T> T dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) -
dslQueryCount
public static int dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) -
dynamicQuery
public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() -
dynamicQuery
Performs a dynamic query on the database and returns the matching rows.- Parameters:
dynamicQuery- the dynamic query- Returns:
- the matching rows
-
dynamicQuery
public static <T> List<T> dynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end) Performs a dynamic query on the database and returns a range of the matching rows.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromcom.liferay.portal.background.task.model.impl.BackgroundTaskModelImpl.- Parameters:
dynamicQuery- the dynamic querystart- the lower bound of the range of model instancesend- the upper bound of the range of model instances (not inclusive)- Returns:
- the range of matching rows
-
dynamicQuery
public static <T> List<T> dynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) Performs a dynamic query on the database and returns an ordered range of the matching rows.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromcom.liferay.portal.background.task.model.impl.BackgroundTaskModelImpl.- Parameters:
dynamicQuery- the dynamic querystart- the lower bound of the range of model instancesend- the upper bound of the range of model instances (not inclusive)orderByComparator- the comparator to order the results by (optionallynull)- Returns:
- the ordered range of matching rows
-
dynamicQueryCount
public static long dynamicQueryCount(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) Returns the number of rows matching the dynamic query.- Parameters:
dynamicQuery- the dynamic query- Returns:
- the number of rows matching the dynamic query
-
dynamicQueryCount
public static long dynamicQueryCount(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, com.liferay.portal.kernel.dao.orm.Projection projection) Returns the number of rows matching the dynamic query.- Parameters:
dynamicQuery- the dynamic queryprojection- the projection to apply to the query- Returns:
- the number of rows matching the dynamic query
-
fetchBackgroundTask
-
fetchFirstBackgroundTask
public static BackgroundTask fetchFirstBackgroundTask(long groupId, String taskExecutorClassName, boolean completed, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator) -
fetchFirstBackgroundTask
-
fetchFirstBackgroundTask
public static BackgroundTask fetchFirstBackgroundTask(String taskExecutorClassName, int status, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator) -
getActionableDynamicQuery
public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() -
getBackgroundTask
public static BackgroundTask getBackgroundTask(long backgroundTaskId) throws com.liferay.portal.kernel.exception.PortalException Returns the background task with the primary key.- Parameters:
backgroundTaskId- the primary key of the background task- Returns:
- the background task
- Throws:
com.liferay.portal.kernel.exception.PortalException- if a background task with the primary key could not be found
-
getBackgroundTasks
Returns a range of all the background tasks.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromcom.liferay.portal.background.task.model.impl.BackgroundTaskModelImpl.- Parameters:
start- the lower bound of the range of background tasksend- the upper bound of the range of background tasks (not inclusive)- Returns:
- the range of background tasks
-
getBackgroundTasks
-
getBackgroundTasks
-
getBackgroundTasks
public static List<BackgroundTask> getBackgroundTasks(long groupId, String taskExecutorClassName, boolean completed, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator) -
getBackgroundTasks
public static List<BackgroundTask> getBackgroundTasks(long groupId, String taskExecutorClassName, int status) -
getBackgroundTasks
public static List<BackgroundTask> getBackgroundTasks(long groupId, String taskExecutorClassName, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator) -
getBackgroundTasks
public static List<BackgroundTask> getBackgroundTasks(long groupId, String name, String taskExecutorClassName, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator) -
getBackgroundTasks
public static List<BackgroundTask> getBackgroundTasks(long groupId, String[] taskExecutorClassNames, int status) -
getBackgroundTasks
public static List<BackgroundTask> getBackgroundTasks(long[] groupIds, String name, String taskExecutorClassName, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator) -
getBackgroundTasks
public static List<BackgroundTask> getBackgroundTasks(long[] groupIds, String name, String[] taskExecutorClassNames, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator) -
getBackgroundTasks
public static List<BackgroundTask> getBackgroundTasks(long[] groupIds, String[] taskExecutorClassNames) -
getBackgroundTasks
public static List<BackgroundTask> getBackgroundTasks(long[] groupIds, String[] taskExecutorClassNames, boolean completed) -
getBackgroundTasks
public static List<BackgroundTask> getBackgroundTasks(long[] groupIds, String[] taskExecutorClassNames, boolean completed, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator) -
getBackgroundTasks
public static List<BackgroundTask> getBackgroundTasks(long[] groupIds, String[] taskExecutorClassNames, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator) -
getBackgroundTasks
-
getBackgroundTasks
public static List<BackgroundTask> getBackgroundTasks(String taskExecutorClassName, int status, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator) -
getBackgroundTasks
-
getBackgroundTasks
public static List<BackgroundTask> getBackgroundTasks(String[] taskExecutorClassNames, int status, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator) -
getBackgroundTasksByDuration
public static List<BackgroundTask> getBackgroundTasksByDuration(long[] groupIds, String[] taskExecutorClassNames, boolean completed, int start, int end, boolean orderByType) -
getBackgroundTasksByDuration
public static List<BackgroundTask> getBackgroundTasksByDuration(long[] groupIds, String[] taskExecutorClassNames, int start, int end, boolean orderByType) -
getBackgroundTasksCount
public static int getBackgroundTasksCount()Returns the number of background tasks.- Returns:
- the number of background tasks
-
getBackgroundTasksCount
-
getBackgroundTasksCount
public static int getBackgroundTasksCount(long groupId, String taskExecutorClassName, boolean completed) -
getBackgroundTasksCount
-
getBackgroundTasksCount
-
getBackgroundTasksCount
-
getBackgroundTasksCount
-
getBackgroundTasksCount
-
getBackgroundTasksCount
-
getBackgroundTasksCount
public static int getBackgroundTasksCount(long[] groupIds, String[] taskExecutorClassNames, boolean completed) -
getBackgroundTaskStatusJSON
-
getIndexableActionableDynamicQuery
public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() -
getOSGiServiceIdentifier
Returns the OSGi service identifier.- Returns:
- the OSGi service identifier
-
getPersistedModel
public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(Serializable primaryKeyObj) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
resumeBackgroundTask
public static void resumeBackgroundTask(long backgroundTaskId) -
triggerBackgroundTask
public static void triggerBackgroundTask(long backgroundTaskId) -
updateBackgroundTask
Updates the background task in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.Important: Inspect BackgroundTaskLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Parameters:
backgroundTask- the background task- Returns:
- the background task that was updated
-
getService
-