1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.service;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  import com.liferay.portal.kernel.util.MethodCache;
19  import com.liferay.portal.kernel.util.ReferenceRegistry;
20  
21  /**
22   * <a href="ShardLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
23   *
24   * <p>
25   * ServiceBuilder generated this class. Modifications in this class will be
26   * overwritten the next time is generated.
27   * </p>
28   *
29   * <p>
30   * This class provides static methods for the
31   * {@link ShardLocalService} bean. The static methods of
32   * this class calls the same methods of the bean instance. It's convenient to be
33   * able to just write one line to call a method on a bean instead of writing a
34   * lookup call and a method call.
35   * </p>
36   *
37   * @author    Brian Wing Shun Chan
38   * @see       ShardLocalService
39   * @generated
40   */
41  public class ShardLocalServiceUtil {
42      public static com.liferay.portal.model.Shard addShard(
43          com.liferay.portal.model.Shard shard)
44          throws com.liferay.portal.SystemException {
45          return getService().addShard(shard);
46      }
47  
48      public static com.liferay.portal.model.Shard createShard(long shardId) {
49          return getService().createShard(shardId);
50      }
51  
52      public static void deleteShard(long shardId)
53          throws com.liferay.portal.PortalException,
54              com.liferay.portal.SystemException {
55          getService().deleteShard(shardId);
56      }
57  
58      public static void deleteShard(com.liferay.portal.model.Shard shard)
59          throws com.liferay.portal.SystemException {
60          getService().deleteShard(shard);
61      }
62  
63      @SuppressWarnings("rawtypes")
64      public static java.util.List dynamicQuery(
65          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
66          throws com.liferay.portal.SystemException {
67          return getService().dynamicQuery(dynamicQuery);
68      }
69  
70      @SuppressWarnings("rawtypes")
71      public static java.util.List dynamicQuery(
72          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
73          int end) throws com.liferay.portal.SystemException {
74          return getService().dynamicQuery(dynamicQuery, start, end);
75      }
76  
77      @SuppressWarnings("rawtypes")
78      public static java.util.List dynamicQuery(
79          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
80          int end,
81          com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
82          throws com.liferay.portal.SystemException {
83          return getService()
84                     .dynamicQuery(dynamicQuery, start, end, orderByComparator);
85      }
86  
87      public static int dynamicQueryCount(
88          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
89          throws com.liferay.portal.SystemException {
90          return getService().dynamicQueryCount(dynamicQuery);
91      }
92  
93      public static com.liferay.portal.model.Shard getShard(long shardId)
94          throws com.liferay.portal.PortalException,
95              com.liferay.portal.SystemException {
96          return getService().getShard(shardId);
97      }
98  
99      public static java.util.List<com.liferay.portal.model.Shard> getShards(
100         int start, int end) throws com.liferay.portal.SystemException {
101         return getService().getShards(start, end);
102     }
103 
104     public static int getShardsCount()
105         throws com.liferay.portal.SystemException {
106         return getService().getShardsCount();
107     }
108 
109     public static com.liferay.portal.model.Shard updateShard(
110         com.liferay.portal.model.Shard shard)
111         throws com.liferay.portal.SystemException {
112         return getService().updateShard(shard);
113     }
114 
115     public static com.liferay.portal.model.Shard updateShard(
116         com.liferay.portal.model.Shard shard, boolean merge)
117         throws com.liferay.portal.SystemException {
118         return getService().updateShard(shard, merge);
119     }
120 
121     public static com.liferay.portal.model.Shard addShard(
122         java.lang.String className, long classPK, java.lang.String name)
123         throws com.liferay.portal.SystemException {
124         return getService().addShard(className, classPK, name);
125     }
126 
127     public static com.liferay.portal.model.Shard getShard(
128         java.lang.String className, long classPK)
129         throws com.liferay.portal.PortalException,
130             com.liferay.portal.SystemException {
131         return getService().getShard(className, classPK);
132     }
133 
134     public static ShardLocalService getService() {
135         if (_service == null) {
136             _service = (ShardLocalService)PortalBeanLocatorUtil.locate(ShardLocalService.class.getName());
137 
138             ReferenceRegistry.registerReference(ShardLocalServiceUtil.class,
139                 "_service");
140             MethodCache.remove(ShardLocalService.class);
141         }
142 
143         return _service;
144     }
145 
146     public void setService(ShardLocalService service) {
147         MethodCache.remove(ShardLocalService.class);
148 
149         _service = service;
150 
151         ReferenceRegistry.registerReference(ShardLocalServiceUtil.class,
152             "_service");
153         MethodCache.remove(ShardLocalService.class);
154     }
155 
156     private static ShardLocalService _service;
157 }