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.trash.kernel.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
020    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
021    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
022    import com.liferay.portal.kernel.dao.orm.Projection;
023    import com.liferay.portal.kernel.exception.PortalException;
024    import com.liferay.portal.kernel.exception.SystemException;
025    import com.liferay.portal.kernel.model.PersistedModel;
026    import com.liferay.portal.kernel.search.BaseModelSearchResult;
027    import com.liferay.portal.kernel.search.Hits;
028    import com.liferay.portal.kernel.search.Indexable;
029    import com.liferay.portal.kernel.search.IndexableType;
030    import com.liferay.portal.kernel.search.Sort;
031    import com.liferay.portal.kernel.service.BaseLocalService;
032    import com.liferay.portal.kernel.service.PersistedModelLocalService;
033    import com.liferay.portal.kernel.transaction.Isolation;
034    import com.liferay.portal.kernel.transaction.Propagation;
035    import com.liferay.portal.kernel.transaction.Transactional;
036    import com.liferay.portal.kernel.util.ObjectValuePair;
037    import com.liferay.portal.kernel.util.OrderByComparator;
038    import com.liferay.portal.kernel.util.UnicodeProperties;
039    
040    import com.liferay.trash.kernel.model.TrashEntry;
041    
042    import java.io.Serializable;
043    
044    import java.util.List;
045    
046    /**
047     * Provides the local service interface for TrashEntry. Methods of this
048     * service will not have security checks based on the propagated JAAS
049     * credentials because this service can only be accessed from within the same
050     * VM.
051     *
052     * @author Brian Wing Shun Chan
053     * @see TrashEntryLocalServiceUtil
054     * @see com.liferay.portlet.trash.service.base.TrashEntryLocalServiceBaseImpl
055     * @see com.liferay.portlet.trash.service.impl.TrashEntryLocalServiceImpl
056     * @generated
057     */
058    @ProviderType
059    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
060            PortalException.class, SystemException.class})
061    public interface TrashEntryLocalService extends BaseLocalService,
062            PersistedModelLocalService {
063            /*
064             * NOTE FOR DEVELOPERS:
065             *
066             * Never modify or reference this interface directly. Always use {@link TrashEntryLocalServiceUtil} to access the trash entry local service. Add custom service methods to {@link com.liferay.portlet.trash.service.impl.TrashEntryLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
067             */
068            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
069            public ActionableDynamicQuery getActionableDynamicQuery();
070    
071            public DynamicQuery dynamicQuery();
072    
073            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
074            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
075    
076            /**
077            * @throws PortalException
078            */
079            @Override
080            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
081                    throws PortalException;
082    
083            @Override
084            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
085            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
086                    throws PortalException;
087    
088            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
089            public BaseModelSearchResult<TrashEntry> searchTrashEntries(
090                    long companyId, long groupId, long userId, java.lang.String keywords,
091                    int start, int end, Sort sort);
092    
093            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
094            public Hits search(long companyId, long groupId, long userId,
095                    java.lang.String keywords, int start, int end, Sort sort);
096    
097            /**
098            * Adds the trash entry to the database. Also notifies the appropriate model listeners.
099            *
100            * @param trashEntry the trash entry
101            * @return the trash entry that was added
102            */
103            @Indexable(type = IndexableType.REINDEX)
104            public TrashEntry addTrashEntry(TrashEntry trashEntry);
105    
106            /**
107            * Moves an entry to trash.
108            *
109            * @param userId the primary key of the user removing the entity
110            * @param groupId the primary key of the entry's group
111            * @param className the class name of the entity
112            * @param classPK the primary key of the entity
113            * @param classUuid the UUID of the entity's class
114            * @param referrerClassName the referrer class name used to add a deletion
115            {@link SystemEvent}
116            * @param status the status of the entity prior to being moved to trash
117            * @param statusOVPs the primary keys and statuses of any of the entry's
118            versions (e.g., {@link
119            com.liferay.portlet.documentlibrary.model.DLFileVersion})
120            * @param typeSettingsProperties the type settings properties
121            * @return the trashEntry
122            */
123            public TrashEntry addTrashEntry(long userId, long groupId,
124                    java.lang.String className, long classPK, java.lang.String classUuid,
125                    java.lang.String referrerClassName, int status,
126                    List<ObjectValuePair<java.lang.Long, java.lang.Integer>> statusOVPs,
127                    UnicodeProperties typeSettingsProperties) throws PortalException;
128    
129            /**
130            * Creates a new trash entry with the primary key. Does not add the trash entry to the database.
131            *
132            * @param entryId the primary key for the new trash entry
133            * @return the new trash entry
134            */
135            public TrashEntry createTrashEntry(long entryId);
136    
137            @Indexable(type = IndexableType.DELETE)
138            public TrashEntry deleteEntry(TrashEntry trashEntry);
139    
140            /**
141            * Deletes the trash entry with the entity class name and primary key.
142            *
143            * @param className the class name of entity
144            * @param classPK the primary key of the entry
145            * @return the trash entry with the entity class name and primary key
146            */
147            public TrashEntry deleteEntry(java.lang.String className, long classPK);
148    
149            /**
150            * Deletes the trash entry with the primary key.
151            *
152            * @param entryId the primary key of the trash entry
153            * @return the trash entry with the primary key
154            */
155            public TrashEntry deleteEntry(long entryId);
156    
157            /**
158            * Deletes the trash entry from the database. Also notifies the appropriate model listeners.
159            *
160            * @param trashEntry the trash entry
161            * @return the trash entry that was removed
162            */
163            @Indexable(type = IndexableType.DELETE)
164            public TrashEntry deleteTrashEntry(TrashEntry trashEntry);
165    
166            /**
167            * Deletes the trash entry with the primary key from the database. Also notifies the appropriate model listeners.
168            *
169            * @param entryId the primary key of the trash entry
170            * @return the trash entry that was removed
171            * @throws PortalException if a trash entry with the primary key could not be found
172            */
173            @Indexable(type = IndexableType.DELETE)
174            public TrashEntry deleteTrashEntry(long entryId) throws PortalException;
175    
176            /**
177            * Returns the trash entry with the entity class name and primary key.
178            *
179            * @param className the class name of the entity
180            * @param classPK the primary key of the entity
181            * @return the trash entry with the entity class name and primary key
182            */
183            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
184            public TrashEntry fetchEntry(java.lang.String className, long classPK);
185    
186            /**
187            * Returns the trash entry with the primary key.
188            *
189            * @param entryId the primary key of the entry
190            * @return the trash entry with the primary key
191            */
192            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
193            public TrashEntry fetchEntry(long entryId);
194    
195            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
196            public TrashEntry fetchTrashEntry(long entryId);
197    
198            /**
199            * Returns the entry with the entity class name and primary key.
200            *
201            * @param className the class name of the entity
202            * @param classPK the primary key of the entity
203            * @return the trash entry with the entity class name and primary key
204            */
205            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
206            public TrashEntry getEntry(java.lang.String className, long classPK)
207                    throws PortalException;
208    
209            /**
210            * Returns the trash entry with the primary key.
211            *
212            * @param entryId the primary key of the trash entry
213            * @return the trash entry with the primary key
214            */
215            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
216            public TrashEntry getEntry(long entryId) throws PortalException;
217    
218            /**
219            * Returns the trash entry with the primary key.
220            *
221            * @param entryId the primary key of the trash entry
222            * @return the trash entry
223            * @throws PortalException if a trash entry with the primary key could not be found
224            */
225            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
226            public TrashEntry getTrashEntry(long entryId) throws PortalException;
227    
228            /**
229            * Updates the trash entry in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
230            *
231            * @param trashEntry the trash entry
232            * @return the trash entry that was updated
233            */
234            @Indexable(type = IndexableType.REINDEX)
235            public TrashEntry updateTrashEntry(TrashEntry trashEntry);
236    
237            /**
238            * Returns the number of trash entries with the group ID.
239            *
240            * @param groupId the primary key of the group
241            * @return the number of matching trash entries
242            */
243            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
244            public int getEntriesCount(long groupId);
245    
246            /**
247            * Returns the number of trash entries.
248            *
249            * @return the number of trash entries
250            */
251            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
252            public int getTrashEntriesCount();
253    
254            /**
255            * Returns the OSGi service identifier.
256            *
257            * @return the OSGi service identifier
258            */
259            public java.lang.String getOSGiServiceIdentifier();
260    
261            /**
262            * Performs a dynamic query on the database and returns the matching rows.
263            *
264            * @param dynamicQuery the dynamic query
265            * @return the matching rows
266            */
267            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
268    
269            /**
270            * Performs a dynamic query on the database and returns a range of the matching rows.
271            *
272            * <p>
273            * 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.portlet.trash.model.impl.TrashEntryModelImpl}. 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.
274            * </p>
275            *
276            * @param dynamicQuery the dynamic query
277            * @param start the lower bound of the range of model instances
278            * @param end the upper bound of the range of model instances (not inclusive)
279            * @return the range of matching rows
280            */
281            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
282                    int end);
283    
284            /**
285            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
286            *
287            * <p>
288            * 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.portlet.trash.model.impl.TrashEntryModelImpl}. 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.
289            * </p>
290            *
291            * @param dynamicQuery the dynamic query
292            * @param start the lower bound of the range of model instances
293            * @param end the upper bound of the range of model instances (not inclusive)
294            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
295            * @return the ordered range of matching rows
296            */
297            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
298                    int end, OrderByComparator<T> orderByComparator);
299    
300            /**
301            * Returns the trash entries with the matching group ID.
302            *
303            * @param groupId the primary key of the group
304            * @return the trash entries with the group ID
305            */
306            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
307            public List<TrashEntry> getEntries(long groupId);
308    
309            /**
310            * Returns a range of all the trash entries matching the group ID.
311            *
312            * @param groupId the primary key of the group
313            * @param start the lower bound of the range of trash entries to return
314            * @param end the upper bound of the range of trash entries to return (not
315            inclusive)
316            * @return the range of matching trash entries
317            */
318            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
319            public List<TrashEntry> getEntries(long groupId, int start, int end);
320    
321            /**
322            * Returns a range of all the trash entries matching the group ID.
323            *
324            * @param groupId the primary key of the group
325            * @param start the lower bound of the range of trash entries to return
326            * @param end the upper bound of the range of trash entries to return (not
327            inclusive)
328            * @param obc the comparator to order the trash entries (optionally
329            <code>null</code>)
330            * @return the range of matching trash entries ordered by comparator
331            <code>obc</code>
332            */
333            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
334            public List<TrashEntry> getEntries(long groupId, int start, int end,
335                    OrderByComparator<TrashEntry> obc);
336    
337            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
338            public List<TrashEntry> getEntries(long groupId, java.lang.String className);
339    
340            /**
341            * Returns a range of all the trash entries.
342            *
343            * <p>
344            * 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.portlet.trash.model.impl.TrashEntryModelImpl}. 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.
345            * </p>
346            *
347            * @param start the lower bound of the range of trash entries
348            * @param end the upper bound of the range of trash entries (not inclusive)
349            * @return the range of trash entries
350            */
351            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
352            public List<TrashEntry> getTrashEntries(int start, int end);
353    
354            /**
355            * Returns the number of rows matching the dynamic query.
356            *
357            * @param dynamicQuery the dynamic query
358            * @return the number of rows matching the dynamic query
359            */
360            public long dynamicQueryCount(DynamicQuery dynamicQuery);
361    
362            /**
363            * Returns the number of rows matching the dynamic query.
364            *
365            * @param dynamicQuery the dynamic query
366            * @param projection the projection to apply to the query
367            * @return the number of rows matching the dynamic query
368            */
369            public long dynamicQueryCount(DynamicQuery dynamicQuery,
370                    Projection projection);
371    
372            public void checkEntries() throws PortalException;
373    
374            public void deleteEntries(long groupId);
375    }