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 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            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 block permission to the database. Also notifies the appropriate model listeners.
072            *
073            * @param resourceBlockPermission the resource block permission
074            * @return the resource block permission that was added
075            */
076            public static com.liferay.portal.kernel.model.ResourceBlockPermission addResourceBlockPermission(
077                    com.liferay.portal.kernel.model.ResourceBlockPermission resourceBlockPermission) {
078                    return getService().addResourceBlockPermission(resourceBlockPermission);
079            }
080    
081            /**
082            * Creates a new resource block permission with the primary key. Does not add the resource block permission to the database.
083            *
084            * @param resourceBlockPermissionId the primary key for the new resource block permission
085            * @return the new resource block permission
086            */
087            public static com.liferay.portal.kernel.model.ResourceBlockPermission createResourceBlockPermission(
088                    long resourceBlockPermissionId) {
089                    return getService()
090                                       .createResourceBlockPermission(resourceBlockPermissionId);
091            }
092    
093            /**
094            * Deletes the resource block permission from the database. Also notifies the appropriate model listeners.
095            *
096            * @param resourceBlockPermission the resource block permission
097            * @return the resource block permission that was removed
098            */
099            public static com.liferay.portal.kernel.model.ResourceBlockPermission deleteResourceBlockPermission(
100                    com.liferay.portal.kernel.model.ResourceBlockPermission resourceBlockPermission) {
101                    return getService()
102                                       .deleteResourceBlockPermission(resourceBlockPermission);
103            }
104    
105            /**
106            * Deletes the resource block permission with the primary key from the database. Also notifies the appropriate model listeners.
107            *
108            * @param resourceBlockPermissionId the primary key of the resource block permission
109            * @return the resource block permission that was removed
110            * @throws PortalException if a resource block permission with the primary key could not be found
111            */
112            public static com.liferay.portal.kernel.model.ResourceBlockPermission deleteResourceBlockPermission(
113                    long resourceBlockPermissionId)
114                    throws com.liferay.portal.kernel.exception.PortalException {
115                    return getService()
116                                       .deleteResourceBlockPermission(resourceBlockPermissionId);
117            }
118    
119            public static com.liferay.portal.kernel.model.ResourceBlockPermission fetchResourceBlockPermission(
120                    long resourceBlockPermissionId) {
121                    return getService()
122                                       .fetchResourceBlockPermission(resourceBlockPermissionId);
123            }
124    
125            /**
126            * Returns the resource block permission with the primary key.
127            *
128            * @param resourceBlockPermissionId the primary key of the resource block permission
129            * @return the resource block permission
130            * @throws PortalException if a resource block permission with the primary key could not be found
131            */
132            public static com.liferay.portal.kernel.model.ResourceBlockPermission getResourceBlockPermission(
133                    long resourceBlockPermissionId)
134                    throws com.liferay.portal.kernel.exception.PortalException {
135                    return getService().getResourceBlockPermission(resourceBlockPermissionId);
136            }
137    
138            /**
139            * Updates the resource block permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
140            *
141            * @param resourceBlockPermission the resource block permission
142            * @return the resource block permission that was updated
143            */
144            public static com.liferay.portal.kernel.model.ResourceBlockPermission updateResourceBlockPermission(
145                    com.liferay.portal.kernel.model.ResourceBlockPermission resourceBlockPermission) {
146                    return getService()
147                                       .updateResourceBlockPermission(resourceBlockPermission);
148            }
149    
150            public static com.liferay.portal.kernel.model.ResourceBlockPermissionsContainer getResourceBlockPermissionsContainer(
151                    long resourceBlockId) {
152                    return getService().getResourceBlockPermissionsContainer(resourceBlockId);
153            }
154    
155            /**
156            * Returns the number of resource block permissions.
157            *
158            * @return the number of resource block permissions
159            */
160            public static int getResourceBlockPermissionsCount() {
161                    return getService().getResourceBlockPermissionsCount();
162            }
163    
164            public static int getResourceBlockPermissionsCount(long resourceBlockId,
165                    long roleId) {
166                    return getService()
167                                       .getResourceBlockPermissionsCount(resourceBlockId, roleId);
168            }
169    
170            /**
171            * Returns the OSGi service identifier.
172            *
173            * @return the OSGi service identifier
174            */
175            public static java.lang.String getOSGiServiceIdentifier() {
176                    return getService().getOSGiServiceIdentifier();
177            }
178    
179            /**
180            * Performs a dynamic query on the database and returns the matching rows.
181            *
182            * @param dynamicQuery the dynamic query
183            * @return the matching rows
184            */
185            public static <T> java.util.List<T> dynamicQuery(
186                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
187                    return getService().dynamicQuery(dynamicQuery);
188            }
189    
190            /**
191            * Performs a dynamic query on the database and returns a range of the matching rows.
192            *
193            * <p>
194            * 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.
195            * </p>
196            *
197            * @param dynamicQuery the dynamic query
198            * @param start the lower bound of the range of model instances
199            * @param end the upper bound of the range of model instances (not inclusive)
200            * @return the range of matching rows
201            */
202            public static <T> java.util.List<T> dynamicQuery(
203                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
204                    int end) {
205                    return getService().dynamicQuery(dynamicQuery, start, end);
206            }
207    
208            /**
209            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
210            *
211            * <p>
212            * 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.
213            * </p>
214            *
215            * @param dynamicQuery the dynamic query
216            * @param start the lower bound of the range of model instances
217            * @param end the upper bound of the range of model instances (not inclusive)
218            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
219            * @return the ordered range of matching rows
220            */
221            public static <T> java.util.List<T> dynamicQuery(
222                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
223                    int end,
224                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
225                    return getService()
226                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
227            }
228    
229            /**
230            * Returns a range of all the resource block permissions.
231            *
232            * <p>
233            * 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.
234            * </p>
235            *
236            * @param start the lower bound of the range of resource block permissions
237            * @param end the upper bound of the range of resource block permissions (not inclusive)
238            * @return the range of resource block permissions
239            */
240            public static java.util.List<com.liferay.portal.kernel.model.ResourceBlockPermission> getResourceBlockPermissions(
241                    int start, int end) {
242                    return getService().getResourceBlockPermissions(start, end);
243            }
244    
245            public static java.util.Map<java.lang.Long, java.util.Set<java.lang.String>> getAvailableResourceBlockPermissionActionIds(
246                    java.lang.String name, long primKey,
247                    java.util.List<java.lang.String> actionIds)
248                    throws com.liferay.portal.kernel.exception.PortalException {
249                    return getService()
250                                       .getAvailableResourceBlockPermissionActionIds(name, primKey,
251                            actionIds);
252            }
253    
254            /**
255            * @deprecated As of 7.0.0, replaced by {@link
256            #getAvailableResourceBlockPermissionActionIds(String, long,
257            List)}
258            */
259            @Deprecated
260            public static java.util.Map<java.lang.Long, java.util.Set<java.lang.String>> getAvailableResourceBlockPermissionActionIds(
261                    long[] roleIds, java.lang.String name, long primKey,
262                    java.util.List<java.lang.String> actionIds)
263                    throws com.liferay.portal.kernel.exception.PortalException {
264                    return getService()
265                                       .getAvailableResourceBlockPermissionActionIds(roleIds, name,
266                            primKey, actionIds);
267            }
268    
269            /**
270            * Returns the number of rows matching the dynamic query.
271            *
272            * @param dynamicQuery the dynamic query
273            * @return the number of rows matching the dynamic query
274            */
275            public static long dynamicQueryCount(
276                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
277                    return getService().dynamicQueryCount(dynamicQuery);
278            }
279    
280            /**
281            * Returns the number of rows matching the dynamic query.
282            *
283            * @param dynamicQuery the dynamic query
284            * @param projection the projection to apply to the query
285            * @return the number of rows matching the dynamic query
286            */
287            public static long dynamicQueryCount(
288                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
289                    com.liferay.portal.kernel.dao.orm.Projection projection) {
290                    return getService().dynamicQueryCount(dynamicQuery, projection);
291            }
292    
293            public static void addResourceBlockPermissions(long resourceBlockId,
294                    com.liferay.portal.kernel.model.ResourceBlockPermissionsContainer resourceBlockPermissionsContainer) {
295                    getService()
296                            .addResourceBlockPermissions(resourceBlockId,
297                            resourceBlockPermissionsContainer);
298            }
299    
300            public static void deleteResourceBlockPermissions(long resourceBlockId) {
301                    getService().deleteResourceBlockPermissions(resourceBlockId);
302            }
303    
304            public static void updateResourceBlockPermission(long resourceBlockId,
305                    long roleId, long actionIdsLong, int operator) {
306                    getService()
307                            .updateResourceBlockPermission(resourceBlockId, roleId,
308                            actionIdsLong, operator);
309            }
310    
311            public static ResourceBlockPermissionLocalService getService() {
312                    if (_service == null) {
313                            _service = (ResourceBlockPermissionLocalService)PortalBeanLocatorUtil.locate(ResourceBlockPermissionLocalService.class.getName());
314    
315                            ReferenceRegistry.registerReference(ResourceBlockPermissionLocalServiceUtil.class,
316                                    "_service");
317                    }
318    
319                    return _service;
320            }
321    
322            private static ResourceBlockPermissionLocalService _service;
323    }