001    /**
002     * Copyright (c) 2000-2013 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 ResourceBlockPermission. This utility wraps
024     * {@link com.liferay.portal.service.impl.ResourceBlockPermissionLocalServiceImpl} 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 ResourceBlockPermissionLocalService
032     * @see com.liferay.portal.service.base.ResourceBlockPermissionLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.ResourceBlockPermissionLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class ResourceBlockPermissionLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.ResourceBlockPermissionLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043    
044            /**
045            * Adds the resource block permission to the database. Also notifies the appropriate model listeners.
046            *
047            * @param resourceBlockPermission the resource block permission
048            * @return the resource block permission that was added
049            * @throws SystemException if a system exception occurred
050            */
051            public static com.liferay.portal.model.ResourceBlockPermission addResourceBlockPermission(
052                    com.liferay.portal.model.ResourceBlockPermission resourceBlockPermission)
053                    throws com.liferay.portal.kernel.exception.SystemException {
054                    return getService().addResourceBlockPermission(resourceBlockPermission);
055            }
056    
057            /**
058            * Creates a new resource block permission with the primary key. Does not add the resource block permission to the database.
059            *
060            * @param resourceBlockPermissionId the primary key for the new resource block permission
061            * @return the new resource block permission
062            */
063            public static com.liferay.portal.model.ResourceBlockPermission createResourceBlockPermission(
064                    long resourceBlockPermissionId) {
065                    return getService()
066                                       .createResourceBlockPermission(resourceBlockPermissionId);
067            }
068    
069            /**
070            * Deletes the resource block permission with the primary key from the database. Also notifies the appropriate model listeners.
071            *
072            * @param resourceBlockPermissionId the primary key of the resource block permission
073            * @return the resource block permission that was removed
074            * @throws PortalException if a resource block permission with the primary key could not be found
075            * @throws SystemException if a system exception occurred
076            */
077            public static com.liferay.portal.model.ResourceBlockPermission deleteResourceBlockPermission(
078                    long resourceBlockPermissionId)
079                    throws com.liferay.portal.kernel.exception.PortalException,
080                            com.liferay.portal.kernel.exception.SystemException {
081                    return getService()
082                                       .deleteResourceBlockPermission(resourceBlockPermissionId);
083            }
084    
085            /**
086            * Deletes the resource block permission from the database. Also notifies the appropriate model listeners.
087            *
088            * @param resourceBlockPermission the resource block permission
089            * @return the resource block permission that was removed
090            * @throws SystemException if a system exception occurred
091            */
092            public static com.liferay.portal.model.ResourceBlockPermission deleteResourceBlockPermission(
093                    com.liferay.portal.model.ResourceBlockPermission resourceBlockPermission)
094                    throws com.liferay.portal.kernel.exception.SystemException {
095                    return getService()
096                                       .deleteResourceBlockPermission(resourceBlockPermission);
097            }
098    
099            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
100                    return getService().dynamicQuery();
101            }
102    
103            /**
104            * Performs a dynamic query on the database and returns the matching rows.
105            *
106            * @param dynamicQuery the dynamic query
107            * @return the matching rows
108            * @throws SystemException if a system exception occurred
109            */
110            @SuppressWarnings("rawtypes")
111            public static java.util.List dynamicQuery(
112                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
113                    throws com.liferay.portal.kernel.exception.SystemException {
114                    return getService().dynamicQuery(dynamicQuery);
115            }
116    
117            /**
118            * Performs a dynamic query on the database and returns a range of the matching rows.
119            *
120            * <p>
121            * 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.ResourceBlockPermissionModelImpl}. 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.
122            * </p>
123            *
124            * @param dynamicQuery the dynamic query
125            * @param start the lower bound of the range of model instances
126            * @param end the upper bound of the range of model instances (not inclusive)
127            * @return the range of matching rows
128            * @throws SystemException if a system exception occurred
129            */
130            @SuppressWarnings("rawtypes")
131            public static java.util.List dynamicQuery(
132                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
133                    int end) throws com.liferay.portal.kernel.exception.SystemException {
134                    return getService().dynamicQuery(dynamicQuery, start, end);
135            }
136    
137            /**
138            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
139            *
140            * <p>
141            * 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.ResourceBlockPermissionModelImpl}. 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.
142            * </p>
143            *
144            * @param dynamicQuery the dynamic query
145            * @param start the lower bound of the range of model instances
146            * @param end the upper bound of the range of model instances (not inclusive)
147            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
148            * @return the ordered range of matching rows
149            * @throws SystemException if a system exception occurred
150            */
151            @SuppressWarnings("rawtypes")
152            public static java.util.List dynamicQuery(
153                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
154                    int end,
155                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
156                    throws com.liferay.portal.kernel.exception.SystemException {
157                    return getService()
158                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
159            }
160    
161            /**
162            * Returns the number of rows that match the dynamic query.
163            *
164            * @param dynamicQuery the dynamic query
165            * @return the number of rows that match the dynamic query
166            * @throws SystemException if a system exception occurred
167            */
168            public static long dynamicQueryCount(
169                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
170                    throws com.liferay.portal.kernel.exception.SystemException {
171                    return getService().dynamicQueryCount(dynamicQuery);
172            }
173    
174            /**
175            * Returns the number of rows that match the dynamic query.
176            *
177            * @param dynamicQuery the dynamic query
178            * @param projection the projection to apply to the query
179            * @return the number of rows that match the dynamic query
180            * @throws SystemException if a system exception occurred
181            */
182            public static long dynamicQueryCount(
183                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
184                    com.liferay.portal.kernel.dao.orm.Projection projection)
185                    throws com.liferay.portal.kernel.exception.SystemException {
186                    return getService().dynamicQueryCount(dynamicQuery, projection);
187            }
188    
189            public static com.liferay.portal.model.ResourceBlockPermission fetchResourceBlockPermission(
190                    long resourceBlockPermissionId)
191                    throws com.liferay.portal.kernel.exception.SystemException {
192                    return getService()
193                                       .fetchResourceBlockPermission(resourceBlockPermissionId);
194            }
195    
196            /**
197            * Returns the resource block permission with the primary key.
198            *
199            * @param resourceBlockPermissionId the primary key of the resource block permission
200            * @return the resource block permission
201            * @throws PortalException if a resource block permission with the primary key could not be found
202            * @throws SystemException if a system exception occurred
203            */
204            public static com.liferay.portal.model.ResourceBlockPermission getResourceBlockPermission(
205                    long resourceBlockPermissionId)
206                    throws com.liferay.portal.kernel.exception.PortalException,
207                            com.liferay.portal.kernel.exception.SystemException {
208                    return getService().getResourceBlockPermission(resourceBlockPermissionId);
209            }
210    
211            public static com.liferay.portal.model.PersistedModel getPersistedModel(
212                    java.io.Serializable primaryKeyObj)
213                    throws com.liferay.portal.kernel.exception.PortalException,
214                            com.liferay.portal.kernel.exception.SystemException {
215                    return getService().getPersistedModel(primaryKeyObj);
216            }
217    
218            /**
219            * Returns a range of all the resource block permissions.
220            *
221            * <p>
222            * 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.ResourceBlockPermissionModelImpl}. 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.
223            * </p>
224            *
225            * @param start the lower bound of the range of resource block permissions
226            * @param end the upper bound of the range of resource block permissions (not inclusive)
227            * @return the range of resource block permissions
228            * @throws SystemException if a system exception occurred
229            */
230            public static java.util.List<com.liferay.portal.model.ResourceBlockPermission> getResourceBlockPermissions(
231                    int start, int end)
232                    throws com.liferay.portal.kernel.exception.SystemException {
233                    return getService().getResourceBlockPermissions(start, end);
234            }
235    
236            /**
237            * Returns the number of resource block permissions.
238            *
239            * @return the number of resource block permissions
240            * @throws SystemException if a system exception occurred
241            */
242            public static int getResourceBlockPermissionsCount()
243                    throws com.liferay.portal.kernel.exception.SystemException {
244                    return getService().getResourceBlockPermissionsCount();
245            }
246    
247            /**
248            * Updates the resource block permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
249            *
250            * @param resourceBlockPermission the resource block permission
251            * @return the resource block permission that was updated
252            * @throws SystemException if a system exception occurred
253            */
254            public static com.liferay.portal.model.ResourceBlockPermission updateResourceBlockPermission(
255                    com.liferay.portal.model.ResourceBlockPermission resourceBlockPermission)
256                    throws com.liferay.portal.kernel.exception.SystemException {
257                    return getService()
258                                       .updateResourceBlockPermission(resourceBlockPermission);
259            }
260    
261            /**
262            * Returns the Spring bean ID for this bean.
263            *
264            * @return the Spring bean ID for this bean
265            */
266            public static java.lang.String getBeanIdentifier() {
267                    return getService().getBeanIdentifier();
268            }
269    
270            /**
271            * Sets the Spring bean ID for this bean.
272            *
273            * @param beanIdentifier the Spring bean ID for this bean
274            */
275            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
276                    getService().setBeanIdentifier(beanIdentifier);
277            }
278    
279            public static void addResourceBlockPermissions(long resourceBlockId,
280                    com.liferay.portal.model.ResourceBlockPermissionsContainer resourceBlockPermissionsContainer)
281                    throws com.liferay.portal.kernel.exception.SystemException {
282                    getService()
283                            .addResourceBlockPermissions(resourceBlockId,
284                            resourceBlockPermissionsContainer);
285            }
286    
287            public static void deleteResourceBlockPermissions(long resourceBlockId)
288                    throws com.liferay.portal.kernel.exception.SystemException {
289                    getService().deleteResourceBlockPermissions(resourceBlockId);
290            }
291    
292            public static java.util.Map<java.lang.Long, java.util.Set<java.lang.String>> getAvailableResourceBlockPermissionActionIds(
293                    long[] roleIds, java.lang.String name, long primKey,
294                    java.util.List<java.lang.String> actionIds)
295                    throws com.liferay.portal.kernel.exception.PortalException,
296                            com.liferay.portal.kernel.exception.SystemException {
297                    return getService()
298                                       .getAvailableResourceBlockPermissionActionIds(roleIds, name,
299                            primKey, actionIds);
300            }
301    
302            public static com.liferay.portal.model.ResourceBlockPermissionsContainer getResourceBlockPermissionsContainer(
303                    long resourceBlockId)
304                    throws com.liferay.portal.kernel.exception.SystemException {
305                    return getService().getResourceBlockPermissionsContainer(resourceBlockId);
306            }
307    
308            public static int getResourceBlockPermissionsCount(long resourceBlockId,
309                    long roleId) throws com.liferay.portal.kernel.exception.SystemException {
310                    return getService()
311                                       .getResourceBlockPermissionsCount(resourceBlockId, roleId);
312            }
313    
314            public static void updateResourceBlockPermission(long resourceBlockId,
315                    long roleId, long actionIdsLong, int operator)
316                    throws com.liferay.portal.kernel.exception.SystemException {
317                    getService()
318                            .updateResourceBlockPermission(resourceBlockId, roleId,
319                            actionIdsLong, operator);
320            }
321    
322            public static ResourceBlockPermissionLocalService getService() {
323                    if (_service == null) {
324                            _service = (ResourceBlockPermissionLocalService)PortalBeanLocatorUtil.locate(ResourceBlockPermissionLocalService.class.getName());
325    
326                            ReferenceRegistry.registerReference(ResourceBlockPermissionLocalServiceUtil.class,
327                                    "_service");
328                    }
329    
330                    return _service;
331            }
332    
333            /**
334             * @deprecated As of 6.2.0
335             */
336            public void setService(ResourceBlockPermissionLocalService service) {
337            }
338    
339            private static ResourceBlockPermissionLocalService _service;
340    }