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