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