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.http;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.log.Log;
020    import com.liferay.portal.kernel.log.LogFactoryUtil;
021    import com.liferay.portal.kernel.security.auth.HttpPrincipal;
022    import com.liferay.portal.kernel.service.TeamServiceUtil;
023    import com.liferay.portal.kernel.service.http.TunnelUtil;
024    import com.liferay.portal.kernel.util.MethodHandler;
025    import com.liferay.portal.kernel.util.MethodKey;
026    
027    /**
028     * Provides the HTTP utility for the
029     * {@link TeamServiceUtil} service utility. The
030     * static methods of this class calls the same methods of the service utility.
031     * However, the signatures are different because it requires an additional
032     * {@link HttpPrincipal} parameter.
033     *
034     * <p>
035     * The benefits of using the HTTP utility is that it is fast and allows for
036     * tunneling without the cost of serializing to text. The drawback is that it
037     * only works with Java.
038     * </p>
039     *
040     * <p>
041     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
042     * configure security.
043     * </p>
044     *
045     * <p>
046     * The HTTP utility is only generated for remote services.
047     * </p>
048     *
049     * @author Brian Wing Shun Chan
050     * @see TeamServiceSoap
051     * @see HttpPrincipal
052     * @see TeamServiceUtil
053     * @generated
054     */
055    @ProviderType
056    public class TeamServiceHttp {
057            public static com.liferay.portal.kernel.model.Team addTeam(
058                    HttpPrincipal httpPrincipal, long groupId, java.lang.String name,
059                    java.lang.String description)
060                    throws com.liferay.portal.kernel.exception.PortalException {
061                    try {
062                            MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
063                                            "addTeam", _addTeamParameterTypes0);
064    
065                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
066                                            name, description);
067    
068                            Object returnObj = null;
069    
070                            try {
071                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
072                            }
073                            catch (Exception e) {
074                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
075                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
076                                    }
077    
078                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
079                            }
080    
081                            return (com.liferay.portal.kernel.model.Team)returnObj;
082                    }
083                    catch (com.liferay.portal.kernel.exception.SystemException se) {
084                            _log.error(se, se);
085    
086                            throw se;
087                    }
088            }
089    
090            public static com.liferay.portal.kernel.model.Team addTeam(
091                    HttpPrincipal httpPrincipal, long groupId, java.lang.String name,
092                    java.lang.String description,
093                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
094                    throws com.liferay.portal.kernel.exception.PortalException {
095                    try {
096                            MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
097                                            "addTeam", _addTeamParameterTypes1);
098    
099                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
100                                            name, description, serviceContext);
101    
102                            Object returnObj = null;
103    
104                            try {
105                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
106                            }
107                            catch (Exception e) {
108                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
109                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
110                                    }
111    
112                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
113                            }
114    
115                            return (com.liferay.portal.kernel.model.Team)returnObj;
116                    }
117                    catch (com.liferay.portal.kernel.exception.SystemException se) {
118                            _log.error(se, se);
119    
120                            throw se;
121                    }
122            }
123    
124            public static void deleteTeam(HttpPrincipal httpPrincipal, long teamId)
125                    throws com.liferay.portal.kernel.exception.PortalException {
126                    try {
127                            MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
128                                            "deleteTeam", _deleteTeamParameterTypes2);
129    
130                            MethodHandler methodHandler = new MethodHandler(methodKey, teamId);
131    
132                            try {
133                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
134                            }
135                            catch (Exception e) {
136                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
137                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
138                                    }
139    
140                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
141                            }
142                    }
143                    catch (com.liferay.portal.kernel.exception.SystemException se) {
144                            _log.error(se, se);
145    
146                            throw se;
147                    }
148            }
149    
150            public static java.util.List<com.liferay.portal.kernel.model.Team> getGroupTeams(
151                    HttpPrincipal httpPrincipal, long groupId)
152                    throws com.liferay.portal.kernel.exception.PortalException {
153                    try {
154                            MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
155                                            "getGroupTeams", _getGroupTeamsParameterTypes3);
156    
157                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId);
158    
159                            Object returnObj = null;
160    
161                            try {
162                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
163                            }
164                            catch (Exception e) {
165                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
166                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
167                                    }
168    
169                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
170                            }
171    
172                            return (java.util.List<com.liferay.portal.kernel.model.Team>)returnObj;
173                    }
174                    catch (com.liferay.portal.kernel.exception.SystemException se) {
175                            _log.error(se, se);
176    
177                            throw se;
178                    }
179            }
180    
181            public static com.liferay.portal.kernel.model.Team getTeam(
182                    HttpPrincipal httpPrincipal, long teamId)
183                    throws com.liferay.portal.kernel.exception.PortalException {
184                    try {
185                            MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
186                                            "getTeam", _getTeamParameterTypes4);
187    
188                            MethodHandler methodHandler = new MethodHandler(methodKey, teamId);
189    
190                            Object returnObj = null;
191    
192                            try {
193                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
194                            }
195                            catch (Exception e) {
196                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
197                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
198                                    }
199    
200                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
201                            }
202    
203                            return (com.liferay.portal.kernel.model.Team)returnObj;
204                    }
205                    catch (com.liferay.portal.kernel.exception.SystemException se) {
206                            _log.error(se, se);
207    
208                            throw se;
209                    }
210            }
211    
212            public static com.liferay.portal.kernel.model.Team getTeam(
213                    HttpPrincipal httpPrincipal, long groupId, java.lang.String name)
214                    throws com.liferay.portal.kernel.exception.PortalException {
215                    try {
216                            MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
217                                            "getTeam", _getTeamParameterTypes5);
218    
219                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
220                                            name);
221    
222                            Object returnObj = null;
223    
224                            try {
225                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
226                            }
227                            catch (Exception e) {
228                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
229                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
230                                    }
231    
232                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
233                            }
234    
235                            return (com.liferay.portal.kernel.model.Team)returnObj;
236                    }
237                    catch (com.liferay.portal.kernel.exception.SystemException se) {
238                            _log.error(se, se);
239    
240                            throw se;
241                    }
242            }
243    
244            public static java.util.List<com.liferay.portal.kernel.model.Team> getUserTeams(
245                    HttpPrincipal httpPrincipal, long userId)
246                    throws com.liferay.portal.kernel.exception.PortalException {
247                    try {
248                            MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
249                                            "getUserTeams", _getUserTeamsParameterTypes6);
250    
251                            MethodHandler methodHandler = new MethodHandler(methodKey, userId);
252    
253                            Object returnObj = null;
254    
255                            try {
256                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
257                            }
258                            catch (Exception e) {
259                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
260                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
261                                    }
262    
263                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
264                            }
265    
266                            return (java.util.List<com.liferay.portal.kernel.model.Team>)returnObj;
267                    }
268                    catch (com.liferay.portal.kernel.exception.SystemException se) {
269                            _log.error(se, se);
270    
271                            throw se;
272                    }
273            }
274    
275            public static java.util.List<com.liferay.portal.kernel.model.Team> getUserTeams(
276                    HttpPrincipal httpPrincipal, long userId, long groupId)
277                    throws com.liferay.portal.kernel.exception.PortalException {
278                    try {
279                            MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
280                                            "getUserTeams", _getUserTeamsParameterTypes7);
281    
282                            MethodHandler methodHandler = new MethodHandler(methodKey, userId,
283                                            groupId);
284    
285                            Object returnObj = null;
286    
287                            try {
288                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
289                            }
290                            catch (Exception e) {
291                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
292                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
293                                    }
294    
295                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
296                            }
297    
298                            return (java.util.List<com.liferay.portal.kernel.model.Team>)returnObj;
299                    }
300                    catch (com.liferay.portal.kernel.exception.SystemException se) {
301                            _log.error(se, se);
302    
303                            throw se;
304                    }
305            }
306    
307            public static boolean hasUserTeam(HttpPrincipal httpPrincipal, long userId,
308                    long teamId) throws com.liferay.portal.kernel.exception.PortalException {
309                    try {
310                            MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
311                                            "hasUserTeam", _hasUserTeamParameterTypes8);
312    
313                            MethodHandler methodHandler = new MethodHandler(methodKey, userId,
314                                            teamId);
315    
316                            Object returnObj = null;
317    
318                            try {
319                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
320                            }
321                            catch (Exception e) {
322                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
323                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
324                                    }
325    
326                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
327                            }
328    
329                            return ((Boolean)returnObj).booleanValue();
330                    }
331                    catch (com.liferay.portal.kernel.exception.SystemException se) {
332                            _log.error(se, se);
333    
334                            throw se;
335                    }
336            }
337    
338            public static java.util.List<com.liferay.portal.kernel.model.Team> search(
339                    HttpPrincipal httpPrincipal, long groupId, java.lang.String name,
340                    java.lang.String description,
341                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
342                    int start, int end,
343                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Team> obc) {
344                    try {
345                            MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
346                                            "search", _searchParameterTypes9);
347    
348                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
349                                            name, description, params, start, end, obc);
350    
351                            Object returnObj = null;
352    
353                            try {
354                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
355                            }
356                            catch (Exception e) {
357                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
358                            }
359    
360                            return (java.util.List<com.liferay.portal.kernel.model.Team>)returnObj;
361                    }
362                    catch (com.liferay.portal.kernel.exception.SystemException se) {
363                            _log.error(se, se);
364    
365                            throw se;
366                    }
367            }
368    
369            public static int searchCount(HttpPrincipal httpPrincipal, long groupId,
370                    java.lang.String name, java.lang.String description,
371                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) {
372                    try {
373                            MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
374                                            "searchCount", _searchCountParameterTypes10);
375    
376                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
377                                            name, description, params);
378    
379                            Object returnObj = null;
380    
381                            try {
382                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
383                            }
384                            catch (Exception e) {
385                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
386                            }
387    
388                            return ((Integer)returnObj).intValue();
389                    }
390                    catch (com.liferay.portal.kernel.exception.SystemException se) {
391                            _log.error(se, se);
392    
393                            throw se;
394                    }
395            }
396    
397            public static com.liferay.portal.kernel.model.Team updateTeam(
398                    HttpPrincipal httpPrincipal, long teamId, java.lang.String name,
399                    java.lang.String description)
400                    throws com.liferay.portal.kernel.exception.PortalException {
401                    try {
402                            MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
403                                            "updateTeam", _updateTeamParameterTypes11);
404    
405                            MethodHandler methodHandler = new MethodHandler(methodKey, teamId,
406                                            name, description);
407    
408                            Object returnObj = null;
409    
410                            try {
411                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
412                            }
413                            catch (Exception e) {
414                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
415                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
416                                    }
417    
418                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
419                            }
420    
421                            return (com.liferay.portal.kernel.model.Team)returnObj;
422                    }
423                    catch (com.liferay.portal.kernel.exception.SystemException se) {
424                            _log.error(se, se);
425    
426                            throw se;
427                    }
428            }
429    
430            private static Log _log = LogFactoryUtil.getLog(TeamServiceHttp.class);
431            private static final Class<?>[] _addTeamParameterTypes0 = new Class[] {
432                            long.class, java.lang.String.class, java.lang.String.class
433                    };
434            private static final Class<?>[] _addTeamParameterTypes1 = new Class[] {
435                            long.class, java.lang.String.class, java.lang.String.class,
436                            com.liferay.portal.kernel.service.ServiceContext.class
437                    };
438            private static final Class<?>[] _deleteTeamParameterTypes2 = new Class[] {
439                            long.class
440                    };
441            private static final Class<?>[] _getGroupTeamsParameterTypes3 = new Class[] {
442                            long.class
443                    };
444            private static final Class<?>[] _getTeamParameterTypes4 = new Class[] {
445                            long.class
446                    };
447            private static final Class<?>[] _getTeamParameterTypes5 = new Class[] {
448                            long.class, java.lang.String.class
449                    };
450            private static final Class<?>[] _getUserTeamsParameterTypes6 = new Class[] {
451                            long.class
452                    };
453            private static final Class<?>[] _getUserTeamsParameterTypes7 = new Class[] {
454                            long.class, long.class
455                    };
456            private static final Class<?>[] _hasUserTeamParameterTypes8 = new Class[] {
457                            long.class, long.class
458                    };
459            private static final Class<?>[] _searchParameterTypes9 = new Class[] {
460                            long.class, java.lang.String.class, java.lang.String.class,
461                            java.util.LinkedHashMap.class, int.class, int.class,
462                            com.liferay.portal.kernel.util.OrderByComparator.class
463                    };
464            private static final Class<?>[] _searchCountParameterTypes10 = new Class[] {
465                            long.class, java.lang.String.class, java.lang.String.class,
466                            java.util.LinkedHashMap.class
467                    };
468            private static final Class<?>[] _updateTeamParameterTypes11 = new Class[] {
469                            long.class, java.lang.String.class, java.lang.String.class
470                    };
471    }