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