Class BackgroundTaskLocalServiceUtil

java.lang.Object
com.liferay.portal.background.task.service.BackgroundTaskLocalServiceUtil

public class BackgroundTaskLocalServiceUtil extends Object
Provides the local service utility for BackgroundTask. This utility wraps 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 Details

    • BackgroundTaskLocalServiceUtil

      public BackgroundTaskLocalServiceUtil()
  • Method Details

    • addBackgroundTask

      public static BackgroundTask addBackgroundTask(BackgroundTask backgroundTask)
      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

      public static BackgroundTask createBackgroundTask(long backgroundTaskId)
      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

      public static <T> List<T> dynamicQuery(com.liferay.portal.kernel.dao.orm.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 - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portal.background.task.model.impl.BackgroundTaskModelImpl.

      Parameters:
      dynamicQuery - the dynamic query
      start - the lower bound of the range of model instances
      end - 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 - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portal.background.task.model.impl.BackgroundTaskModelImpl.

      Parameters:
      dynamicQuery - the dynamic query
      start - the lower bound of the range of model instances
      end - the upper bound of the range of model instances (not inclusive)
      orderByComparator - the comparator to order the results by (optionally null)
      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 query
      projection - the projection to apply to the query
      Returns:
      the number of rows matching the dynamic query
    • fetchBackgroundTask

      public static BackgroundTask fetchBackgroundTask(long backgroundTaskId)
    • fetchFirstBackgroundTask

      public static BackgroundTask fetchFirstBackgroundTask(long groupId, String taskExecutorClassName, boolean completed, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator)
    • fetchFirstBackgroundTask

      public static BackgroundTask fetchFirstBackgroundTask(String taskExecutorClassName, int status)
    • 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

      public static List<BackgroundTask> getBackgroundTasks(int start, int end)
      Returns a range of all the background tasks.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portal.background.task.model.impl.BackgroundTaskModelImpl.

      Parameters:
      start - the lower bound of the range of background tasks
      end - the upper bound of the range of background tasks (not inclusive)
      Returns:
      the range of background tasks
    • getBackgroundTasks

      public static List<BackgroundTask> getBackgroundTasks(long groupId, int status)
    • getBackgroundTasks

      public static List<BackgroundTask> getBackgroundTasks(long groupId, String taskExecutorClassName)
    • 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

      public static List<BackgroundTask> getBackgroundTasks(String taskExecutorClassName, int status)
    • getBackgroundTasks

      public static List<BackgroundTask> getBackgroundTasks(String taskExecutorClassName, int status, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<BackgroundTask> orderByComparator)
    • getBackgroundTasks

      public static List<BackgroundTask> getBackgroundTasks(String[] taskExecutorClassNames, int status)
    • 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

      public static int getBackgroundTasksCount(long groupId, String taskExecutorClassName)
    • getBackgroundTasksCount

      public static int getBackgroundTasksCount(long groupId, String taskExecutorClassName, boolean completed)
    • getBackgroundTasksCount

      public static int getBackgroundTasksCount(long groupId, String name, String taskExecutorClassName)
    • getBackgroundTasksCount

      public static int getBackgroundTasksCount(long groupId, String name, String taskExecutorClassName, boolean completed)
    • getBackgroundTasksCount

      public static int getBackgroundTasksCount(long[] groupIds, String name, String taskExecutorClassName)
    • getBackgroundTasksCount

      public static int getBackgroundTasksCount(long[] groupIds, String name, String taskExecutorClassName, boolean completed)
    • getBackgroundTasksCount

      public static int getBackgroundTasksCount(long[] groupIds, String name, String[] taskExecutorClassName)
    • getBackgroundTasksCount

      public static int getBackgroundTasksCount(long[] groupIds, String[] taskExecutorClassNames)
    • getBackgroundTasksCount

      public static int getBackgroundTasksCount(long[] groupIds, String[] taskExecutorClassNames, boolean completed)
    • getBackgroundTaskStatusJSON

      public static String getBackgroundTaskStatusJSON(long backgroundTaskId)
    • getIndexableActionableDynamicQuery

      public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
    • getOSGiServiceIdentifier

      public static String 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

      public static BackgroundTask updateBackgroundTask(BackgroundTask backgroundTask)
      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

      public static BackgroundTaskLocalService getService()