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.service; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery; 020 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 021 import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery; 022 import com.liferay.portal.kernel.dao.orm.Projection; 023 import com.liferay.portal.kernel.exception.PortalException; 024 import com.liferay.portal.kernel.exception.SystemException; 025 import com.liferay.portal.kernel.search.Indexable; 026 import com.liferay.portal.kernel.search.IndexableType; 027 import com.liferay.portal.kernel.transaction.Isolation; 028 import com.liferay.portal.kernel.transaction.Propagation; 029 import com.liferay.portal.kernel.transaction.Transactional; 030 import com.liferay.portal.kernel.util.OrderByComparator; 031 import com.liferay.portal.model.PersistedModel; 032 import com.liferay.portal.model.ResourceBlockPermission; 033 import com.liferay.portal.model.ResourceBlockPermissionsContainer; 034 035 import java.io.Serializable; 036 037 import java.util.List; 038 import java.util.Map; 039 import java.util.Set; 040 041 /** 042 * Provides the local service interface for ResourceBlockPermission. Methods of this 043 * service will not have security checks based on the propagated JAAS 044 * credentials because this service can only be accessed from within the same 045 * VM. 046 * 047 * @author Brian Wing Shun Chan 048 * @see ResourceBlockPermissionLocalServiceUtil 049 * @see com.liferay.portal.service.base.ResourceBlockPermissionLocalServiceBaseImpl 050 * @see com.liferay.portal.service.impl.ResourceBlockPermissionLocalServiceImpl 051 * @generated 052 */ 053 @ProviderType 054 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 055 PortalException.class, SystemException.class}) 056 public interface ResourceBlockPermissionLocalService extends BaseLocalService, 057 PermissionedModelLocalService { 058 /* 059 * NOTE FOR DEVELOPERS: 060 * 061 * Never modify or reference this interface directly. Always use {@link ResourceBlockPermissionLocalServiceUtil} to access the resource block permission local service. Add custom service methods to {@link com.liferay.portal.service.impl.ResourceBlockPermissionLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 062 */ 063 064 /** 065 * Adds the resource block permission to the database. Also notifies the appropriate model listeners. 066 * 067 * @param resourceBlockPermission the resource block permission 068 * @return the resource block permission that was added 069 */ 070 @Indexable(type = IndexableType.REINDEX) 071 public ResourceBlockPermission addResourceBlockPermission( 072 ResourceBlockPermission resourceBlockPermission); 073 074 public void addResourceBlockPermissions(long resourceBlockId, 075 ResourceBlockPermissionsContainer resourceBlockPermissionsContainer); 076 077 /** 078 * Creates a new resource block permission with the primary key. Does not add the resource block permission to the database. 079 * 080 * @param resourceBlockPermissionId the primary key for the new resource block permission 081 * @return the new resource block permission 082 */ 083 public ResourceBlockPermission createResourceBlockPermission( 084 long resourceBlockPermissionId); 085 086 /** 087 * @throws PortalException 088 */ 089 @Override 090 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 091 throws PortalException; 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 @Indexable(type = IndexableType.DELETE) 100 public ResourceBlockPermission deleteResourceBlockPermission( 101 ResourceBlockPermission resourceBlockPermission); 102 103 /** 104 * Deletes the resource block permission with the primary key from the database. Also notifies the appropriate model listeners. 105 * 106 * @param resourceBlockPermissionId the primary key of the resource block permission 107 * @return the resource block permission that was removed 108 * @throws PortalException if a resource block permission with the primary key could not be found 109 */ 110 @Indexable(type = IndexableType.DELETE) 111 public ResourceBlockPermission deleteResourceBlockPermission( 112 long resourceBlockPermissionId) throws PortalException; 113 114 public void deleteResourceBlockPermissions(long resourceBlockId); 115 116 public DynamicQuery dynamicQuery(); 117 118 /** 119 * Performs a dynamic query on the database and returns the matching rows. 120 * 121 * @param dynamicQuery the dynamic query 122 * @return the matching rows 123 */ 124 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 125 126 /** 127 * Performs a dynamic query on the database and returns a 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. 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. 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 * @return the range of matching rows 137 */ 138 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 139 int end); 140 141 /** 142 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 143 * 144 * <p> 145 * 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. 146 * </p> 147 * 148 * @param dynamicQuery the dynamic query 149 * @param start the lower bound of the range of model instances 150 * @param end the upper bound of the range of model instances (not inclusive) 151 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 152 * @return the ordered range of matching rows 153 */ 154 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 155 int end, OrderByComparator<T> orderByComparator); 156 157 /** 158 * Returns the number of rows matching the dynamic query. 159 * 160 * @param dynamicQuery the dynamic query 161 * @return the number of rows matching the dynamic query 162 */ 163 public long dynamicQueryCount(DynamicQuery dynamicQuery); 164 165 /** 166 * Returns the number of rows matching the dynamic query. 167 * 168 * @param dynamicQuery the dynamic query 169 * @param projection the projection to apply to the query 170 * @return the number of rows matching the dynamic query 171 */ 172 public long dynamicQueryCount(DynamicQuery dynamicQuery, 173 Projection projection); 174 175 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 176 public ResourceBlockPermission fetchResourceBlockPermission( 177 long resourceBlockPermissionId); 178 179 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 180 public ActionableDynamicQuery getActionableDynamicQuery(); 181 182 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 183 public Map<java.lang.Long, Set<java.lang.String>> getAvailableResourceBlockPermissionActionIds( 184 java.lang.String name, long primKey, List<java.lang.String> actionIds) 185 throws PortalException; 186 187 /** 188 * @deprecated As of 7.0.0, replaced by {@link 189 #getAvailableResourceBlockPermissionActionIds(String, long, 190 List)} 191 */ 192 @java.lang.Deprecated 193 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 194 public Map<java.lang.Long, Set<java.lang.String>> getAvailableResourceBlockPermissionActionIds( 195 long[] roleIds, java.lang.String name, long primKey, 196 List<java.lang.String> actionIds) throws PortalException; 197 198 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 199 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 200 201 /** 202 * Returns the OSGi service identifier. 203 * 204 * @return the OSGi service identifier 205 */ 206 public java.lang.String getOSGiServiceIdentifier(); 207 208 @Override 209 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 210 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 211 throws PortalException; 212 213 /** 214 * Returns the resource block permission with the primary key. 215 * 216 * @param resourceBlockPermissionId the primary key of the resource block permission 217 * @return the resource block permission 218 * @throws PortalException if a resource block permission with the primary key could not be found 219 */ 220 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 221 public ResourceBlockPermission getResourceBlockPermission( 222 long resourceBlockPermissionId) throws PortalException; 223 224 /** 225 * Returns a range of all the resource block permissions. 226 * 227 * <p> 228 * 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. 229 * </p> 230 * 231 * @param start the lower bound of the range of resource block permissions 232 * @param end the upper bound of the range of resource block permissions (not inclusive) 233 * @return the range of resource block permissions 234 */ 235 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 236 public List<ResourceBlockPermission> getResourceBlockPermissions( 237 int start, int end); 238 239 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 240 public ResourceBlockPermissionsContainer getResourceBlockPermissionsContainer( 241 long resourceBlockId); 242 243 /** 244 * Returns the number of resource block permissions. 245 * 246 * @return the number of resource block permissions 247 */ 248 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 249 public int getResourceBlockPermissionsCount(); 250 251 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 252 public int getResourceBlockPermissionsCount(long resourceBlockId, 253 long roleId); 254 255 public void updateResourceBlockPermission(long resourceBlockId, 256 long roleId, long actionIdsLong, int operator); 257 258 /** 259 * Updates the resource block permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 260 * 261 * @param resourceBlockPermission the resource block permission 262 * @return the resource block permission that was updated 263 */ 264 @Indexable(type = IndexableType.REINDEX) 265 public ResourceBlockPermission updateResourceBlockPermission( 266 ResourceBlockPermission resourceBlockPermission); 267 }