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  
26  /**
27   * <a href="LockLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * <p>
35   * This class provides static methods for the
36   * {@link LockLocalService} bean. The static methods of
37   * this class calls the same methods of the bean instance. It's convenient to be
38   * able to just write one line to call a method on a bean instead of writing a
39   * lookup call and a method call.
40   * </p>
41   *
42   * @author    Brian Wing Shun Chan
43   * @see       LockLocalService
44   * @generated
45   */
46  public class LockLocalServiceUtil {
47      public static com.liferay.portal.model.Lock addLock(
48          com.liferay.portal.model.Lock lock)
49          throws com.liferay.portal.SystemException {
50          return getService().addLock(lock);
51      }
52  
53      public static com.liferay.portal.model.Lock createLock(long lockId) {
54          return getService().createLock(lockId);
55      }
56  
57      public static void deleteLock(long lockId)
58          throws com.liferay.portal.PortalException,
59              com.liferay.portal.SystemException {
60          getService().deleteLock(lockId);
61      }
62  
63      public static void deleteLock(com.liferay.portal.model.Lock lock)
64          throws com.liferay.portal.SystemException {
65          getService().deleteLock(lock);
66      }
67  
68      public static java.util.List<Object> dynamicQuery(
69          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
70          throws com.liferay.portal.SystemException {
71          return getService().dynamicQuery(dynamicQuery);
72      }
73  
74      public static java.util.List<Object> dynamicQuery(
75          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
76          int end) throws com.liferay.portal.SystemException {
77          return getService().dynamicQuery(dynamicQuery, start, end);
78      }
79  
80      public static com.liferay.portal.model.Lock getLock(long lockId)
81          throws com.liferay.portal.PortalException,
82              com.liferay.portal.SystemException {
83          return getService().getLock(lockId);
84      }
85  
86      public static java.util.List<com.liferay.portal.model.Lock> getLocks(
87          int start, int end) throws com.liferay.portal.SystemException {
88          return getService().getLocks(start, end);
89      }
90  
91      public static int getLocksCount() throws com.liferay.portal.SystemException {
92          return getService().getLocksCount();
93      }
94  
95      public static com.liferay.portal.model.Lock updateLock(
96          com.liferay.portal.model.Lock lock)
97          throws com.liferay.portal.SystemException {
98          return getService().updateLock(lock);
99      }
100 
101     public static com.liferay.portal.model.Lock updateLock(
102         com.liferay.portal.model.Lock lock, boolean merge)
103         throws com.liferay.portal.SystemException {
104         return getService().updateLock(lock, merge);
105     }
106 
107     public static void clear() throws com.liferay.portal.SystemException {
108         getService().clear();
109     }
110 
111     public static com.liferay.portal.model.Lock getLock(
112         java.lang.String className, long key)
113         throws com.liferay.portal.PortalException,
114             com.liferay.portal.SystemException {
115         return getService().getLock(className, key);
116     }
117 
118     public static com.liferay.portal.model.Lock getLock(
119         java.lang.String className, java.lang.String key)
120         throws com.liferay.portal.PortalException,
121             com.liferay.portal.SystemException {
122         return getService().getLock(className, key);
123     }
124 
125     public static boolean hasLock(long userId, java.lang.String className,
126         long key)
127         throws com.liferay.portal.PortalException,
128             com.liferay.portal.SystemException {
129         return getService().hasLock(userId, className, key);
130     }
131 
132     public static boolean hasLock(long userId, java.lang.String className,
133         java.lang.String key)
134         throws com.liferay.portal.PortalException,
135             com.liferay.portal.SystemException {
136         return getService().hasLock(userId, className, key);
137     }
138 
139     public static boolean isLocked(java.lang.String className, long key)
140         throws com.liferay.portal.PortalException,
141             com.liferay.portal.SystemException {
142         return getService().isLocked(className, key);
143     }
144 
145     public static boolean isLocked(java.lang.String className,
146         java.lang.String key)
147         throws com.liferay.portal.PortalException,
148             com.liferay.portal.SystemException {
149         return getService().isLocked(className, key);
150     }
151 
152     public static com.liferay.portal.model.Lock lock(long userId,
153         java.lang.String className, long key, java.lang.String owner,
154         boolean inheritable, long expirationTime)
155         throws com.liferay.portal.PortalException,
156             com.liferay.portal.SystemException {
157         return getService()
158                    .lock(userId, className, key, owner, inheritable,
159             expirationTime);
160     }
161 
162     public static com.liferay.portal.model.Lock lock(long userId,
163         java.lang.String className, java.lang.String key,
164         java.lang.String owner, boolean inheritable, long expirationTime)
165         throws com.liferay.portal.PortalException,
166             com.liferay.portal.SystemException {
167         return getService()
168                    .lock(userId, className, key, owner, inheritable,
169             expirationTime);
170     }
171 
172     public static com.liferay.portal.model.Lock refresh(java.lang.String uuid,
173         long expirationTime)
174         throws com.liferay.portal.PortalException,
175             com.liferay.portal.SystemException {
176         return getService().refresh(uuid, expirationTime);
177     }
178 
179     public static void unlock(java.lang.String className, long key)
180         throws com.liferay.portal.SystemException {
181         getService().unlock(className, key);
182     }
183 
184     public static void unlock(java.lang.String className, java.lang.String key)
185         throws com.liferay.portal.SystemException {
186         getService().unlock(className, key);
187     }
188 
189     public static LockLocalService getService() {
190         if (_service == null) {
191             throw new RuntimeException("LockLocalService is not set");
192         }
193 
194         return _service;
195     }
196 
197     public void setService(LockLocalService service) {
198         _service = service;
199     }
200 
201     private static LockLocalService _service;
202 }