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.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.transaction.Isolation;
020    import com.liferay.portal.kernel.transaction.Propagation;
021    import com.liferay.portal.kernel.transaction.Transactional;
022    
023    /**
024     * Provides the local service interface for Lock. Methods of this
025     * service will not have security checks based on the propagated JAAS
026     * credentials because this service can only be accessed from within the same
027     * VM.
028     *
029     * @author Brian Wing Shun Chan
030     * @see LockLocalServiceUtil
031     * @see com.liferay.portal.service.base.LockLocalServiceBaseImpl
032     * @see com.liferay.portal.service.impl.LockLocalServiceImpl
033     * @generated
034     */
035    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
036            PortalException.class, SystemException.class})
037    public interface LockLocalService extends BaseLocalService,
038            PersistedModelLocalService {
039            /*
040             * NOTE FOR DEVELOPERS:
041             *
042             * Never modify or reference this interface directly. Always use {@link LockLocalServiceUtil} to access the lock local service. Add custom service methods to {@link com.liferay.portal.service.impl.LockLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
043             */
044    
045            /**
046            * Adds the lock to the database. Also notifies the appropriate model listeners.
047            *
048            * @param lock the lock
049            * @return the lock that was added
050            * @throws SystemException if a system exception occurred
051            */
052            public com.liferay.portal.model.Lock addLock(
053                    com.liferay.portal.model.Lock lock)
054                    throws com.liferay.portal.kernel.exception.SystemException;
055    
056            /**
057            * Creates a new lock with the primary key. Does not add the lock to the database.
058            *
059            * @param lockId the primary key for the new lock
060            * @return the new lock
061            */
062            public com.liferay.portal.model.Lock createLock(long lockId);
063    
064            /**
065            * Deletes the lock with the primary key from the database. Also notifies the appropriate model listeners.
066            *
067            * @param lockId the primary key of the lock
068            * @return the lock that was removed
069            * @throws PortalException if a lock with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public com.liferay.portal.model.Lock deleteLock(long lockId)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException;
075    
076            /**
077            * Deletes the lock from the database. Also notifies the appropriate model listeners.
078            *
079            * @param lock the lock
080            * @return the lock that was removed
081            * @throws SystemException if a system exception occurred
082            */
083            public com.liferay.portal.model.Lock deleteLock(
084                    com.liferay.portal.model.Lock lock)
085                    throws com.liferay.portal.kernel.exception.SystemException;
086    
087            public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
088    
089            /**
090            * Performs a dynamic query on the database and returns the matching rows.
091            *
092            * @param dynamicQuery the dynamic query
093            * @return the matching rows
094            * @throws SystemException if a system exception occurred
095            */
096            @SuppressWarnings("rawtypes")
097            public java.util.List dynamicQuery(
098                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
099                    throws com.liferay.portal.kernel.exception.SystemException;
100    
101            /**
102            * Performs a dynamic query on the database and returns a range of the matching rows.
103            *
104            * <p>
105            * 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.LockModelImpl}. 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.
106            * </p>
107            *
108            * @param dynamicQuery the dynamic query
109            * @param start the lower bound of the range of model instances
110            * @param end the upper bound of the range of model instances (not inclusive)
111            * @return the range of matching rows
112            * @throws SystemException if a system exception occurred
113            */
114            @SuppressWarnings("rawtypes")
115            public java.util.List dynamicQuery(
116                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
117                    int end) throws com.liferay.portal.kernel.exception.SystemException;
118    
119            /**
120            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
121            *
122            * <p>
123            * 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.LockModelImpl}. 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.
124            * </p>
125            *
126            * @param dynamicQuery the dynamic query
127            * @param start the lower bound of the range of model instances
128            * @param end the upper bound of the range of model instances (not inclusive)
129            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
130            * @return the ordered range of matching rows
131            * @throws SystemException if a system exception occurred
132            */
133            @SuppressWarnings("rawtypes")
134            public java.util.List dynamicQuery(
135                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
136                    int end,
137                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
138                    throws com.liferay.portal.kernel.exception.SystemException;
139    
140            /**
141            * Returns the number of rows that match the dynamic query.
142            *
143            * @param dynamicQuery the dynamic query
144            * @return the number of rows that match the dynamic query
145            * @throws SystemException if a system exception occurred
146            */
147            public long dynamicQueryCount(
148                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
149                    throws com.liferay.portal.kernel.exception.SystemException;
150    
151            /**
152            * Returns the number of rows that match the dynamic query.
153            *
154            * @param dynamicQuery the dynamic query
155            * @param projection the projection to apply to the query
156            * @return the number of rows that match the dynamic query
157            * @throws SystemException if a system exception occurred
158            */
159            public long dynamicQueryCount(
160                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
161                    com.liferay.portal.kernel.dao.orm.Projection projection)
162                    throws com.liferay.portal.kernel.exception.SystemException;
163    
164            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
165            public com.liferay.portal.model.Lock fetchLock(long lockId)
166                    throws com.liferay.portal.kernel.exception.SystemException;
167    
168            /**
169            * Returns the lock with the matching UUID and company.
170            *
171            * @param uuid the lock's UUID
172            * @param companyId the primary key of the company
173            * @return the matching lock, or <code>null</code> if a matching lock could not be found
174            * @throws SystemException if a system exception occurred
175            */
176            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
177            public com.liferay.portal.model.Lock fetchLockByUuidAndCompanyId(
178                    java.lang.String uuid, long companyId)
179                    throws com.liferay.portal.kernel.exception.SystemException;
180    
181            /**
182            * Returns the lock with the primary key.
183            *
184            * @param lockId the primary key of the lock
185            * @return the lock
186            * @throws PortalException if a lock with the primary key could not be found
187            * @throws SystemException if a system exception occurred
188            */
189            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
190            public com.liferay.portal.model.Lock getLock(long lockId)
191                    throws com.liferay.portal.kernel.exception.PortalException,
192                            com.liferay.portal.kernel.exception.SystemException;
193    
194            @Override
195            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
196            public com.liferay.portal.model.PersistedModel getPersistedModel(
197                    java.io.Serializable primaryKeyObj)
198                    throws com.liferay.portal.kernel.exception.PortalException,
199                            com.liferay.portal.kernel.exception.SystemException;
200    
201            /**
202            * Returns the lock with the matching UUID and company.
203            *
204            * @param uuid the lock's UUID
205            * @param companyId the primary key of the company
206            * @return the matching lock
207            * @throws PortalException if a matching lock could not be found
208            * @throws SystemException if a system exception occurred
209            */
210            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
211            public com.liferay.portal.model.Lock getLockByUuidAndCompanyId(
212                    java.lang.String uuid, long companyId)
213                    throws com.liferay.portal.kernel.exception.PortalException,
214                            com.liferay.portal.kernel.exception.SystemException;
215    
216            /**
217            * Returns a range of all the locks.
218            *
219            * <p>
220            * 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.LockModelImpl}. 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.
221            * </p>
222            *
223            * @param start the lower bound of the range of locks
224            * @param end the upper bound of the range of locks (not inclusive)
225            * @return the range of locks
226            * @throws SystemException if a system exception occurred
227            */
228            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
229            public java.util.List<com.liferay.portal.model.Lock> getLocks(int start,
230                    int end) throws com.liferay.portal.kernel.exception.SystemException;
231    
232            /**
233            * Returns the number of locks.
234            *
235            * @return the number of locks
236            * @throws SystemException if a system exception occurred
237            */
238            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
239            public int getLocksCount()
240                    throws com.liferay.portal.kernel.exception.SystemException;
241    
242            /**
243            * Updates the lock in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
244            *
245            * @param lock the lock
246            * @return the lock that was updated
247            * @throws SystemException if a system exception occurred
248            */
249            public com.liferay.portal.model.Lock updateLock(
250                    com.liferay.portal.model.Lock lock)
251                    throws com.liferay.portal.kernel.exception.SystemException;
252    
253            /**
254            * Returns the Spring bean ID for this bean.
255            *
256            * @return the Spring bean ID for this bean
257            */
258            public java.lang.String getBeanIdentifier();
259    
260            /**
261            * Sets the Spring bean ID for this bean.
262            *
263            * @param beanIdentifier the Spring bean ID for this bean
264            */
265            public void setBeanIdentifier(java.lang.String beanIdentifier);
266    
267            public void clear()
268                    throws com.liferay.portal.kernel.exception.SystemException;
269    
270            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
271            public com.liferay.portal.model.Lock getLock(java.lang.String className,
272                    long key)
273                    throws com.liferay.portal.kernel.exception.PortalException,
274                            com.liferay.portal.kernel.exception.SystemException;
275    
276            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
277            public com.liferay.portal.model.Lock getLock(java.lang.String className,
278                    java.lang.String key)
279                    throws com.liferay.portal.kernel.exception.PortalException,
280                            com.liferay.portal.kernel.exception.SystemException;
281    
282            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
283            public boolean hasLock(long userId, java.lang.String className, long key)
284                    throws com.liferay.portal.kernel.exception.SystemException;
285    
286            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
287            public boolean hasLock(long userId, java.lang.String className,
288                    java.lang.String key)
289                    throws com.liferay.portal.kernel.exception.SystemException;
290    
291            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
292            public boolean isLocked(java.lang.String className, long key)
293                    throws com.liferay.portal.kernel.exception.SystemException;
294    
295            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
296            public boolean isLocked(java.lang.String className, java.lang.String key)
297                    throws com.liferay.portal.kernel.exception.SystemException;
298    
299            public com.liferay.portal.model.Lock lock(long userId,
300                    java.lang.String className, long key, java.lang.String owner,
301                    boolean inheritable, long expirationTime)
302                    throws com.liferay.portal.kernel.exception.PortalException,
303                            com.liferay.portal.kernel.exception.SystemException;
304    
305            public com.liferay.portal.model.Lock lock(long userId,
306                    java.lang.String className, java.lang.String key,
307                    java.lang.String owner, boolean inheritable, long expirationTime)
308                    throws com.liferay.portal.kernel.exception.PortalException,
309                            com.liferay.portal.kernel.exception.SystemException;
310    
311            public com.liferay.portal.model.Lock lock(java.lang.String className,
312                    java.lang.String key, java.lang.String owner)
313                    throws com.liferay.portal.kernel.exception.SystemException;
314    
315            /**
316            * @deprecated As of 6.2.0, replaced by {@link #lock(String, String,
317            String)}
318            */
319            public com.liferay.portal.model.Lock lock(java.lang.String className,
320                    java.lang.String key, java.lang.String owner, boolean retrieveFromCache)
321                    throws com.liferay.portal.kernel.exception.SystemException;
322    
323            public com.liferay.portal.model.Lock lock(java.lang.String className,
324                    java.lang.String key, java.lang.String expectedOwner,
325                    java.lang.String updatedOwner)
326                    throws com.liferay.portal.kernel.exception.SystemException;
327    
328            /**
329            * @deprecated As of 6.2.0, replaced by {@link #lock(String, String, String,
330            String)}
331            */
332            public com.liferay.portal.model.Lock lock(java.lang.String className,
333                    java.lang.String key, java.lang.String expectedOwner,
334                    java.lang.String updatedOwner, boolean retrieveFromCache)
335                    throws com.liferay.portal.kernel.exception.SystemException;
336    
337            public com.liferay.portal.model.Lock refresh(java.lang.String uuid,
338                    long companyId, long expirationTime)
339                    throws com.liferay.portal.kernel.exception.PortalException,
340                            com.liferay.portal.kernel.exception.SystemException;
341    
342            public void unlock(java.lang.String className, long key)
343                    throws com.liferay.portal.kernel.exception.SystemException;
344    
345            public void unlock(java.lang.String className, java.lang.String key)
346                    throws com.liferay.portal.kernel.exception.SystemException;
347    
348            public void unlock(java.lang.String className, java.lang.String key,
349                    java.lang.String owner)
350                    throws com.liferay.portal.kernel.exception.SystemException;
351    
352            /**
353            * @deprecated As of 6.2.0, replaced by {@link #unlock(String, String,
354            String)}
355            */
356            public void unlock(java.lang.String className, java.lang.String key,
357                    java.lang.String owner, boolean retrieveFromCache)
358                    throws com.liferay.portal.kernel.exception.SystemException;
359    }