001    /**
002     * Copyright (c) 2000-present 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 Shard. This utility wraps
024     * {@link com.liferay.portal.service.impl.ShardLocalServiceImpl} 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 ShardLocalService
032     * @see com.liferay.portal.service.base.ShardLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.ShardLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class ShardLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.ShardLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043            public static com.liferay.portal.model.Shard addShard(
044                    java.lang.String className, long classPK, java.lang.String name) {
045                    return getService().addShard(className, classPK, name);
046            }
047    
048            /**
049            * Adds the shard to the database. Also notifies the appropriate model listeners.
050            *
051            * @param shard the shard
052            * @return the shard that was added
053            */
054            public static com.liferay.portal.model.Shard addShard(
055                    com.liferay.portal.model.Shard shard) {
056                    return getService().addShard(shard);
057            }
058    
059            /**
060            * Creates a new shard with the primary key. Does not add the shard to the database.
061            *
062            * @param shardId the primary key for the new shard
063            * @return the new shard
064            */
065            public static com.liferay.portal.model.Shard createShard(long shardId) {
066                    return getService().createShard(shardId);
067            }
068    
069            /**
070            * @throws PortalException
071            */
072            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
073                    com.liferay.portal.model.PersistedModel persistedModel)
074                    throws com.liferay.portal.kernel.exception.PortalException {
075                    return getService().deletePersistedModel(persistedModel);
076            }
077    
078            /**
079            * Deletes the shard from the database. Also notifies the appropriate model listeners.
080            *
081            * @param shard the shard
082            * @return the shard that was removed
083            */
084            public static com.liferay.portal.model.Shard deleteShard(
085                    com.liferay.portal.model.Shard shard) {
086                    return getService().deleteShard(shard);
087            }
088    
089            /**
090            * Deletes the shard with the primary key from the database. Also notifies the appropriate model listeners.
091            *
092            * @param shardId the primary key of the shard
093            * @return the shard that was removed
094            * @throws PortalException if a shard with the primary key could not be found
095            */
096            public static com.liferay.portal.model.Shard deleteShard(long shardId)
097                    throws com.liferay.portal.kernel.exception.PortalException {
098                    return getService().deleteShard(shardId);
099            }
100    
101            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
102                    return getService().dynamicQuery();
103            }
104    
105            /**
106            * Performs a dynamic query on the database and returns the matching rows.
107            *
108            * @param dynamicQuery the dynamic query
109            * @return the matching rows
110            */
111            public static <T> java.util.List<T> dynamicQuery(
112                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
113                    return getService().dynamicQuery(dynamicQuery);
114            }
115    
116            /**
117            * Performs a dynamic query on the database and returns a range of the matching rows.
118            *
119            * <p>
120            * 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.ShardModelImpl}. 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.
121            * </p>
122            *
123            * @param dynamicQuery the dynamic query
124            * @param start the lower bound of the range of model instances
125            * @param end the upper bound of the range of model instances (not inclusive)
126            * @return the range of matching rows
127            */
128            public static <T> java.util.List<T> dynamicQuery(
129                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
130                    int end) {
131                    return getService().dynamicQuery(dynamicQuery, start, end);
132            }
133    
134            /**
135            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
136            *
137            * <p>
138            * 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.ShardModelImpl}. 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.
139            * </p>
140            *
141            * @param dynamicQuery the dynamic query
142            * @param start the lower bound of the range of model instances
143            * @param end the upper bound of the range of model instances (not inclusive)
144            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
145            * @return the ordered range of matching rows
146            */
147            public static <T> java.util.List<T> dynamicQuery(
148                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
149                    int end,
150                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
151                    return getService()
152                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
153            }
154    
155            /**
156            * Returns the number of rows matching the dynamic query.
157            *
158            * @param dynamicQuery the dynamic query
159            * @return the number of rows matching the dynamic query
160            */
161            public static long dynamicQueryCount(
162                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
163                    return getService().dynamicQueryCount(dynamicQuery);
164            }
165    
166            /**
167            * Returns the number of rows matching the dynamic query.
168            *
169            * @param dynamicQuery the dynamic query
170            * @param projection the projection to apply to the query
171            * @return the number of rows matching the dynamic query
172            */
173            public static long dynamicQueryCount(
174                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
175                    com.liferay.portal.kernel.dao.orm.Projection projection) {
176                    return getService().dynamicQueryCount(dynamicQuery, projection);
177            }
178    
179            public static com.liferay.portal.model.Shard fetchShard(long shardId) {
180                    return getService().fetchShard(shardId);
181            }
182    
183            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
184                    return getService().getActionableDynamicQuery();
185            }
186    
187            /**
188            * Returns the Spring bean ID for this bean.
189            *
190            * @return the Spring bean ID for this bean
191            */
192            public static java.lang.String getBeanIdentifier() {
193                    return getService().getBeanIdentifier();
194            }
195    
196            public static com.liferay.portal.model.PersistedModel getPersistedModel(
197                    java.io.Serializable primaryKeyObj)
198                    throws com.liferay.portal.kernel.exception.PortalException {
199                    return getService().getPersistedModel(primaryKeyObj);
200            }
201    
202            public static com.liferay.portal.model.Shard getShard(
203                    java.lang.String className, long classPK)
204                    throws com.liferay.portal.kernel.exception.PortalException {
205                    return getService().getShard(className, classPK);
206            }
207    
208            /**
209            * Returns the shard with the primary key.
210            *
211            * @param shardId the primary key of the shard
212            * @return the shard
213            * @throws PortalException if a shard with the primary key could not be found
214            */
215            public static com.liferay.portal.model.Shard getShard(long shardId)
216                    throws com.liferay.portal.kernel.exception.PortalException {
217                    return getService().getShard(shardId);
218            }
219    
220            /**
221            * Returns a range of all the shards.
222            *
223            * <p>
224            * 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.ShardModelImpl}. 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.
225            * </p>
226            *
227            * @param start the lower bound of the range of shards
228            * @param end the upper bound of the range of shards (not inclusive)
229            * @return the range of shards
230            */
231            public static java.util.List<com.liferay.portal.model.Shard> getShards(
232                    int start, int end) {
233                    return getService().getShards(start, end);
234            }
235    
236            /**
237            * Returns the number of shards.
238            *
239            * @return the number of shards
240            */
241            public static int getShardsCount() {
242                    return getService().getShardsCount();
243            }
244    
245            /**
246            * Sets the Spring bean ID for this bean.
247            *
248            * @param beanIdentifier the Spring bean ID for this bean
249            */
250            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
251                    getService().setBeanIdentifier(beanIdentifier);
252            }
253    
254            /**
255            * Updates the shard in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
256            *
257            * @param shard the shard
258            * @return the shard that was updated
259            */
260            public static com.liferay.portal.model.Shard updateShard(
261                    com.liferay.portal.model.Shard shard) {
262                    return getService().updateShard(shard);
263            }
264    
265            public static ShardLocalService getService() {
266                    if (_service == null) {
267                            _service = (ShardLocalService)PortalBeanLocatorUtil.locate(ShardLocalService.class.getName());
268    
269                            ReferenceRegistry.registerReference(ShardLocalServiceUtil.class,
270                                    "_service");
271                    }
272    
273                    return _service;
274            }
275    
276            /**
277             * @deprecated As of 6.2.0
278             */
279            @Deprecated
280            public void setService(ShardLocalService service) {
281            }
282    
283            private static ShardLocalService _service;
284    }