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.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for UserGroup. This utility wraps
024     * {@link com.liferay.portal.service.impl.UserGroupLocalServiceImpl} 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 UserGroupLocalService
032     * @see com.liferay.portal.service.base.UserGroupLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.UserGroupLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class UserGroupLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.UserGroupLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043            public static void addGroupUserGroup(long groupId,
044                    com.liferay.portal.model.UserGroup userGroup) {
045                    getService().addGroupUserGroup(groupId, userGroup);
046            }
047    
048            public static void addGroupUserGroup(long groupId, long userGroupId) {
049                    getService().addGroupUserGroup(groupId, userGroupId);
050            }
051    
052            public static void addGroupUserGroups(long groupId,
053                    java.util.List<com.liferay.portal.model.UserGroup> UserGroups) {
054                    getService().addGroupUserGroups(groupId, UserGroups);
055            }
056    
057            public static void addGroupUserGroups(long groupId, long[] userGroupIds) {
058                    getService().addGroupUserGroups(groupId, userGroupIds);
059            }
060    
061            public static void addTeamUserGroup(long teamId,
062                    com.liferay.portal.model.UserGroup userGroup) {
063                    getService().addTeamUserGroup(teamId, userGroup);
064            }
065    
066            public static void addTeamUserGroup(long teamId, long userGroupId) {
067                    getService().addTeamUserGroup(teamId, userGroupId);
068            }
069    
070            public static void addTeamUserGroups(long teamId,
071                    java.util.List<com.liferay.portal.model.UserGroup> UserGroups) {
072                    getService().addTeamUserGroups(teamId, UserGroups);
073            }
074    
075            public static void addTeamUserGroups(long teamId, long[] userGroupIds) {
076                    getService().addTeamUserGroups(teamId, userGroupIds);
077            }
078    
079            /**
080            * Adds the user group to the database. Also notifies the appropriate model listeners.
081            *
082            * @param userGroup the user group
083            * @return the user group that was added
084            */
085            public static com.liferay.portal.model.UserGroup addUserGroup(
086                    com.liferay.portal.model.UserGroup userGroup) {
087                    return getService().addUserGroup(userGroup);
088            }
089    
090            /**
091            * Adds a user group.
092            *
093            * <p>
094            * This method handles the creation and bookkeeping of the user group,
095            * including its resources, metadata, and internal data structures. It is
096            * not necessary to make subsequent calls to setup default groups and
097            * resources for the user group.
098            * </p>
099            *
100            * @param userId the primary key of the user
101            * @param companyId the primary key of the user group's company
102            * @param name the user group's name
103            * @param description the user group's description
104            * @return the user group
105            * @deprecated As of 6.2.0, replaced by {@link #addUserGroup(long, long,
106            String, String, ServiceContext)}
107            */
108            @Deprecated
109            public static com.liferay.portal.model.UserGroup addUserGroup(long userId,
110                    long companyId, java.lang.String name, java.lang.String description)
111                    throws com.liferay.portal.kernel.exception.PortalException {
112                    return getService().addUserGroup(userId, companyId, name, description);
113            }
114    
115            /**
116            * Adds a user group.
117            *
118            * <p>
119            * This method handles the creation and bookkeeping of the user group,
120            * including its resources, metadata, and internal data structures. It is
121            * not necessary to make subsequent calls to setup default groups and
122            * resources for the user group.
123            * </p>
124            *
125            * @param userId the primary key of the user
126            * @param companyId the primary key of the user group's company
127            * @param name the user group's name
128            * @param description the user group's description
129            * @param serviceContext the service context to be applied (optionally
130            <code>null</code>). Can set expando bridge attributes for the
131            user group.
132            * @return the user group
133            */
134            public static com.liferay.portal.model.UserGroup addUserGroup(long userId,
135                    long companyId, java.lang.String name, java.lang.String description,
136                    com.liferay.portal.service.ServiceContext serviceContext)
137                    throws com.liferay.portal.kernel.exception.PortalException {
138                    return getService()
139                                       .addUserGroup(userId, companyId, name, description,
140                            serviceContext);
141            }
142    
143            public static void addUserUserGroup(long userId,
144                    com.liferay.portal.model.UserGroup userGroup) {
145                    getService().addUserUserGroup(userId, userGroup);
146            }
147    
148            public static void addUserUserGroup(long userId, long userGroupId) {
149                    getService().addUserUserGroup(userId, userGroupId);
150            }
151    
152            public static void addUserUserGroups(long userId,
153                    java.util.List<com.liferay.portal.model.UserGroup> UserGroups) {
154                    getService().addUserUserGroups(userId, UserGroups);
155            }
156    
157            public static void addUserUserGroups(long userId, long[] userGroupIds) {
158                    getService().addUserUserGroups(userId, userGroupIds);
159            }
160    
161            public static void clearGroupUserGroups(long groupId) {
162                    getService().clearGroupUserGroups(groupId);
163            }
164    
165            public static void clearTeamUserGroups(long teamId) {
166                    getService().clearTeamUserGroups(teamId);
167            }
168    
169            public static void clearUserUserGroups(long userId) {
170                    getService().clearUserUserGroups(userId);
171            }
172    
173            /**
174            * Copies the user group's layout to the user.
175            *
176            * @param userGroupId the primary key of the user group
177            * @param userId the primary key of the user
178            * @deprecated As of 6.2.0
179            */
180            @Deprecated
181            public static void copyUserGroupLayouts(long userGroupId, long userId)
182                    throws com.liferay.portal.kernel.exception.PortalException {
183                    getService().copyUserGroupLayouts(userGroupId, userId);
184            }
185    
186            /**
187            * Copies the user group's layouts to the users who are not already members
188            * of the user group.
189            *
190            * @param userGroupId the primary key of the user group
191            * @param userIds the primary keys of the users
192            * @deprecated As of 6.1.0
193            */
194            @Deprecated
195            public static void copyUserGroupLayouts(long userGroupId, long[] userIds)
196                    throws com.liferay.portal.kernel.exception.PortalException {
197                    getService().copyUserGroupLayouts(userGroupId, userIds);
198            }
199    
200            /**
201            * Copies the user groups' layouts to the user.
202            *
203            * @param userGroupIds the primary keys of the user groups
204            * @param userId the primary key of the user
205            * @deprecated As of 6.1.0
206            */
207            @Deprecated
208            public static void copyUserGroupLayouts(long[] userGroupIds, long userId)
209                    throws com.liferay.portal.kernel.exception.PortalException {
210                    getService().copyUserGroupLayouts(userGroupIds, userId);
211            }
212    
213            /**
214            * Creates a new user group with the primary key. Does not add the user group to the database.
215            *
216            * @param userGroupId the primary key for the new user group
217            * @return the new user group
218            */
219            public static com.liferay.portal.model.UserGroup createUserGroup(
220                    long userGroupId) {
221                    return getService().createUserGroup(userGroupId);
222            }
223    
224            public static void deleteGroupUserGroup(long groupId,
225                    com.liferay.portal.model.UserGroup userGroup) {
226                    getService().deleteGroupUserGroup(groupId, userGroup);
227            }
228    
229            public static void deleteGroupUserGroup(long groupId, long userGroupId) {
230                    getService().deleteGroupUserGroup(groupId, userGroupId);
231            }
232    
233            public static void deleteGroupUserGroups(long groupId,
234                    java.util.List<com.liferay.portal.model.UserGroup> UserGroups) {
235                    getService().deleteGroupUserGroups(groupId, UserGroups);
236            }
237    
238            public static void deleteGroupUserGroups(long groupId, long[] userGroupIds) {
239                    getService().deleteGroupUserGroups(groupId, userGroupIds);
240            }
241    
242            /**
243            * @throws PortalException
244            */
245            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
246                    com.liferay.portal.model.PersistedModel persistedModel)
247                    throws com.liferay.portal.kernel.exception.PortalException {
248                    return getService().deletePersistedModel(persistedModel);
249            }
250    
251            public static void deleteTeamUserGroup(long teamId,
252                    com.liferay.portal.model.UserGroup userGroup) {
253                    getService().deleteTeamUserGroup(teamId, userGroup);
254            }
255    
256            public static void deleteTeamUserGroup(long teamId, long userGroupId) {
257                    getService().deleteTeamUserGroup(teamId, userGroupId);
258            }
259    
260            public static void deleteTeamUserGroups(long teamId,
261                    java.util.List<com.liferay.portal.model.UserGroup> UserGroups) {
262                    getService().deleteTeamUserGroups(teamId, UserGroups);
263            }
264    
265            public static void deleteTeamUserGroups(long teamId, long[] userGroupIds) {
266                    getService().deleteTeamUserGroups(teamId, userGroupIds);
267            }
268    
269            /**
270            * Deletes the user group from the database. Also notifies the appropriate model listeners.
271            *
272            * @param userGroup the user group
273            * @return the user group that was removed
274            * @throws PortalException
275            */
276            public static com.liferay.portal.model.UserGroup deleteUserGroup(
277                    com.liferay.portal.model.UserGroup userGroup)
278                    throws com.liferay.portal.kernel.exception.PortalException {
279                    return getService().deleteUserGroup(userGroup);
280            }
281    
282            /**
283            * Deletes the user group with the primary key from the database. Also notifies the appropriate model listeners.
284            *
285            * @param userGroupId the primary key of the user group
286            * @return the user group that was removed
287            * @throws PortalException if a user group with the primary key could not be found
288            */
289            public static com.liferay.portal.model.UserGroup deleteUserGroup(
290                    long userGroupId)
291                    throws com.liferay.portal.kernel.exception.PortalException {
292                    return getService().deleteUserGroup(userGroupId);
293            }
294    
295            public static void deleteUserGroups(long companyId)
296                    throws com.liferay.portal.kernel.exception.PortalException {
297                    getService().deleteUserGroups(companyId);
298            }
299    
300            public static void deleteUserUserGroup(long userId,
301                    com.liferay.portal.model.UserGroup userGroup) {
302                    getService().deleteUserUserGroup(userId, userGroup);
303            }
304    
305            public static void deleteUserUserGroup(long userId, long userGroupId) {
306                    getService().deleteUserUserGroup(userId, userGroupId);
307            }
308    
309            public static void deleteUserUserGroups(long userId,
310                    java.util.List<com.liferay.portal.model.UserGroup> UserGroups) {
311                    getService().deleteUserUserGroups(userId, UserGroups);
312            }
313    
314            public static void deleteUserUserGroups(long userId, long[] userGroupIds) {
315                    getService().deleteUserUserGroups(userId, userGroupIds);
316            }
317    
318            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
319                    return getService().dynamicQuery();
320            }
321    
322            /**
323            * Performs a dynamic query on the database and returns the matching rows.
324            *
325            * @param dynamicQuery the dynamic query
326            * @return the matching rows
327            */
328            public static <T> java.util.List<T> dynamicQuery(
329                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
330                    return getService().dynamicQuery(dynamicQuery);
331            }
332    
333            /**
334            * Performs a dynamic query on the database and returns a range of the matching rows.
335            *
336            * <p>
337            * 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.UserGroupModelImpl}. 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.
338            * </p>
339            *
340            * @param dynamicQuery the dynamic query
341            * @param start the lower bound of the range of model instances
342            * @param end the upper bound of the range of model instances (not inclusive)
343            * @return the range of matching rows
344            */
345            public static <T> java.util.List<T> dynamicQuery(
346                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
347                    int end) {
348                    return getService().dynamicQuery(dynamicQuery, start, end);
349            }
350    
351            /**
352            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
353            *
354            * <p>
355            * 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.UserGroupModelImpl}. 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.
356            * </p>
357            *
358            * @param dynamicQuery the dynamic query
359            * @param start the lower bound of the range of model instances
360            * @param end the upper bound of the range of model instances (not inclusive)
361            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
362            * @return the ordered range of matching rows
363            */
364            public static <T> java.util.List<T> dynamicQuery(
365                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
366                    int end,
367                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
368                    return getService()
369                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
370            }
371    
372            /**
373            * Returns the number of rows matching the dynamic query.
374            *
375            * @param dynamicQuery the dynamic query
376            * @return the number of rows matching the dynamic query
377            */
378            public static long dynamicQueryCount(
379                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
380                    return getService().dynamicQueryCount(dynamicQuery);
381            }
382    
383            /**
384            * Returns the number of rows matching the dynamic query.
385            *
386            * @param dynamicQuery the dynamic query
387            * @param projection the projection to apply to the query
388            * @return the number of rows matching the dynamic query
389            */
390            public static long dynamicQueryCount(
391                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
392                    com.liferay.portal.kernel.dao.orm.Projection projection) {
393                    return getService().dynamicQueryCount(dynamicQuery, projection);
394            }
395    
396            public static com.liferay.portal.model.UserGroup fetchUserGroup(
397                    long companyId, java.lang.String name) {
398                    return getService().fetchUserGroup(companyId, name);
399            }
400    
401            public static com.liferay.portal.model.UserGroup fetchUserGroup(
402                    long userGroupId) {
403                    return getService().fetchUserGroup(userGroupId);
404            }
405    
406            /**
407            * Returns the user group with the matching UUID and company.
408            *
409            * @param uuid the user group's UUID
410            * @param companyId the primary key of the company
411            * @return the matching user group, or <code>null</code> if a matching user group could not be found
412            */
413            public static com.liferay.portal.model.UserGroup fetchUserGroupByUuidAndCompanyId(
414                    java.lang.String uuid, long companyId) {
415                    return getService().fetchUserGroupByUuidAndCompanyId(uuid, companyId);
416            }
417    
418            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
419                    return getService().getActionableDynamicQuery();
420            }
421    
422            public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(
423                    com.liferay.portlet.exportimport.lar.PortletDataContext portletDataContext) {
424                    return getService().getExportActionableDynamicQuery(portletDataContext);
425            }
426    
427            /**
428            * Returns the groupIds of the groups associated with the user group.
429            *
430            * @param userGroupId the userGroupId of the user group
431            * @return long[] the groupIds of groups associated with the user group
432            */
433            public static long[] getGroupPrimaryKeys(long userGroupId) {
434                    return getService().getGroupPrimaryKeys(userGroupId);
435            }
436    
437            public static java.util.List<com.liferay.portal.model.UserGroup> getGroupUserGroups(
438                    long groupId) {
439                    return getService().getGroupUserGroups(groupId);
440            }
441    
442            public static java.util.List<com.liferay.portal.model.UserGroup> getGroupUserGroups(
443                    long groupId, int start, int end) {
444                    return getService().getGroupUserGroups(groupId, start, end);
445            }
446    
447            public static java.util.List<com.liferay.portal.model.UserGroup> getGroupUserGroups(
448                    long groupId, int start, int end,
449                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.UserGroup> orderByComparator) {
450                    return getService()
451                                       .getGroupUserGroups(groupId, start, end, orderByComparator);
452            }
453    
454            public static int getGroupUserGroupsCount(long groupId) {
455                    return getService().getGroupUserGroupsCount(groupId);
456            }
457    
458            public static java.util.List<com.liferay.portal.model.UserGroup> getGroupUserUserGroups(
459                    long groupId, long userId)
460                    throws com.liferay.portal.kernel.exception.PortalException {
461                    return getService().getGroupUserUserGroups(groupId, userId);
462            }
463    
464            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
465                    return getService().getIndexableActionableDynamicQuery();
466            }
467    
468            /**
469            * Returns the OSGi service identifier.
470            *
471            * @return the OSGi service identifier
472            */
473            public static java.lang.String getOSGiServiceIdentifier() {
474                    return getService().getOSGiServiceIdentifier();
475            }
476    
477            public static com.liferay.portal.model.PersistedModel getPersistedModel(
478                    java.io.Serializable primaryKeyObj)
479                    throws com.liferay.portal.kernel.exception.PortalException {
480                    return getService().getPersistedModel(primaryKeyObj);
481            }
482    
483            /**
484            * Returns the teamIds of the teams associated with the user group.
485            *
486            * @param userGroupId the userGroupId of the user group
487            * @return long[] the teamIds of teams associated with the user group
488            */
489            public static long[] getTeamPrimaryKeys(long userGroupId) {
490                    return getService().getTeamPrimaryKeys(userGroupId);
491            }
492    
493            public static java.util.List<com.liferay.portal.model.UserGroup> getTeamUserGroups(
494                    long teamId) {
495                    return getService().getTeamUserGroups(teamId);
496            }
497    
498            public static java.util.List<com.liferay.portal.model.UserGroup> getTeamUserGroups(
499                    long teamId, int start, int end) {
500                    return getService().getTeamUserGroups(teamId, start, end);
501            }
502    
503            public static java.util.List<com.liferay.portal.model.UserGroup> getTeamUserGroups(
504                    long teamId, int start, int end,
505                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.UserGroup> orderByComparator) {
506                    return getService()
507                                       .getTeamUserGroups(teamId, start, end, orderByComparator);
508            }
509    
510            public static int getTeamUserGroupsCount(long teamId) {
511                    return getService().getTeamUserGroupsCount(teamId);
512            }
513    
514            /**
515            * Returns the user group with the name.
516            *
517            * @param companyId the primary key of the user group's company
518            * @param name the user group's name
519            * @return Returns the user group with the name
520            */
521            public static com.liferay.portal.model.UserGroup getUserGroup(
522                    long companyId, java.lang.String name)
523                    throws com.liferay.portal.kernel.exception.PortalException {
524                    return getService().getUserGroup(companyId, name);
525            }
526    
527            /**
528            * Returns the user group with the primary key.
529            *
530            * @param userGroupId the primary key of the user group
531            * @return the user group
532            * @throws PortalException if a user group with the primary key could not be found
533            */
534            public static com.liferay.portal.model.UserGroup getUserGroup(
535                    long userGroupId)
536                    throws com.liferay.portal.kernel.exception.PortalException {
537                    return getService().getUserGroup(userGroupId);
538            }
539    
540            /**
541            * Returns the user group with the matching UUID and company.
542            *
543            * @param uuid the user group's UUID
544            * @param companyId the primary key of the company
545            * @return the matching user group
546            * @throws PortalException if a matching user group could not be found
547            */
548            public static com.liferay.portal.model.UserGroup getUserGroupByUuidAndCompanyId(
549                    java.lang.String uuid, long companyId)
550                    throws com.liferay.portal.kernel.exception.PortalException {
551                    return getService().getUserGroupByUuidAndCompanyId(uuid, companyId);
552            }
553    
554            /**
555            * Returns all the user groups belonging to the company.
556            *
557            * @param companyId the primary key of the user groups' company
558            * @return the user groups belonging to the company
559            */
560            public static java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
561                    long companyId) {
562                    return getService().getUserGroups(companyId);
563            }
564    
565            /**
566            * Returns a range of all the user groups.
567            *
568            * <p>
569            * 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.UserGroupModelImpl}. 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.
570            * </p>
571            *
572            * @param start the lower bound of the range of user groups
573            * @param end the upper bound of the range of user groups (not inclusive)
574            * @return the range of user groups
575            */
576            public static java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
577                    int start, int end) {
578                    return getService().getUserGroups(start, end);
579            }
580    
581            /**
582            * Returns all the user groups with the primary keys.
583            *
584            * @param userGroupIds the primary keys of the user groups
585            * @return the user groups with the primary keys
586            */
587            public static java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
588                    long[] userGroupIds)
589                    throws com.liferay.portal.kernel.exception.PortalException {
590                    return getService().getUserGroups(userGroupIds);
591            }
592    
593            /**
594            * Returns the number of user groups.
595            *
596            * @return the number of user groups
597            */
598            public static int getUserGroupsCount() {
599                    return getService().getUserGroupsCount();
600            }
601    
602            /**
603            * Returns the userIds of the users associated with the user group.
604            *
605            * @param userGroupId the userGroupId of the user group
606            * @return long[] the userIds of users associated with the user group
607            */
608            public static long[] getUserPrimaryKeys(long userGroupId) {
609                    return getService().getUserPrimaryKeys(userGroupId);
610            }
611    
612            public static java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
613                    long userId) {
614                    return getService().getUserUserGroups(userId);
615            }
616    
617            public static java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
618                    long userId, int start, int end) {
619                    return getService().getUserUserGroups(userId, start, end);
620            }
621    
622            public static java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
623                    long userId, int start, int end,
624                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.UserGroup> orderByComparator) {
625                    return getService()
626                                       .getUserUserGroups(userId, start, end, orderByComparator);
627            }
628    
629            public static int getUserUserGroupsCount(long userId) {
630                    return getService().getUserUserGroupsCount(userId);
631            }
632    
633            public static boolean hasGroupUserGroup(long groupId, long userGroupId) {
634                    return getService().hasGroupUserGroup(groupId, userGroupId);
635            }
636    
637            public static boolean hasGroupUserGroups(long groupId) {
638                    return getService().hasGroupUserGroups(groupId);
639            }
640    
641            public static boolean hasTeamUserGroup(long teamId, long userGroupId) {
642                    return getService().hasTeamUserGroup(teamId, userGroupId);
643            }
644    
645            public static boolean hasTeamUserGroups(long teamId) {
646                    return getService().hasTeamUserGroups(teamId);
647            }
648    
649            public static boolean hasUserUserGroup(long userId, long userGroupId) {
650                    return getService().hasUserUserGroup(userId, userGroupId);
651            }
652    
653            public static boolean hasUserUserGroups(long userId) {
654                    return getService().hasUserUserGroups(userId);
655            }
656    
657            /**
658            * Returns an ordered range of all the user groups that match the keywords.
659            *
660            * <p>
661            * Useful when paginating results. Returns a maximum of <code>end -
662            * start</code> instances. <code>start</code> and <code>end</code> are not
663            * primary keys, they are indexes in the result set. Thus, <code>0</code>
664            * refers to the first result in the set. Setting both <code>start</code>
665            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
666            * result set.
667            * </p>
668            *
669            * @param companyId the primary key of the user group's company
670            * @param keywords the keywords (space separated), which may occur in the
671            user group's name or description (optionally <code>null</code>)
672            * @param params the finder params (optionally <code>null</code>). For more
673            information see {@link
674            com.liferay.portal.service.persistence.UserGroupFinder}
675            * @param start the lower bound of the range of user groups to return
676            * @param end the upper bound of the range of user groups to return (not
677            inclusive)
678            * @param obc the comparator to order the user groups (optionally
679            <code>null</code>)
680            * @return the matching user groups ordered by comparator <code>obc</code>
681            * @see com.liferay.portal.service.persistence.UserGroupFinder
682            */
683            public static java.util.List<com.liferay.portal.model.UserGroup> search(
684                    long companyId, java.lang.String keywords,
685                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
686                    int start, int end,
687                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.UserGroup> obc) {
688                    return getService().search(companyId, keywords, params, start, end, obc);
689            }
690    
691            /**
692            * Returns an ordered range of all the user groups that match the keywords,
693            * using the indexer. It is preferable to use this method instead of the
694            * non-indexed version whenever possible for performance reasons.
695            *
696            * <p>
697            * Useful when paginating results. Returns a maximum of <code>end -
698            * start</code> instances. <code>start</code> and <code>end</code> are not
699            * primary keys, they are indexes in the result set. Thus, <code>0</code>
700            * refers to the first result in the set. Setting both <code>start</code>
701            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
702            * result set.
703            * </p>
704            *
705            * @param companyId the primary key of the user group's company
706            * @param keywords the keywords (space separated), which may occur in the
707            user group's name or description (optionally <code>null</code>)
708            * @param params the finder params (optionally <code>null</code>). For more
709            information see {@link
710            com.liferay.portlet.usergroupsadmin.util.UserGroupIndexer}
711            * @param start the lower bound of the range of user groups to return
712            * @param end the upper bound of the range of user groups to return (not
713            inclusive)
714            * @param sort the field and direction by which to sort (optionally
715            <code>null</code>)
716            * @return the matching user groups ordered by sort
717            * @see com.liferay.portlet.usergroupsadmin.util.UserGroupIndexer
718            */
719            public static com.liferay.portal.kernel.search.Hits search(long companyId,
720                    java.lang.String keywords,
721                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
722                    int start, int end, com.liferay.portal.kernel.search.Sort sort) {
723                    return getService().search(companyId, keywords, params, start, end, sort);
724            }
725    
726            /**
727            * Returns an ordered range of all the user groups that match the name and
728            * description.
729            *
730            * <p>
731            * Useful when paginating results. Returns a maximum of <code>end -
732            * start</code> instances. <code>start</code> and <code>end</code> are not
733            * primary keys, they are indexes in the result set. Thus, <code>0</code>
734            * refers to the first result in the set. Setting both <code>start</code>
735            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
736            * result set.
737            * </p>
738            *
739            * @param companyId the primary key of the user group's company
740            * @param name the user group's name (optionally <code>null</code>)
741            * @param description the user group's description (optionally
742            <code>null</code>)
743            * @param params the finder params (optionally <code>null</code>). For more
744            information see {@link
745            com.liferay.portal.service.persistence.UserGroupFinder}
746            * @param andOperator whether every field must match its keywords or just
747            one field
748            * @param start the lower bound of the range of user groups to return
749            * @param end the upper bound of the range of user groups to return (not
750            inclusive)
751            * @param obc the comparator to order the user groups (optionally
752            <code>null</code>)
753            * @return the matching user groups ordered by comparator <code>obc</code>
754            * @see com.liferay.portal.service.persistence.UserGroupFinder
755            */
756            public static java.util.List<com.liferay.portal.model.UserGroup> search(
757                    long companyId, java.lang.String name, java.lang.String description,
758                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
759                    boolean andOperator, int start, int end,
760                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.UserGroup> obc) {
761                    return getService()
762                                       .search(companyId, name, description, params, andOperator,
763                            start, end, obc);
764            }
765    
766            /**
767            * Returns an ordered range of all the user groups that match the name and
768            * description. It is preferable to use this method instead of the
769            * non-indexed version whenever possible for performance reasons.
770            *
771            * <p>
772            * Useful when paginating results. Returns a maximum of <code>end -
773            * start</code> instances. <code>start</code> and <code>end</code> are not
774            * primary keys, they are indexes in the result set. Thus, <code>0</code>
775            * refers to the first result in the set. Setting both <code>start</code>
776            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
777            * result set.
778            * </p>
779            *
780            * @param companyId the primary key of the user group's company
781            * @param name the user group's name (optionally <code>null</code>)
782            * @param description the user group's description (optionally
783            <code>null</code>)
784            * @param params the finder params (optionally <code>null</code>). For more
785            information see {@link
786            com.liferay.portlet.usergroupsadmin.util.UserGroupIndexer}
787            * @param andSearch whether every field must match its keywords or just one
788            field
789            * @param start the lower bound of the range of user groups to return
790            * @param end the upper bound of the range of user groups to return (not
791            inclusive)
792            * @param sort the field and direction by which to sort (optionally
793            <code>null</code>)
794            * @return the matching user groups ordered by sort
795            * @see com.liferay.portal.service.persistence.UserGroupFinder
796            */
797            public static com.liferay.portal.kernel.search.Hits search(long companyId,
798                    java.lang.String name, java.lang.String description,
799                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
800                    boolean andSearch, int start, int end,
801                    com.liferay.portal.kernel.search.Sort sort) {
802                    return getService()
803                                       .search(companyId, name, description, params, andSearch,
804                            start, end, sort);
805            }
806    
807            /**
808            * Returns the number of user groups that match the keywords
809            *
810            * @param companyId the primary key of the user group's company
811            * @param keywords the keywords (space separated), which may occur in the
812            user group's name or description (optionally <code>null</code>)
813            * @param params the finder params (optionally <code>null</code>). For more
814            information see {@link
815            com.liferay.portal.service.persistence.UserGroupFinder}
816            * @return the number of matching user groups
817            * @see com.liferay.portal.service.persistence.UserGroupFinder
818            */
819            public static int searchCount(long companyId, java.lang.String keywords,
820                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) {
821                    return getService().searchCount(companyId, keywords, params);
822            }
823    
824            /**
825            * Returns the number of user groups that match the name and description.
826            *
827            * @param companyId the primary key of the user group's company
828            * @param name the user group's name (optionally <code>null</code>)
829            * @param description the user group's description (optionally
830            <code>null</code>)
831            * @param params the finder params (optionally <code>null</code>). For more
832            information see {@link
833            com.liferay.portal.service.persistence.UserGroupFinder}
834            * @param andOperator whether every field must match its keywords or just
835            one field
836            * @return the number of matching user groups
837            * @see com.liferay.portal.service.persistence.UserGroupFinder
838            */
839            public static int searchCount(long companyId, java.lang.String name,
840                    java.lang.String description,
841                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
842                    boolean andOperator) {
843                    return getService()
844                                       .searchCount(companyId, name, description, params,
845                            andOperator);
846            }
847    
848            public static com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.portal.model.UserGroup> searchUserGroups(
849                    long companyId, java.lang.String keywords,
850                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
851                    int start, int end, com.liferay.portal.kernel.search.Sort sort)
852                    throws com.liferay.portal.kernel.exception.PortalException {
853                    return getService()
854                                       .searchUserGroups(companyId, keywords, params, start, end,
855                            sort);
856            }
857    
858            public static com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.portal.model.UserGroup> searchUserGroups(
859                    long companyId, java.lang.String name, java.lang.String description,
860                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
861                    boolean andSearch, int start, int end,
862                    com.liferay.portal.kernel.search.Sort sort)
863                    throws com.liferay.portal.kernel.exception.PortalException {
864                    return getService()
865                                       .searchUserGroups(companyId, name, description, params,
866                            andSearch, start, end, sort);
867            }
868    
869            public static void setGroupUserGroups(long groupId, long[] userGroupIds) {
870                    getService().setGroupUserGroups(groupId, userGroupIds);
871            }
872    
873            public static void setTeamUserGroups(long teamId, long[] userGroupIds) {
874                    getService().setTeamUserGroups(teamId, userGroupIds);
875            }
876    
877            /**
878            * @throws PortalException
879            */
880            public static void setUserUserGroups(long userId, long[] userGroupIds)
881                    throws com.liferay.portal.kernel.exception.PortalException {
882                    getService().setUserUserGroups(userId, userGroupIds);
883            }
884    
885            /**
886            * Removes the user groups from the group.
887            *
888            * @param groupId the primary key of the group
889            * @param userGroupIds the primary keys of the user groups
890            */
891            public static void unsetGroupUserGroups(long groupId, long[] userGroupIds) {
892                    getService().unsetGroupUserGroups(groupId, userGroupIds);
893            }
894    
895            /**
896            * Removes the user groups from the team.
897            *
898            * @param teamId the primary key of the team
899            * @param userGroupIds the primary keys of the user groups
900            */
901            public static void unsetTeamUserGroups(long teamId, long[] userGroupIds) {
902                    getService().unsetTeamUserGroups(teamId, userGroupIds);
903            }
904    
905            /**
906            * Updates the user group.
907            *
908            * @param companyId the primary key of the user group's company
909            * @param userGroupId the primary key of the user group
910            * @param name the user group's name
911            * @param description the user group's description
912            * @return the user group
913            * @deprecated As of 6.2.0, replaced by {@link #updateUserGroup(long, long,
914            String, String, ServiceContext)}
915            */
916            @Deprecated
917            public static com.liferay.portal.model.UserGroup updateUserGroup(
918                    long companyId, long userGroupId, java.lang.String name,
919                    java.lang.String description)
920                    throws com.liferay.portal.kernel.exception.PortalException {
921                    return getService()
922                                       .updateUserGroup(companyId, userGroupId, name, description);
923            }
924    
925            /**
926            * Updates the user group.
927            *
928            * @param companyId the primary key of the user group's company
929            * @param userGroupId the primary key of the user group
930            * @param name the user group's name
931            * @param description the user group's description
932            * @param serviceContext the service context to be applied (optionally
933            <code>null</code>). Can set expando bridge attributes for the
934            user group.
935            * @return the user group
936            */
937            public static com.liferay.portal.model.UserGroup updateUserGroup(
938                    long companyId, long userGroupId, java.lang.String name,
939                    java.lang.String description,
940                    com.liferay.portal.service.ServiceContext serviceContext)
941                    throws com.liferay.portal.kernel.exception.PortalException {
942                    return getService()
943                                       .updateUserGroup(companyId, userGroupId, name, description,
944                            serviceContext);
945            }
946    
947            /**
948            * Updates the user group in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
949            *
950            * @param userGroup the user group
951            * @return the user group that was updated
952            */
953            public static com.liferay.portal.model.UserGroup updateUserGroup(
954                    com.liferay.portal.model.UserGroup userGroup) {
955                    return getService().updateUserGroup(userGroup);
956            }
957    
958            public static UserGroupLocalService getService() {
959                    if (_service == null) {
960                            _service = (UserGroupLocalService)PortalBeanLocatorUtil.locate(UserGroupLocalService.class.getName());
961    
962                            ReferenceRegistry.registerReference(UserGroupLocalServiceUtil.class,
963                                    "_service");
964                    }
965    
966                    return _service;
967            }
968    
969            private static UserGroupLocalService _service;
970    }