1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service;
24  
25  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
26  
27  /**
28   * <a href="LockLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
29   *
30   * <p>
31   * ServiceBuilder generated this class. Modifications in this class will be
32   * overwritten the next time is generated.
33   * </p>
34   *
35   * <p>
36   * This class provides static methods for the
37   * {@link LockLocalService} bean. The static methods of
38   * this class calls the same methods of the bean instance. It's convenient to be
39   * able to just write one line to call a method on a bean instead of writing a
40   * lookup call and a method call.
41   * </p>
42   *
43   * @author    Brian Wing Shun Chan
44   * @see       LockLocalService
45   * @generated
46   */
47  public class LockLocalServiceUtil {
48      public static com.liferay.portal.model.Lock addLock(
49          com.liferay.portal.model.Lock lock)
50          throws com.liferay.portal.SystemException {
51          return getService().addLock(lock);
52      }
53  
54      public static com.liferay.portal.model.Lock createLock(long lockId) {
55          return getService().createLock(lockId);
56      }
57  
58      public static void deleteLock(long lockId)
59          throws com.liferay.portal.PortalException,
60              com.liferay.portal.SystemException {
61          getService().deleteLock(lockId);
62      }
63  
64      public static void deleteLock(com.liferay.portal.model.Lock lock)
65          throws com.liferay.portal.SystemException {
66          getService().deleteLock(lock);
67      }
68  
69      public static java.util.List<Object> dynamicQuery(
70          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
71          throws com.liferay.portal.SystemException {
72          return getService().dynamicQuery(dynamicQuery);
73      }
74  
75      public static java.util.List<Object> dynamicQuery(
76          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
77          int end) throws com.liferay.portal.SystemException {
78          return getService().dynamicQuery(dynamicQuery, start, end);
79      }
80  
81      public static com.liferay.portal.model.Lock getLock(long lockId)
82          throws com.liferay.portal.PortalException,
83              com.liferay.portal.SystemException {
84          return getService().getLock(lockId);
85      }
86  
87      public static java.util.List<com.liferay.portal.model.Lock> getLocks(
88          int start, int end) throws com.liferay.portal.SystemException {
89          return getService().getLocks(start, end);
90      }
91  
92      public static int getLocksCount() throws com.liferay.portal.SystemException {
93          return getService().getLocksCount();
94      }
95  
96      public static com.liferay.portal.model.Lock updateLock(
97          com.liferay.portal.model.Lock lock)
98          throws com.liferay.portal.SystemException {
99          return getService().updateLock(lock);
100     }
101 
102     public static com.liferay.portal.model.Lock updateLock(
103         com.liferay.portal.model.Lock lock, boolean merge)
104         throws com.liferay.portal.SystemException {
105         return getService().updateLock(lock, merge);
106     }
107 
108     public static void clear() throws com.liferay.portal.SystemException {
109         getService().clear();
110     }
111 
112     public static com.liferay.portal.model.Lock getLock(
113         java.lang.String className, long key)
114         throws com.liferay.portal.PortalException,
115             com.liferay.portal.SystemException {
116         return getService().getLock(className, key);
117     }
118 
119     public static com.liferay.portal.model.Lock getLock(
120         java.lang.String className, java.lang.String key)
121         throws com.liferay.portal.PortalException,
122             com.liferay.portal.SystemException {
123         return getService().getLock(className, key);
124     }
125 
126     public static boolean hasLock(long userId, java.lang.String className,
127         long key)
128         throws com.liferay.portal.PortalException,
129             com.liferay.portal.SystemException {
130         return getService().hasLock(userId, className, key);
131     }
132 
133     public static boolean hasLock(long userId, java.lang.String className,
134         java.lang.String key)
135         throws com.liferay.portal.PortalException,
136             com.liferay.portal.SystemException {
137         return getService().hasLock(userId, className, key);
138     }
139 
140     public static boolean isLocked(java.lang.String className, long key)
141         throws com.liferay.portal.PortalException,
142             com.liferay.portal.SystemException {
143         return getService().isLocked(className, key);
144     }
145 
146     public static boolean isLocked(java.lang.String className,
147         java.lang.String key)
148         throws com.liferay.portal.PortalException,
149             com.liferay.portal.SystemException {
150         return getService().isLocked(className, key);
151     }
152 
153     public static com.liferay.portal.model.Lock lock(long userId,
154         java.lang.String className, long key, java.lang.String owner,
155         boolean inheritable, long expirationTime)
156         throws com.liferay.portal.PortalException,
157             com.liferay.portal.SystemException {
158         return getService()
159                    .lock(userId, className, key, owner, inheritable,
160             expirationTime);
161     }
162 
163     public static com.liferay.portal.model.Lock lock(long userId,
164         java.lang.String className, java.lang.String key,
165         java.lang.String owner, boolean inheritable, long expirationTime)
166         throws com.liferay.portal.PortalException,
167             com.liferay.portal.SystemException {
168         return getService()
169                    .lock(userId, className, key, owner, inheritable,
170             expirationTime);
171     }
172 
173     public static com.liferay.portal.model.Lock refresh(java.lang.String uuid,
174         long expirationTime)
175         throws com.liferay.portal.PortalException,
176             com.liferay.portal.SystemException {
177         return getService().refresh(uuid, expirationTime);
178     }
179 
180     public static void unlock(java.lang.String className, long key)
181         throws com.liferay.portal.SystemException {
182         getService().unlock(className, key);
183     }
184 
185     public static void unlock(java.lang.String className, java.lang.String key)
186         throws com.liferay.portal.SystemException {
187         getService().unlock(className, key);
188     }
189 
190     public static LockLocalService getService() {
191         if (_service == null) {
192             _service = (LockLocalService)PortalBeanLocatorUtil.locate(LockLocalService.class.getName());
193         }
194 
195         return _service;
196     }
197 
198     public void setService(LockLocalService service) {
199         _service = service;
200     }
201 
202     private static LockLocalService _service;
203 }