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