001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for BackgroundTask. This utility wraps
024     * {@link com.liferay.portal.service.impl.BackgroundTaskLocalServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on the local server. Methods of this service will not have security checks
027     * based on the propagated JAAS credentials because this service can only be
028     * accessed from within the same VM.
029     *
030     * @author Brian Wing Shun Chan
031     * @see BackgroundTaskLocalService
032     * @see com.liferay.portal.service.base.BackgroundTaskLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.BackgroundTaskLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class BackgroundTaskLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.BackgroundTaskLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043    
044            /**
045            * Adds the background task to the database. Also notifies the appropriate model listeners.
046            *
047            * @param backgroundTask the background task
048            * @return the background task that was added
049            */
050            public static com.liferay.portal.model.BackgroundTask addBackgroundTask(
051                    com.liferay.portal.model.BackgroundTask backgroundTask) {
052                    return getService().addBackgroundTask(backgroundTask);
053            }
054    
055            public static com.liferay.portal.model.BackgroundTask addBackgroundTask(
056                    long userId, long groupId, java.lang.String name,
057                    java.lang.String[] servletContextNames,
058                    java.lang.Class<?> taskExecutorClass,
059                    java.util.Map<java.lang.String, java.io.Serializable> taskContextMap,
060                    com.liferay.portal.service.ServiceContext serviceContext)
061                    throws com.liferay.portal.kernel.exception.PortalException {
062                    return getService()
063                                       .addBackgroundTask(userId, groupId, name,
064                            servletContextNames, taskExecutorClass, taskContextMap,
065                            serviceContext);
066            }
067    
068            public static void addBackgroundTaskAttachment(long userId,
069                    long backgroundTaskId, java.lang.String fileName, java.io.File file)
070                    throws com.liferay.portal.kernel.exception.PortalException {
071                    getService()
072                            .addBackgroundTaskAttachment(userId, backgroundTaskId, fileName,
073                            file);
074            }
075    
076            public static void addBackgroundTaskAttachment(long userId,
077                    long backgroundTaskId, java.lang.String fileName,
078                    java.io.InputStream inputStream)
079                    throws com.liferay.portal.kernel.exception.PortalException {
080                    getService()
081                            .addBackgroundTaskAttachment(userId, backgroundTaskId, fileName,
082                            inputStream);
083            }
084    
085            public static com.liferay.portal.model.BackgroundTask amendBackgroundTask(
086                    long backgroundTaskId,
087                    java.util.Map<java.lang.String, java.io.Serializable> taskContextMap,
088                    int status, com.liferay.portal.service.ServiceContext serviceContext) {
089                    return getService()
090                                       .amendBackgroundTask(backgroundTaskId, taskContextMap,
091                            status, serviceContext);
092            }
093    
094            public static com.liferay.portal.model.BackgroundTask amendBackgroundTask(
095                    long backgroundTaskId,
096                    java.util.Map<java.lang.String, java.io.Serializable> taskContextMap,
097                    int status, java.lang.String statusMessage,
098                    com.liferay.portal.service.ServiceContext serviceContext) {
099                    return getService()
100                                       .amendBackgroundTask(backgroundTaskId, taskContextMap,
101                            status, statusMessage, serviceContext);
102            }
103    
104            public static void cleanUpBackgroundTask(
105                    com.liferay.portal.model.BackgroundTask backgroundTask, int status) {
106                    getService().cleanUpBackgroundTask(backgroundTask, status);
107            }
108    
109            public static void cleanUpBackgroundTasks() {
110                    getService().cleanUpBackgroundTasks();
111            }
112    
113            /**
114            * Creates a new background task with the primary key. Does not add the background task to the database.
115            *
116            * @param backgroundTaskId the primary key for the new background task
117            * @return the new background task
118            */
119            public static com.liferay.portal.model.BackgroundTask createBackgroundTask(
120                    long backgroundTaskId) {
121                    return getService().createBackgroundTask(backgroundTaskId);
122            }
123    
124            /**
125            * Deletes the background task from the database. Also notifies the appropriate model listeners.
126            *
127            * @param backgroundTask the background task
128            * @return the background task that was removed
129            * @throws PortalException
130            */
131            public static com.liferay.portal.model.BackgroundTask deleteBackgroundTask(
132                    com.liferay.portal.model.BackgroundTask backgroundTask)
133                    throws com.liferay.portal.kernel.exception.PortalException {
134                    return getService().deleteBackgroundTask(backgroundTask);
135            }
136    
137            /**
138            * Deletes the background task with the primary key from the database. Also notifies the appropriate model listeners.
139            *
140            * @param backgroundTaskId the primary key of the background task
141            * @return the background task that was removed
142            * @throws PortalException if a background task with the primary key could not be found
143            */
144            public static com.liferay.portal.model.BackgroundTask deleteBackgroundTask(
145                    long backgroundTaskId)
146                    throws com.liferay.portal.kernel.exception.PortalException {
147                    return getService().deleteBackgroundTask(backgroundTaskId);
148            }
149    
150            public static void deleteCompanyBackgroundTasks(long companyId)
151                    throws com.liferay.portal.kernel.exception.PortalException {
152                    getService().deleteCompanyBackgroundTasks(companyId);
153            }
154    
155            public static void deleteGroupBackgroundTasks(long groupId)
156                    throws com.liferay.portal.kernel.exception.PortalException {
157                    getService().deleteGroupBackgroundTasks(groupId);
158            }
159    
160            /**
161            * @throws PortalException
162            */
163            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
164                    com.liferay.portal.model.PersistedModel persistedModel)
165                    throws com.liferay.portal.kernel.exception.PortalException {
166                    return getService().deletePersistedModel(persistedModel);
167            }
168    
169            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
170                    return getService().dynamicQuery();
171            }
172    
173            /**
174            * Performs a dynamic query on the database and returns the matching rows.
175            *
176            * @param dynamicQuery the dynamic query
177            * @return the matching rows
178            */
179            public static <T> java.util.List<T> dynamicQuery(
180                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
181                    return getService().dynamicQuery(dynamicQuery);
182            }
183    
184            /**
185            * Performs a dynamic query on the database and returns a range of the matching rows.
186            *
187            * <p>
188            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.BackgroundTaskModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
189            * </p>
190            *
191            * @param dynamicQuery the dynamic query
192            * @param start the lower bound of the range of model instances
193            * @param end the upper bound of the range of model instances (not inclusive)
194            * @return the range of matching rows
195            */
196            public static <T> java.util.List<T> dynamicQuery(
197                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
198                    int end) {
199                    return getService().dynamicQuery(dynamicQuery, start, end);
200            }
201    
202            /**
203            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
204            *
205            * <p>
206            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.BackgroundTaskModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
207            * </p>
208            *
209            * @param dynamicQuery the dynamic query
210            * @param start the lower bound of the range of model instances
211            * @param end the upper bound of the range of model instances (not inclusive)
212            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
213            * @return the ordered range of matching rows
214            */
215            public static <T> java.util.List<T> dynamicQuery(
216                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
217                    int end,
218                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
219                    return getService()
220                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
221            }
222    
223            /**
224            * Returns the number of rows matching the dynamic query.
225            *
226            * @param dynamicQuery the dynamic query
227            * @return the number of rows matching the dynamic query
228            */
229            public static long dynamicQueryCount(
230                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
231                    return getService().dynamicQueryCount(dynamicQuery);
232            }
233    
234            /**
235            * Returns the number of rows matching the dynamic query.
236            *
237            * @param dynamicQuery the dynamic query
238            * @param projection the projection to apply to the query
239            * @return the number of rows matching the dynamic query
240            */
241            public static long dynamicQueryCount(
242                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
243                    com.liferay.portal.kernel.dao.orm.Projection projection) {
244                    return getService().dynamicQueryCount(dynamicQuery, projection);
245            }
246    
247            public static com.liferay.portal.model.BackgroundTask fetchBackgroundTask(
248                    long backgroundTaskId) {
249                    return getService().fetchBackgroundTask(backgroundTaskId);
250            }
251    
252            public static com.liferay.portal.model.BackgroundTask fetchFirstBackgroundTask(
253                    long groupId, java.lang.String taskExecutorClassName,
254                    boolean completed,
255                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.BackgroundTask> orderByComparator) {
256                    return getService()
257                                       .fetchFirstBackgroundTask(groupId, taskExecutorClassName,
258                            completed, orderByComparator);
259            }
260    
261            public static com.liferay.portal.model.BackgroundTask fetchFirstBackgroundTask(
262                    java.lang.String taskExecutorClassName, int status) {
263                    return getService()
264                                       .fetchFirstBackgroundTask(taskExecutorClassName, status);
265            }
266    
267            public static com.liferay.portal.model.BackgroundTask fetchFirstBackgroundTask(
268                    java.lang.String taskExecutorClassName, int status,
269                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.BackgroundTask> orderByComparator) {
270                    return getService()
271                                       .fetchFirstBackgroundTask(taskExecutorClassName, status,
272                            orderByComparator);
273            }
274    
275            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
276                    return getService().getActionableDynamicQuery();
277            }
278    
279            /**
280            * Returns the background task with the primary key.
281            *
282            * @param backgroundTaskId the primary key of the background task
283            * @return the background task
284            * @throws PortalException if a background task with the primary key could not be found
285            */
286            public static com.liferay.portal.model.BackgroundTask getBackgroundTask(
287                    long backgroundTaskId)
288                    throws com.liferay.portal.kernel.exception.PortalException {
289                    return getService().getBackgroundTask(backgroundTaskId);
290            }
291    
292            public static java.lang.String getBackgroundTaskStatusJSON(
293                    long backgroundTaskId) {
294                    return getService().getBackgroundTaskStatusJSON(backgroundTaskId);
295            }
296    
297            public static java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
298                    long groupId, java.lang.String name,
299                    java.lang.String taskExecutorClassName, int start, int end,
300                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.BackgroundTask> orderByComparator) {
301                    return getService()
302                                       .getBackgroundTasks(groupId, name, taskExecutorClassName,
303                            start, end, orderByComparator);
304            }
305    
306            public static java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
307                    long groupId, int status) {
308                    return getService().getBackgroundTasks(groupId, status);
309            }
310    
311            public static java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
312                    long groupId, java.lang.String taskExecutorClassName) {
313                    return getService().getBackgroundTasks(groupId, taskExecutorClassName);
314            }
315    
316            public static java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
317                    long groupId, java.lang.String taskExecutorClassName, int start,
318                    int end,
319                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.BackgroundTask> orderByComparator) {
320                    return getService()
321                                       .getBackgroundTasks(groupId, taskExecutorClassName, start,
322                            end, orderByComparator);
323            }
324    
325            public static java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
326                    long groupId, java.lang.String taskExecutorClassName, int status) {
327                    return getService()
328                                       .getBackgroundTasks(groupId, taskExecutorClassName, status);
329            }
330    
331            public static java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
332                    long groupId, java.lang.String[] taskExecutorClassNames) {
333                    return getService().getBackgroundTasks(groupId, taskExecutorClassNames);
334            }
335    
336            public static java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
337                    long groupId, java.lang.String[] taskExecutorClassNames, int start,
338                    int end,
339                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.BackgroundTask> orderByComparator) {
340                    return getService()
341                                       .getBackgroundTasks(groupId, taskExecutorClassNames, start,
342                            end, orderByComparator);
343            }
344    
345            public static java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
346                    long groupId, java.lang.String[] taskExecutorClassNames, int status) {
347                    return getService()
348                                       .getBackgroundTasks(groupId, taskExecutorClassNames, status);
349            }
350    
351            /**
352            * Returns a range of all the background tasks.
353            *
354            * <p>
355            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.BackgroundTaskModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
356            * </p>
357            *
358            * @param start the lower bound of the range of background tasks
359            * @param end the upper bound of the range of background tasks (not inclusive)
360            * @return the range of background tasks
361            */
362            public static java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
363                    int start, int end) {
364                    return getService().getBackgroundTasks(start, end);
365            }
366    
367            public static java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
368                    java.lang.String taskExecutorClassName, int status) {
369                    return getService().getBackgroundTasks(taskExecutorClassName, status);
370            }
371    
372            public static java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
373                    java.lang.String taskExecutorClassName, int status, int start, int end,
374                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.BackgroundTask> orderByComparator) {
375                    return getService()
376                                       .getBackgroundTasks(taskExecutorClassName, status, start,
377                            end, orderByComparator);
378            }
379    
380            public static java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
381                    java.lang.String[] taskExecutorClassNames, int status) {
382                    return getService().getBackgroundTasks(taskExecutorClassNames, status);
383            }
384    
385            public static java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
386                    java.lang.String[] taskExecutorClassNames, int status, int start,
387                    int end,
388                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.BackgroundTask> orderByComparator) {
389                    return getService()
390                                       .getBackgroundTasks(taskExecutorClassNames, status, start,
391                            end, orderByComparator);
392            }
393    
394            /**
395            * Returns the number of background tasks.
396            *
397            * @return the number of background tasks
398            */
399            public static int getBackgroundTasksCount() {
400                    return getService().getBackgroundTasksCount();
401            }
402    
403            public static int getBackgroundTasksCount(long groupId,
404                    java.lang.String name, java.lang.String taskExecutorClassName) {
405                    return getService()
406                                       .getBackgroundTasksCount(groupId, name, taskExecutorClassName);
407            }
408    
409            public static int getBackgroundTasksCount(long groupId,
410                    java.lang.String name, java.lang.String taskExecutorClassName,
411                    boolean completed) {
412                    return getService()
413                                       .getBackgroundTasksCount(groupId, name,
414                            taskExecutorClassName, completed);
415            }
416    
417            public static int getBackgroundTasksCount(long groupId,
418                    java.lang.String taskExecutorClassName) {
419                    return getService()
420                                       .getBackgroundTasksCount(groupId, taskExecutorClassName);
421            }
422    
423            public static int getBackgroundTasksCount(long groupId,
424                    java.lang.String taskExecutorClassName, boolean completed) {
425                    return getService()
426                                       .getBackgroundTasksCount(groupId, taskExecutorClassName,
427                            completed);
428            }
429    
430            public static int getBackgroundTasksCount(long groupId,
431                    java.lang.String[] taskExecutorClassNames) {
432                    return getService()
433                                       .getBackgroundTasksCount(groupId, taskExecutorClassNames);
434            }
435    
436            public static int getBackgroundTasksCount(long groupId,
437                    java.lang.String[] taskExecutorClassNames, boolean completed) {
438                    return getService()
439                                       .getBackgroundTasksCount(groupId, taskExecutorClassNames,
440                            completed);
441            }
442    
443            /**
444            * Returns the Spring bean ID for this bean.
445            *
446            * @return the Spring bean ID for this bean
447            */
448            public static java.lang.String getBeanIdentifier() {
449                    return getService().getBeanIdentifier();
450            }
451    
452            public static com.liferay.portal.model.PersistedModel getPersistedModel(
453                    java.io.Serializable primaryKeyObj)
454                    throws com.liferay.portal.kernel.exception.PortalException {
455                    return getService().getPersistedModel(primaryKeyObj);
456            }
457    
458            public static void resumeBackgroundTask(long backgroundTaskId) {
459                    getService().resumeBackgroundTask(backgroundTaskId);
460            }
461    
462            /**
463            * Sets the Spring bean ID for this bean.
464            *
465            * @param beanIdentifier the Spring bean ID for this bean
466            */
467            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
468                    getService().setBeanIdentifier(beanIdentifier);
469            }
470    
471            public static void triggerBackgroundTask(long backgroundTaskId) {
472                    getService().triggerBackgroundTask(backgroundTaskId);
473            }
474    
475            /**
476            * Updates the background task in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
477            *
478            * @param backgroundTask the background task
479            * @return the background task that was updated
480            */
481            public static com.liferay.portal.model.BackgroundTask updateBackgroundTask(
482                    com.liferay.portal.model.BackgroundTask backgroundTask) {
483                    return getService().updateBackgroundTask(backgroundTask);
484            }
485    
486            public static BackgroundTaskLocalService getService() {
487                    if (_service == null) {
488                            _service = (BackgroundTaskLocalService)PortalBeanLocatorUtil.locate(BackgroundTaskLocalService.class.getName());
489    
490                            ReferenceRegistry.registerReference(BackgroundTaskLocalServiceUtil.class,
491                                    "_service");
492                    }
493    
494                    return _service;
495            }
496    
497            /**
498             * @deprecated As of 6.2.0
499             */
500            @Deprecated
501            public void setService(BackgroundTaskLocalService service) {
502            }
503    
504            private static BackgroundTaskLocalService _service;
505    }