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.exception.PortalException;
020    import com.liferay.portal.kernel.exception.SystemException;
021    import com.liferay.portal.kernel.search.IndexableType;
022    import com.liferay.portal.kernel.transaction.Isolation;
023    import com.liferay.portal.kernel.transaction.Propagation;
024    import com.liferay.portal.kernel.transaction.Transactional;
025    
026    /**
027     * Provides the local service interface for BackgroundTask. Methods of this
028     * service will not have security checks based on the propagated JAAS
029     * credentials because this service can only be accessed from within the same
030     * VM.
031     *
032     * @author Brian Wing Shun Chan
033     * @see BackgroundTaskLocalServiceUtil
034     * @see com.liferay.portal.service.base.BackgroundTaskLocalServiceBaseImpl
035     * @see com.liferay.portal.service.impl.BackgroundTaskLocalServiceImpl
036     * @generated
037     */
038    @ProviderType
039    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
040            PortalException.class, SystemException.class})
041    public interface BackgroundTaskLocalService extends BaseLocalService,
042            PersistedModelLocalService {
043            /*
044             * NOTE FOR DEVELOPERS:
045             *
046             * Never modify or reference this interface directly. Always use {@link BackgroundTaskLocalServiceUtil} to access the background task local service. Add custom service methods to {@link com.liferay.portal.service.impl.BackgroundTaskLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
047             */
048    
049            /**
050            * Adds the background task to the database. Also notifies the appropriate model listeners.
051            *
052            * @param backgroundTask the background task
053            * @return the background task that was added
054            */
055            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
056            public com.liferay.portal.model.BackgroundTask addBackgroundTask(
057                    com.liferay.portal.model.BackgroundTask backgroundTask);
058    
059            public com.liferay.portal.model.BackgroundTask addBackgroundTask(
060                    long userId, long groupId, java.lang.String name,
061                    java.lang.String[] servletContextNames,
062                    java.lang.Class<?> taskExecutorClass,
063                    java.util.Map<java.lang.String, java.io.Serializable> taskContextMap,
064                    com.liferay.portal.service.ServiceContext serviceContext)
065                    throws com.liferay.portal.kernel.exception.PortalException;
066    
067            public void addBackgroundTaskAttachment(long userId, long backgroundTaskId,
068                    java.lang.String fileName, java.io.File file)
069                    throws com.liferay.portal.kernel.exception.PortalException;
070    
071            public void addBackgroundTaskAttachment(long userId, long backgroundTaskId,
072                    java.lang.String fileName, java.io.InputStream inputStream)
073                    throws com.liferay.portal.kernel.exception.PortalException;
074    
075            public com.liferay.portal.model.BackgroundTask amendBackgroundTask(
076                    long backgroundTaskId,
077                    java.util.Map<java.lang.String, java.io.Serializable> taskContextMap,
078                    int status, com.liferay.portal.service.ServiceContext serviceContext);
079    
080            public com.liferay.portal.model.BackgroundTask amendBackgroundTask(
081                    long backgroundTaskId,
082                    java.util.Map<java.lang.String, java.io.Serializable> taskContextMap,
083                    int status, java.lang.String statusMessage,
084                    com.liferay.portal.service.ServiceContext serviceContext);
085    
086            @com.liferay.portal.kernel.cluster.Clusterable(onMaster = true)
087            public void cleanUpBackgroundTask(
088                    com.liferay.portal.model.BackgroundTask backgroundTask, int status);
089    
090            @com.liferay.portal.kernel.cluster.Clusterable(onMaster = true)
091            public void cleanUpBackgroundTasks();
092    
093            /**
094            * Creates a new background task with the primary key. Does not add the background task to the database.
095            *
096            * @param backgroundTaskId the primary key for the new background task
097            * @return the new background task
098            */
099            public com.liferay.portal.model.BackgroundTask createBackgroundTask(
100                    long backgroundTaskId);
101    
102            /**
103            * Deletes the background task from the database. Also notifies the appropriate model listeners.
104            *
105            * @param backgroundTask the background task
106            * @return the background task that was removed
107            * @throws PortalException
108            */
109            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
110            public com.liferay.portal.model.BackgroundTask deleteBackgroundTask(
111                    com.liferay.portal.model.BackgroundTask backgroundTask)
112                    throws com.liferay.portal.kernel.exception.PortalException;
113    
114            /**
115            * Deletes the background task with the primary key from the database. Also notifies the appropriate model listeners.
116            *
117            * @param backgroundTaskId the primary key of the background task
118            * @return the background task that was removed
119            * @throws PortalException if a background task with the primary key could not be found
120            */
121            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
122            public com.liferay.portal.model.BackgroundTask deleteBackgroundTask(
123                    long backgroundTaskId)
124                    throws com.liferay.portal.kernel.exception.PortalException;
125    
126            public void deleteCompanyBackgroundTasks(long companyId)
127                    throws com.liferay.portal.kernel.exception.PortalException;
128    
129            public void deleteGroupBackgroundTasks(long groupId)
130                    throws com.liferay.portal.kernel.exception.PortalException;
131    
132            /**
133            * @throws PortalException
134            */
135            @Override
136            public com.liferay.portal.model.PersistedModel deletePersistedModel(
137                    com.liferay.portal.model.PersistedModel persistedModel)
138                    throws com.liferay.portal.kernel.exception.PortalException;
139    
140            public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
141    
142            /**
143            * Performs a dynamic query on the database and returns the matching rows.
144            *
145            * @param dynamicQuery the dynamic query
146            * @return the matching rows
147            */
148            public <T> java.util.List<T> dynamicQuery(
149                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
150    
151            /**
152            * Performs a dynamic query on the database and returns a range of the matching rows.
153            *
154            * <p>
155            * 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.
156            * </p>
157            *
158            * @param dynamicQuery the dynamic query
159            * @param start the lower bound of the range of model instances
160            * @param end the upper bound of the range of model instances (not inclusive)
161            * @return the range of matching rows
162            */
163            public <T> java.util.List<T> dynamicQuery(
164                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
165                    int end);
166    
167            /**
168            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
169            *
170            * <p>
171            * 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.
172            * </p>
173            *
174            * @param dynamicQuery the dynamic query
175            * @param start the lower bound of the range of model instances
176            * @param end the upper bound of the range of model instances (not inclusive)
177            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
178            * @return the ordered range of matching rows
179            */
180            public <T> java.util.List<T> dynamicQuery(
181                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
182                    int end,
183                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator);
184    
185            /**
186            * Returns the number of rows matching the dynamic query.
187            *
188            * @param dynamicQuery the dynamic query
189            * @return the number of rows matching the dynamic query
190            */
191            public long dynamicQueryCount(
192                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
193    
194            /**
195            * Returns the number of rows matching the dynamic query.
196            *
197            * @param dynamicQuery the dynamic query
198            * @param projection the projection to apply to the query
199            * @return the number of rows matching the dynamic query
200            */
201            public long dynamicQueryCount(
202                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
203                    com.liferay.portal.kernel.dao.orm.Projection projection);
204    
205            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
206            public com.liferay.portal.model.BackgroundTask fetchBackgroundTask(
207                    long backgroundTaskId);
208    
209            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
210            public com.liferay.portal.model.BackgroundTask fetchFirstBackgroundTask(
211                    long groupId, java.lang.String taskExecutorClassName,
212                    boolean completed,
213                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.BackgroundTask> orderByComparator);
214    
215            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
216            public com.liferay.portal.model.BackgroundTask fetchFirstBackgroundTask(
217                    java.lang.String taskExecutorClassName, int status);
218    
219            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
220            public com.liferay.portal.model.BackgroundTask fetchFirstBackgroundTask(
221                    java.lang.String taskExecutorClassName, int status,
222                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.BackgroundTask> orderByComparator);
223    
224            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
225            public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery();
226    
227            /**
228            * Returns the background task with the primary key.
229            *
230            * @param backgroundTaskId the primary key of the background task
231            * @return the background task
232            * @throws PortalException if a background task with the primary key could not be found
233            */
234            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
235            public com.liferay.portal.model.BackgroundTask getBackgroundTask(
236                    long backgroundTaskId)
237                    throws com.liferay.portal.kernel.exception.PortalException;
238    
239            @com.liferay.portal.kernel.cluster.Clusterable(onMaster = true)
240            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
241            public java.lang.String getBackgroundTaskStatusJSON(long backgroundTaskId);
242    
243            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
244            public java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
245                    long groupId, java.lang.String name,
246                    java.lang.String taskExecutorClassName, int start, int end,
247                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.BackgroundTask> orderByComparator);
248    
249            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
250            public java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
251                    long groupId, int status);
252    
253            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
254            public java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
255                    long groupId, java.lang.String taskExecutorClassName);
256    
257            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
258            public java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
259                    long groupId, java.lang.String taskExecutorClassName, int start,
260                    int end,
261                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.BackgroundTask> orderByComparator);
262    
263            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
264            public java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
265                    long groupId, java.lang.String taskExecutorClassName, int status);
266    
267            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
268            public java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
269                    long groupId, java.lang.String[] taskExecutorClassNames);
270    
271            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
272            public java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
273                    long groupId, java.lang.String[] taskExecutorClassNames, int start,
274                    int end,
275                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.BackgroundTask> orderByComparator);
276    
277            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
278            public java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
279                    long groupId, java.lang.String[] taskExecutorClassNames, int status);
280    
281            /**
282            * Returns a range of all the background tasks.
283            *
284            * <p>
285            * 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.
286            * </p>
287            *
288            * @param start the lower bound of the range of background tasks
289            * @param end the upper bound of the range of background tasks (not inclusive)
290            * @return the range of background tasks
291            */
292            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
293            public java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
294                    int start, int end);
295    
296            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
297            public java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
298                    java.lang.String taskExecutorClassName, int status);
299    
300            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
301            public java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
302                    java.lang.String taskExecutorClassName, int status, int start, int end,
303                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.BackgroundTask> orderByComparator);
304    
305            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
306            public java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
307                    java.lang.String[] taskExecutorClassNames, int status);
308    
309            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
310            public java.util.List<com.liferay.portal.model.BackgroundTask> getBackgroundTasks(
311                    java.lang.String[] taskExecutorClassNames, int status, int start,
312                    int end,
313                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.BackgroundTask> orderByComparator);
314    
315            /**
316            * Returns the number of background tasks.
317            *
318            * @return the number of background tasks
319            */
320            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
321            public int getBackgroundTasksCount();
322    
323            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
324            public int getBackgroundTasksCount(long groupId, java.lang.String name,
325                    java.lang.String taskExecutorClassName);
326    
327            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
328            public int getBackgroundTasksCount(long groupId, java.lang.String name,
329                    java.lang.String taskExecutorClassName, boolean completed);
330    
331            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
332            public int getBackgroundTasksCount(long groupId,
333                    java.lang.String taskExecutorClassName);
334    
335            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
336            public int getBackgroundTasksCount(long groupId,
337                    java.lang.String taskExecutorClassName, boolean completed);
338    
339            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
340            public int getBackgroundTasksCount(long groupId,
341                    java.lang.String[] taskExecutorClassNames);
342    
343            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
344            public int getBackgroundTasksCount(long groupId,
345                    java.lang.String[] taskExecutorClassNames, boolean completed);
346    
347            /**
348            * Returns the Spring bean ID for this bean.
349            *
350            * @return the Spring bean ID for this bean
351            */
352            public java.lang.String getBeanIdentifier();
353    
354            @Override
355            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
356            public com.liferay.portal.model.PersistedModel getPersistedModel(
357                    java.io.Serializable primaryKeyObj)
358                    throws com.liferay.portal.kernel.exception.PortalException;
359    
360            @com.liferay.portal.kernel.cluster.Clusterable(onMaster = true)
361            public void resumeBackgroundTask(long backgroundTaskId);
362    
363            /**
364            * Sets the Spring bean ID for this bean.
365            *
366            * @param beanIdentifier the Spring bean ID for this bean
367            */
368            public void setBeanIdentifier(java.lang.String beanIdentifier);
369    
370            @com.liferay.portal.kernel.cluster.Clusterable(onMaster = true)
371            public void triggerBackgroundTask(long backgroundTaskId);
372    
373            /**
374            * Updates the background task in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
375            *
376            * @param backgroundTask the background task
377            * @return the background task that was updated
378            */
379            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
380            public com.liferay.portal.model.BackgroundTask updateBackgroundTask(
381                    com.liferay.portal.model.BackgroundTask backgroundTask);
382    }