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.UserGroupRole;
027    import com.liferay.portal.kernel.search.Indexable;
028    import com.liferay.portal.kernel.search.IndexableType;
029    import com.liferay.portal.kernel.service.persistence.UserGroupRolePK;
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    
039    /**
040     * Provides the local service interface for UserGroupRole. Methods of this
041     * service will not have security checks based on the propagated JAAS
042     * credentials because this service can only be accessed from within the same
043     * VM.
044     *
045     * @author Brian Wing Shun Chan
046     * @see UserGroupRoleLocalServiceUtil
047     * @see com.liferay.portal.service.base.UserGroupRoleLocalServiceBaseImpl
048     * @see com.liferay.portal.service.impl.UserGroupRoleLocalServiceImpl
049     * @generated
050     */
051    @ProviderType
052    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
053            PortalException.class, SystemException.class})
054    public interface UserGroupRoleLocalService extends BaseLocalService,
055            PersistedModelLocalService {
056            /*
057             * NOTE FOR DEVELOPERS:
058             *
059             * Never modify or reference this interface directly. Always use {@link UserGroupRoleLocalServiceUtil} to access the user group role local service. Add custom service methods to {@link com.liferay.portal.service.impl.UserGroupRoleLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
060             */
061            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
062            public boolean hasUserGroupRole(long userId, long groupId,
063                    java.lang.String roleName) throws PortalException;
064    
065            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
066            public boolean hasUserGroupRole(long userId, long groupId,
067                    java.lang.String roleName, boolean inherit) throws PortalException;
068    
069            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
070            public boolean hasUserGroupRole(long userId, long groupId, long roleId);
071    
072            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
073            public boolean hasUserGroupRole(long userId, long groupId, long roleId,
074                    boolean inherit);
075    
076            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
077            public ActionableDynamicQuery getActionableDynamicQuery();
078    
079            public DynamicQuery dynamicQuery();
080    
081            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
082            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
083    
084            /**
085            * @throws PortalException
086            */
087            @Override
088            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
089                    throws PortalException;
090    
091            @Override
092            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
093            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
094                    throws PortalException;
095    
096            /**
097            * Adds the user group role to the database. Also notifies the appropriate model listeners.
098            *
099            * @param userGroupRole the user group role
100            * @return the user group role that was added
101            */
102            @Indexable(type = IndexableType.REINDEX)
103            public UserGroupRole addUserGroupRole(UserGroupRole userGroupRole);
104    
105            /**
106            * Creates a new user group role with the primary key. Does not add the user group role to the database.
107            *
108            * @param userGroupRolePK the primary key for the new user group role
109            * @return the new user group role
110            */
111            public UserGroupRole createUserGroupRole(UserGroupRolePK userGroupRolePK);
112    
113            /**
114            * Deletes the user group role from the database. Also notifies the appropriate model listeners.
115            *
116            * @param userGroupRole the user group role
117            * @return the user group role that was removed
118            */
119            @Indexable(type = IndexableType.DELETE)
120            public UserGroupRole deleteUserGroupRole(UserGroupRole userGroupRole);
121    
122            /**
123            * Deletes the user group role with the primary key from the database. Also notifies the appropriate model listeners.
124            *
125            * @param userGroupRolePK the primary key of the user group role
126            * @return the user group role that was removed
127            * @throws PortalException if a user group role with the primary key could not be found
128            */
129            @Indexable(type = IndexableType.DELETE)
130            public UserGroupRole deleteUserGroupRole(UserGroupRolePK userGroupRolePK)
131                    throws PortalException;
132    
133            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
134            public UserGroupRole fetchUserGroupRole(UserGroupRolePK userGroupRolePK);
135    
136            /**
137            * Returns the user group role with the primary key.
138            *
139            * @param userGroupRolePK the primary key of the user group role
140            * @return the user group role
141            * @throws PortalException if a user group role with the primary key could not be found
142            */
143            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
144            public UserGroupRole getUserGroupRole(UserGroupRolePK userGroupRolePK)
145                    throws PortalException;
146    
147            /**
148            * Updates the user group role in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
149            *
150            * @param userGroupRole the user group role
151            * @return the user group role that was updated
152            */
153            @Indexable(type = IndexableType.REINDEX)
154            public UserGroupRole updateUserGroupRole(UserGroupRole userGroupRole);
155    
156            /**
157            * Returns the number of user group roles.
158            *
159            * @return the number of user group roles
160            */
161            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
162            public int getUserGroupRolesCount();
163    
164            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
165            public int getUserGroupRolesCount(long userId, long groupId);
166    
167            /**
168            * Returns the OSGi service identifier.
169            *
170            * @return the OSGi service identifier
171            */
172            public java.lang.String getOSGiServiceIdentifier();
173    
174            public List<UserGroupRole> addUserGroupRoles(long userId, long groupId,
175                    long[] roleIds);
176    
177            public List<UserGroupRole> addUserGroupRoles(long[] userIds, long groupId,
178                    long roleId);
179    
180            /**
181            * Performs a dynamic query on the database and returns the matching rows.
182            *
183            * @param dynamicQuery the dynamic query
184            * @return the matching rows
185            */
186            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
187    
188            /**
189            * Performs a dynamic query on the database and returns a range of the matching rows.
190            *
191            * <p>
192            * 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.UserGroupRoleModelImpl}. 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.
193            * </p>
194            *
195            * @param dynamicQuery the dynamic query
196            * @param start the lower bound of the range of model instances
197            * @param end the upper bound of the range of model instances (not inclusive)
198            * @return the range of matching rows
199            */
200            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
201                    int end);
202    
203            /**
204            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
205            *
206            * <p>
207            * 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.UserGroupRoleModelImpl}. 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.
208            * </p>
209            *
210            * @param dynamicQuery the dynamic query
211            * @param start the lower bound of the range of model instances
212            * @param end the upper bound of the range of model instances (not inclusive)
213            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
214            * @return the ordered range of matching rows
215            */
216            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
217                    int end, OrderByComparator<T> orderByComparator);
218    
219            /**
220            * Returns a range of all the user group roles.
221            *
222            * <p>
223            * 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.UserGroupRoleModelImpl}. 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.
224            * </p>
225            *
226            * @param start the lower bound of the range of user group roles
227            * @param end the upper bound of the range of user group roles (not inclusive)
228            * @return the range of user group roles
229            */
230            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
231            public List<UserGroupRole> getUserGroupRoles(int start, int end);
232    
233            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
234            public List<UserGroupRole> getUserGroupRoles(long userId);
235    
236            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
237            public List<UserGroupRole> getUserGroupRoles(long userId, long groupId);
238    
239            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
240            public List<UserGroupRole> getUserGroupRoles(long userId, long groupId,
241                    int start, int end);
242    
243            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
244            public List<UserGroupRole> getUserGroupRolesByGroup(long groupId);
245    
246            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
247            public List<UserGroupRole> getUserGroupRolesByGroupAndRole(long groupId,
248                    long roleId);
249    
250            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
251            public List<UserGroupRole> getUserGroupRolesByUserUserGroupAndGroup(
252                    long userId, long groupId);
253    
254            /**
255            * Returns the number of rows matching the dynamic query.
256            *
257            * @param dynamicQuery the dynamic query
258            * @return the number of rows matching the dynamic query
259            */
260            public long dynamicQueryCount(DynamicQuery dynamicQuery);
261    
262            /**
263            * Returns the number of rows matching the dynamic query.
264            *
265            * @param dynamicQuery the dynamic query
266            * @param projection the projection to apply to the query
267            * @return the number of rows matching the dynamic query
268            */
269            public long dynamicQueryCount(DynamicQuery dynamicQuery,
270                    Projection projection);
271    
272            public void deleteUserGroupRoles(long groupId, int roleType);
273    
274            public void deleteUserGroupRoles(long userId, long groupId, long[] roleIds);
275    
276            public void deleteUserGroupRoles(long userId, long[] groupIds);
277    
278            public void deleteUserGroupRoles(long[] userIds, long groupId);
279    
280            public void deleteUserGroupRoles(long[] userIds, long groupId, int roleType);
281    
282            public void deleteUserGroupRoles(long[] userIds, long groupId, long roleId);
283    
284            public void deleteUserGroupRolesByGroupId(long groupId);
285    
286            public void deleteUserGroupRolesByRoleId(long roleId);
287    
288            public void deleteUserGroupRolesByUserId(long userId);
289    }