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