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