001    /**
002     * Copyright (c) 2000-2012 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.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the resource block permission local service. This utility wraps {@link com.liferay.portal.service.impl.ResourceBlockPermissionLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
023     *
024     * <p>
025     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
026     * </p>
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            * @throws PortalException if a resource block permission with the primary key could not be found
071            * @throws SystemException if a system exception occurred
072            */
073            public static void deleteResourceBlockPermission(
074                    long resourceBlockPermissionId)
075                    throws com.liferay.portal.kernel.exception.PortalException,
076                            com.liferay.portal.kernel.exception.SystemException {
077                    getService().deleteResourceBlockPermission(resourceBlockPermissionId);
078            }
079    
080            /**
081            * Deletes the resource block permission from the database. Also notifies the appropriate model listeners.
082            *
083            * @param resourceBlockPermission the resource block permission
084            * @throws SystemException if a system exception occurred
085            */
086            public static void deleteResourceBlockPermission(
087                    com.liferay.portal.model.ResourceBlockPermission resourceBlockPermission)
088                    throws com.liferay.portal.kernel.exception.SystemException {
089                    getService().deleteResourceBlockPermission(resourceBlockPermission);
090            }
091    
092            /**
093            * Performs a dynamic query on the database and returns the matching rows.
094            *
095            * @param dynamicQuery the dynamic query
096            * @return the matching rows
097            * @throws SystemException if a system exception occurred
098            */
099            @SuppressWarnings("rawtypes")
100            public static java.util.List dynamicQuery(
101                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
102                    throws com.liferay.portal.kernel.exception.SystemException {
103                    return getService().dynamicQuery(dynamicQuery);
104            }
105    
106            /**
107            * Performs a dynamic query on the database and returns a range of the matching rows.
108            *
109            * <p>
110            * 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.
111            * </p>
112            *
113            * @param dynamicQuery the dynamic query
114            * @param start the lower bound of the range of model instances
115            * @param end the upper bound of the range of model instances (not inclusive)
116            * @return the range of matching rows
117            * @throws SystemException if a system exception occurred
118            */
119            @SuppressWarnings("rawtypes")
120            public static java.util.List dynamicQuery(
121                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
122                    int end) throws com.liferay.portal.kernel.exception.SystemException {
123                    return getService().dynamicQuery(dynamicQuery, start, end);
124            }
125    
126            /**
127            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
128            *
129            * <p>
130            * 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.
131            * </p>
132            *
133            * @param dynamicQuery the dynamic query
134            * @param start the lower bound of the range of model instances
135            * @param end the upper bound of the range of model instances (not inclusive)
136            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
137            * @return the ordered range of matching rows
138            * @throws SystemException if a system exception occurred
139            */
140            @SuppressWarnings("rawtypes")
141            public static java.util.List dynamicQuery(
142                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
143                    int end,
144                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
145                    throws com.liferay.portal.kernel.exception.SystemException {
146                    return getService()
147                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
148            }
149    
150            /**
151            * Returns the number of rows that match the dynamic query.
152            *
153            * @param dynamicQuery the dynamic query
154            * @return the number of rows that match the dynamic query
155            * @throws SystemException if a system exception occurred
156            */
157            public static long dynamicQueryCount(
158                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
159                    throws com.liferay.portal.kernel.exception.SystemException {
160                    return getService().dynamicQueryCount(dynamicQuery);
161            }
162    
163            public static com.liferay.portal.model.ResourceBlockPermission fetchResourceBlockPermission(
164                    long resourceBlockPermissionId)
165                    throws com.liferay.portal.kernel.exception.SystemException {
166                    return getService()
167                                       .fetchResourceBlockPermission(resourceBlockPermissionId);
168            }
169    
170            /**
171            * Returns the resource block permission with the primary key.
172            *
173            * @param resourceBlockPermissionId the primary key of the resource block permission
174            * @return the resource block permission
175            * @throws PortalException if a resource block permission with the primary key could not be found
176            * @throws SystemException if a system exception occurred
177            */
178            public static com.liferay.portal.model.ResourceBlockPermission getResourceBlockPermission(
179                    long resourceBlockPermissionId)
180                    throws com.liferay.portal.kernel.exception.PortalException,
181                            com.liferay.portal.kernel.exception.SystemException {
182                    return getService().getResourceBlockPermission(resourceBlockPermissionId);
183            }
184    
185            public static com.liferay.portal.model.PersistedModel getPersistedModel(
186                    java.io.Serializable primaryKeyObj)
187                    throws com.liferay.portal.kernel.exception.PortalException,
188                            com.liferay.portal.kernel.exception.SystemException {
189                    return getService().getPersistedModel(primaryKeyObj);
190            }
191    
192            /**
193            * Returns a range of all the resource block permissions.
194            *
195            * <p>
196            * 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.
197            * </p>
198            *
199            * @param start the lower bound of the range of resource block permissions
200            * @param end the upper bound of the range of resource block permissions (not inclusive)
201            * @return the range of resource block permissions
202            * @throws SystemException if a system exception occurred
203            */
204            public static java.util.List<com.liferay.portal.model.ResourceBlockPermission> getResourceBlockPermissions(
205                    int start, int end)
206                    throws com.liferay.portal.kernel.exception.SystemException {
207                    return getService().getResourceBlockPermissions(start, end);
208            }
209    
210            /**
211            * Returns the number of resource block permissions.
212            *
213            * @return the number of resource block permissions
214            * @throws SystemException if a system exception occurred
215            */
216            public static int getResourceBlockPermissionsCount()
217                    throws com.liferay.portal.kernel.exception.SystemException {
218                    return getService().getResourceBlockPermissionsCount();
219            }
220    
221            /**
222            * Updates the resource block permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
223            *
224            * @param resourceBlockPermission the resource block permission
225            * @return the resource block permission that was updated
226            * @throws SystemException if a system exception occurred
227            */
228            public static com.liferay.portal.model.ResourceBlockPermission updateResourceBlockPermission(
229                    com.liferay.portal.model.ResourceBlockPermission resourceBlockPermission)
230                    throws com.liferay.portal.kernel.exception.SystemException {
231                    return getService()
232                                       .updateResourceBlockPermission(resourceBlockPermission);
233            }
234    
235            /**
236            * Updates the resource block permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
237            *
238            * @param resourceBlockPermission the resource block permission
239            * @param merge whether to merge the resource block permission with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
240            * @return the resource block permission that was updated
241            * @throws SystemException if a system exception occurred
242            */
243            public static com.liferay.portal.model.ResourceBlockPermission updateResourceBlockPermission(
244                    com.liferay.portal.model.ResourceBlockPermission resourceBlockPermission,
245                    boolean merge)
246                    throws com.liferay.portal.kernel.exception.SystemException {
247                    return getService()
248                                       .updateResourceBlockPermission(resourceBlockPermission, merge);
249            }
250    
251            /**
252            * Returns the Spring bean ID for this bean.
253            *
254            * @return the Spring bean ID for this bean
255            */
256            public static java.lang.String getBeanIdentifier() {
257                    return getService().getBeanIdentifier();
258            }
259    
260            /**
261            * Sets the Spring bean ID for this bean.
262            *
263            * @param beanIdentifier the Spring bean ID for this bean
264            */
265            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
266                    getService().setBeanIdentifier(beanIdentifier);
267            }
268    
269            public static void addResourceBlockPermissions(long resourceBlockId,
270                    com.liferay.portal.model.ResourceBlockPermissionsContainer resourceBlockPermissionsContainer)
271                    throws com.liferay.portal.kernel.exception.SystemException {
272                    getService()
273                            .addResourceBlockPermissions(resourceBlockId,
274                            resourceBlockPermissionsContainer);
275            }
276    
277            public static void deleteResourceBlockPermissions(long resourceBlockId)
278                    throws com.liferay.portal.kernel.exception.SystemException {
279                    getService().deleteResourceBlockPermissions(resourceBlockId);
280            }
281    
282            public static com.liferay.portal.model.ResourceBlockPermissionsContainer getResourceBlockPermissionsContainer(
283                    long resourceBlockId)
284                    throws com.liferay.portal.kernel.exception.SystemException {
285                    return getService().getResourceBlockPermissionsContainer(resourceBlockId);
286            }
287    
288            public static void updateResourceBlockPermission(long resourceBlockId,
289                    long roleId, long actionIdsLong, int operator)
290                    throws com.liferay.portal.kernel.exception.SystemException {
291                    getService()
292                            .updateResourceBlockPermission(resourceBlockId, roleId,
293                            actionIdsLong, operator);
294            }
295    
296            public static ResourceBlockPermissionLocalService getService() {
297                    if (_service == null) {
298                            _service = (ResourceBlockPermissionLocalService)PortalBeanLocatorUtil.locate(ResourceBlockPermissionLocalService.class.getName());
299    
300                            ReferenceRegistry.registerReference(ResourceBlockPermissionLocalServiceUtil.class,
301                                    "_service");
302                            MethodCache.remove(ResourceBlockPermissionLocalService.class);
303                    }
304    
305                    return _service;
306            }
307    
308            public void setService(ResourceBlockPermissionLocalService service) {
309                    MethodCache.remove(ResourceBlockPermissionLocalService.class);
310    
311                    _service = service;
312    
313                    ReferenceRegistry.registerReference(ResourceBlockPermissionLocalServiceUtil.class,
314                            "_service");
315                    MethodCache.remove(ResourceBlockPermissionLocalService.class);
316            }
317    
318            private static ResourceBlockPermissionLocalService _service;
319    }