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.portlet.trash.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.jsonwebservice.JSONWebService;
022    import com.liferay.portal.kernel.security.access.control.AccessControlled;
023    import com.liferay.portal.kernel.transaction.Isolation;
024    import com.liferay.portal.kernel.transaction.Propagation;
025    import com.liferay.portal.kernel.transaction.Transactional;
026    import com.liferay.portal.service.BaseService;
027    
028    /**
029     * Provides the remote service interface for TrashEntry. Methods of this
030     * service are expected to have security checks based on the propagated JAAS
031     * credentials because this service can be accessed remotely.
032     *
033     * @author Brian Wing Shun Chan
034     * @see TrashEntryServiceUtil
035     * @see com.liferay.portlet.trash.service.base.TrashEntryServiceBaseImpl
036     * @see com.liferay.portlet.trash.service.impl.TrashEntryServiceImpl
037     * @generated
038     */
039    @AccessControlled
040    @JSONWebService
041    @ProviderType
042    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
043            PortalException.class, SystemException.class})
044    public interface TrashEntryService extends BaseService {
045            /*
046             * NOTE FOR DEVELOPERS:
047             *
048             * Never modify or reference this interface directly. Always use {@link TrashEntryServiceUtil} to access the trash entry remote service. Add custom service methods to {@link com.liferay.portlet.trash.service.impl.TrashEntryServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
049             */
050    
051            /**
052            * Deletes the trash entries with the primary keys.
053            *
054            * @param entryIds the primary keys of the trash entries
055            * @throws PortalException if a trash entry with the primary key could not
056            be found or if the user did not have permission to delete any one
057            of the trash entries
058            */
059            @Transactional(noRollbackFor =  {
060                    com.liferay.portal.TrashPermissionException.class}
061            )
062            public void deleteEntries(long[] entryIds) throws PortalException;
063    
064            /**
065            * Deletes the trash entries with the matching group ID considering
066            * permissions.
067            *
068            * @param groupId the primary key of the group
069            * @throws PortalException if a portal exception occurred
070            */
071            @Transactional(noRollbackFor =  {
072                    com.liferay.portal.TrashPermissionException.class}
073            )
074            public void deleteEntries(long groupId) throws PortalException;
075    
076            /**
077            * Deletes the trash entry with the entity class name and class primary key.
078            *
079            * <p>
080            * This method throws a {@link TrashPermissionException} with type {@link
081            * TrashPermissionException#DELETE} if the user did not have permission to
082            * delete the trash entry.
083            * </p>
084            *
085            * @param className the class name of the entity
086            * @param classPK the primary key of the entity
087            * @throws PortalException if a trash entry with the entity class name and
088            primary key could not be found or if the user did not have
089            permission to delete the entry
090            */
091            public void deleteEntry(java.lang.String className, long classPK)
092                    throws PortalException;
093    
094            /**
095            * Deletes the trash entry with the primary key.
096            *
097            * <p>
098            * This method throws a {@link TrashPermissionException} with type {@link
099            * TrashPermissionException#DELETE} if the user did not have permission to
100            * delete the trash entry.
101            * </p>
102            *
103            * @param entryId the primary key of the trash entry
104            * @throws PortalException if a trash entry with the primary key could not
105            be found or if the user did not have permission to delete the
106            trash entry
107            */
108            public void deleteEntry(long entryId) throws PortalException;
109    
110            /**
111            * Returns the Spring bean ID for this bean.
112            *
113            * @return the Spring bean ID for this bean
114            */
115            public java.lang.String getBeanIdentifier();
116    
117            /**
118            * Returns the trash entries with the matching group ID.
119            *
120            * @param groupId the primary key of the group
121            * @return the matching trash entries
122            * @throws PrincipalException if a principal exception occurred
123            */
124            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
125            public com.liferay.portlet.trash.model.TrashEntryList getEntries(
126                    long groupId)
127                    throws com.liferay.portal.security.auth.PrincipalException;
128    
129            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
130            public java.util.List<com.liferay.portlet.trash.model.TrashEntry> getEntries(
131                    long groupId, java.lang.String className)
132                    throws com.liferay.portal.security.auth.PrincipalException;
133    
134            /**
135            * Returns a range of all the trash entries matching the group ID.
136            *
137            * @param groupId the primary key of the group
138            * @param start the lower bound of the range of trash entries to return
139            * @param end the upper bound of the range of trash entries to return (not
140            inclusive)
141            * @param obc the comparator to order the trash entries (optionally
142            <code>null</code>)
143            * @return the range of matching trash entries ordered by comparator
144            <code>obc</code>
145            * @throws PrincipalException if a system exception occurred
146            */
147            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
148            public com.liferay.portlet.trash.model.TrashEntryList getEntries(
149                    long groupId, int start, int end,
150                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.trash.model.TrashEntry> obc)
151                    throws com.liferay.portal.security.auth.PrincipalException;
152    
153            /**
154            * Moves the trash entry with the entity class name and primary key,
155            * restoring it to a new location identified by the destination container
156            * model ID.
157            *
158            * <p>
159            * This method throws a {@link TrashPermissionException} if the user did not
160            * have the permission to perform one of the necessary operations. The
161            * exception is created with a type specific to the operation:
162            * </p>
163            *
164            * <ul>
165            * <li>
166            * {@link TrashPermissionException#MOVE} - if the user did not have
167            * permission to move the trash entry to the new
168            * destination
169            * </li>
170            * <li>
171            * {@link TrashPermissionException#RESTORE} - if the user did not have
172            * permission to restore the trash entry
173            * </li>
174            * </ul>
175            *
176            * @param className the class name of the entity
177            * @param classPK the primary key of the entity
178            * @param destinationContainerModelId the primary key of the new location
179            * @param serviceContext the service context to be applied (optionally
180            <code>null</code>)
181            * @throws PortalException if a matching trash entry could not be found, if
182            the user did not have permission to move the trash entry to the
183            new location, if the user did not have permission to restore the
184            trash entry, if a duplicate trash entry exists at the new
185            location, or if a portal exception occurred
186            */
187            public void moveEntry(java.lang.String className, long classPK,
188                    long destinationContainerModelId,
189                    com.liferay.portal.service.ServiceContext serviceContext)
190                    throws PortalException;
191    
192            public com.liferay.portlet.trash.model.TrashEntry restoreEntry(
193                    java.lang.String className, long classPK) throws PortalException;
194    
195            public com.liferay.portlet.trash.model.TrashEntry restoreEntry(
196                    java.lang.String className, long classPK, long overrideClassPK,
197                    java.lang.String name) throws PortalException;
198    
199            public com.liferay.portlet.trash.model.TrashEntry restoreEntry(long entryId)
200                    throws PortalException;
201    
202            /**
203            * Restores the trash entry to its original location. In order to handle a
204            * duplicate trash entry already existing at the original location, either
205            * pass in the primary key of the existing trash entry's entity to overwrite
206            * or pass in a new name to give to the trash entry being restored.
207            *
208            * <p>
209            * This method throws a {@link TrashPermissionException} if the user did not
210            * have the permission to perform one of the necessary operations. The
211            * exception is created with a type specific to the operation:
212            * </p>
213            *
214            * <ul>
215            * <li>
216            * {@link TrashPermissionException#RESTORE} - if the user did not have
217            * permission to restore the trash entry
218            * </li>
219            * <li>
220            * {@link TrashPermissionException#RESTORE_OVERWRITE} - if the user did not
221            * have permission to delete the existing trash entry
222            * </li>
223            * <li>
224            * {@link TrashPermissionException#RESTORE_RENAME} - if the user did not
225            * have permission to rename the trash entry
226            * </li>
227            * </ul>
228            *
229            * @param entryId the primary key of the trash entry to restore
230            * @param overrideClassPK the primary key of the entity to overwrite
231            (optionally <code>0</code>)
232            * @param name a new name to give to the trash entry being restored
233            (optionally <code>null</code>)
234            * @return the restored trash entry
235            * @throws PortalException if a matching trash entry could not be found, if
236            the user did not have permission to overwrite an existing trash
237            entry, to rename the trash entry being restored, or to restore
238            the trash entry in general
239            */
240            public com.liferay.portlet.trash.model.TrashEntry restoreEntry(
241                    long entryId, long overrideClassPK, java.lang.String name)
242                    throws PortalException;
243    
244            /**
245            * Sets the Spring bean ID for this bean.
246            *
247            * @param beanIdentifier the Spring bean ID for this bean
248            */
249            public void setBeanIdentifier(java.lang.String beanIdentifier);
250    }