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.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.model.PersistedModel; 026 import com.liferay.portal.kernel.model.ResourceBlockPermission; 027 import com.liferay.portal.kernel.model.ResourceBlockPermissionsContainer; 028 import com.liferay.portal.kernel.search.Indexable; 029 import com.liferay.portal.kernel.search.IndexableType; 030 import com.liferay.portal.kernel.transaction.Isolation; 031 import com.liferay.portal.kernel.transaction.Propagation; 032 import com.liferay.portal.kernel.transaction.Transactional; 033 import com.liferay.portal.kernel.util.OrderByComparator; 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 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 064 public ActionableDynamicQuery getActionableDynamicQuery(); 065 066 public DynamicQuery dynamicQuery(); 067 068 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 069 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 070 071 /** 072 * @throws PortalException 073 */ 074 @Override 075 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 076 throws PortalException; 077 078 @Override 079 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 080 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 081 throws PortalException; 082 083 /** 084 * Adds the resource block permission to the database. Also notifies the appropriate model listeners. 085 * 086 * @param resourceBlockPermission the resource block permission 087 * @return the resource block permission that was added 088 */ 089 @Indexable(type = IndexableType.REINDEX) 090 public ResourceBlockPermission addResourceBlockPermission( 091 ResourceBlockPermission resourceBlockPermission); 092 093 /** 094 * Creates a new resource block permission with the primary key. Does not add the resource block permission to the database. 095 * 096 * @param resourceBlockPermissionId the primary key for the new resource block permission 097 * @return the new resource block permission 098 */ 099 public ResourceBlockPermission createResourceBlockPermission( 100 long resourceBlockPermissionId); 101 102 /** 103 * Deletes the resource block permission from the database. Also notifies the appropriate model listeners. 104 * 105 * @param resourceBlockPermission the resource block permission 106 * @return the resource block permission that was removed 107 */ 108 @Indexable(type = IndexableType.DELETE) 109 public ResourceBlockPermission deleteResourceBlockPermission( 110 ResourceBlockPermission resourceBlockPermission); 111 112 /** 113 * Deletes the resource block permission with the primary key from the database. Also notifies the appropriate model listeners. 114 * 115 * @param resourceBlockPermissionId the primary key of the resource block permission 116 * @return the resource block permission that was removed 117 * @throws PortalException if a resource block permission with the primary key could not be found 118 */ 119 @Indexable(type = IndexableType.DELETE) 120 public ResourceBlockPermission deleteResourceBlockPermission( 121 long resourceBlockPermissionId) throws PortalException; 122 123 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 124 public ResourceBlockPermission fetchResourceBlockPermission( 125 long resourceBlockPermissionId); 126 127 /** 128 * Returns the resource block permission with the primary key. 129 * 130 * @param resourceBlockPermissionId the primary key of the resource block permission 131 * @return the resource block permission 132 * @throws PortalException if a resource block permission with the primary key could not be found 133 */ 134 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 135 public ResourceBlockPermission getResourceBlockPermission( 136 long resourceBlockPermissionId) throws PortalException; 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 @Indexable(type = IndexableType.REINDEX) 145 public ResourceBlockPermission updateResourceBlockPermission( 146 ResourceBlockPermission resourceBlockPermission); 147 148 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 149 public ResourceBlockPermissionsContainer getResourceBlockPermissionsContainer( 150 long resourceBlockId); 151 152 /** 153 * Returns the number of resource block permissions. 154 * 155 * @return the number of resource block permissions 156 */ 157 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 158 public int getResourceBlockPermissionsCount(); 159 160 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 161 public int getResourceBlockPermissionsCount(long resourceBlockId, 162 long roleId); 163 164 /** 165 * Returns the OSGi service identifier. 166 * 167 * @return the OSGi service identifier 168 */ 169 public java.lang.String getOSGiServiceIdentifier(); 170 171 /** 172 * Performs a dynamic query on the database and returns the matching rows. 173 * 174 * @param dynamicQuery the dynamic query 175 * @return the matching rows 176 */ 177 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 178 179 /** 180 * Performs a dynamic query on the database and returns a range of the matching rows. 181 * 182 * <p> 183 * 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. 184 * </p> 185 * 186 * @param dynamicQuery the dynamic query 187 * @param start the lower bound of the range of model instances 188 * @param end the upper bound of the range of model instances (not inclusive) 189 * @return the range of matching rows 190 */ 191 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 192 int end); 193 194 /** 195 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 196 * 197 * <p> 198 * 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. 199 * </p> 200 * 201 * @param dynamicQuery the dynamic query 202 * @param start the lower bound of the range of model instances 203 * @param end the upper bound of the range of model instances (not inclusive) 204 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 205 * @return the ordered range of matching rows 206 */ 207 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 208 int end, OrderByComparator<T> orderByComparator); 209 210 /** 211 * Returns a range of all the resource block permissions. 212 * 213 * <p> 214 * 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. 215 * </p> 216 * 217 * @param start the lower bound of the range of resource block permissions 218 * @param end the upper bound of the range of resource block permissions (not inclusive) 219 * @return the range of resource block permissions 220 */ 221 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 222 public List<ResourceBlockPermission> getResourceBlockPermissions( 223 int start, int end); 224 225 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 226 public Map<java.lang.Long, Set<java.lang.String>> getAvailableResourceBlockPermissionActionIds( 227 java.lang.String name, long primKey, List<java.lang.String> actionIds) 228 throws PortalException; 229 230 /** 231 * @deprecated As of 7.0.0, replaced by {@link 232 #getAvailableResourceBlockPermissionActionIds(String, long, 233 List)} 234 */ 235 @java.lang.Deprecated 236 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 237 public Map<java.lang.Long, Set<java.lang.String>> getAvailableResourceBlockPermissionActionIds( 238 long[] roleIds, java.lang.String name, long primKey, 239 List<java.lang.String> actionIds) throws PortalException; 240 241 /** 242 * Returns the number of rows matching the dynamic query. 243 * 244 * @param dynamicQuery the dynamic query 245 * @return the number of rows matching the dynamic query 246 */ 247 public long dynamicQueryCount(DynamicQuery dynamicQuery); 248 249 /** 250 * Returns the number of rows matching the dynamic query. 251 * 252 * @param dynamicQuery the dynamic query 253 * @param projection the projection to apply to the query 254 * @return the number of rows matching the dynamic query 255 */ 256 public long dynamicQueryCount(DynamicQuery dynamicQuery, 257 Projection projection); 258 259 public void addResourceBlockPermissions(long resourceBlockId, 260 ResourceBlockPermissionsContainer resourceBlockPermissionsContainer); 261 262 public void deleteResourceBlockPermissions(long resourceBlockId); 263 264 public void updateResourceBlockPermission(long resourceBlockId, 265 long roleId, long actionIdsLong, int operator); 266 }