1
14
15 package com.liferay.portal.service.http;
16
17 import com.liferay.portal.kernel.log.Log;
18 import com.liferay.portal.kernel.log.LogFactoryUtil;
19 import com.liferay.portal.kernel.util.MethodHandler;
20 import com.liferay.portal.kernel.util.MethodKey;
21 import com.liferay.portal.security.auth.HttpPrincipal;
22 import com.liferay.portal.service.UserGroupRoleServiceUtil;
23
24
61 public class UserGroupRoleServiceHttp {
62 public static void addUserGroupRoles(HttpPrincipal httpPrincipal,
63 long userId, long groupId, long[] roleIds)
64 throws com.liferay.portal.PortalException,
65 com.liferay.portal.SystemException {
66 try {
67 MethodKey methodKey = new MethodKey(UserGroupRoleServiceUtil.class.getName(),
68 "addUserGroupRoles", _addUserGroupRolesParameterTypes0);
69
70 MethodHandler methodHandler = new MethodHandler(methodKey, userId,
71 groupId, roleIds);
72
73 try {
74 TunnelUtil.invoke(httpPrincipal, methodHandler);
75 }
76 catch (Exception e) {
77 if (e instanceof com.liferay.portal.PortalException) {
78 throw (com.liferay.portal.PortalException)e;
79 }
80
81 if (e instanceof com.liferay.portal.SystemException) {
82 throw (com.liferay.portal.SystemException)e;
83 }
84
85 throw new com.liferay.portal.SystemException(e);
86 }
87 }
88 catch (com.liferay.portal.SystemException se) {
89 _log.error(se, se);
90
91 throw se;
92 }
93 }
94
95 public static void addUserGroupRoles(HttpPrincipal httpPrincipal,
96 long[] userIds, long groupId, long roleId)
97 throws com.liferay.portal.PortalException,
98 com.liferay.portal.SystemException {
99 try {
100 MethodKey methodKey = new MethodKey(UserGroupRoleServiceUtil.class.getName(),
101 "addUserGroupRoles", _addUserGroupRolesParameterTypes1);
102
103 MethodHandler methodHandler = new MethodHandler(methodKey, userIds,
104 groupId, roleId);
105
106 try {
107 TunnelUtil.invoke(httpPrincipal, methodHandler);
108 }
109 catch (Exception e) {
110 if (e instanceof com.liferay.portal.PortalException) {
111 throw (com.liferay.portal.PortalException)e;
112 }
113
114 if (e instanceof com.liferay.portal.SystemException) {
115 throw (com.liferay.portal.SystemException)e;
116 }
117
118 throw new com.liferay.portal.SystemException(e);
119 }
120 }
121 catch (com.liferay.portal.SystemException se) {
122 _log.error(se, se);
123
124 throw se;
125 }
126 }
127
128 public static void deleteUserGroupRoles(HttpPrincipal httpPrincipal,
129 long userId, long groupId, long[] roleIds)
130 throws com.liferay.portal.PortalException,
131 com.liferay.portal.SystemException {
132 try {
133 MethodKey methodKey = new MethodKey(UserGroupRoleServiceUtil.class.getName(),
134 "deleteUserGroupRoles", _deleteUserGroupRolesParameterTypes2);
135
136 MethodHandler methodHandler = new MethodHandler(methodKey, userId,
137 groupId, roleIds);
138
139 try {
140 TunnelUtil.invoke(httpPrincipal, methodHandler);
141 }
142 catch (Exception e) {
143 if (e instanceof com.liferay.portal.PortalException) {
144 throw (com.liferay.portal.PortalException)e;
145 }
146
147 if (e instanceof com.liferay.portal.SystemException) {
148 throw (com.liferay.portal.SystemException)e;
149 }
150
151 throw new com.liferay.portal.SystemException(e);
152 }
153 }
154 catch (com.liferay.portal.SystemException se) {
155 _log.error(se, se);
156
157 throw se;
158 }
159 }
160
161 public static void deleteUserGroupRoles(HttpPrincipal httpPrincipal,
162 long[] userIds, long groupId, long roleId)
163 throws com.liferay.portal.PortalException,
164 com.liferay.portal.SystemException {
165 try {
166 MethodKey methodKey = new MethodKey(UserGroupRoleServiceUtil.class.getName(),
167 "deleteUserGroupRoles", _deleteUserGroupRolesParameterTypes3);
168
169 MethodHandler methodHandler = new MethodHandler(methodKey, userIds,
170 groupId, roleId);
171
172 try {
173 TunnelUtil.invoke(httpPrincipal, methodHandler);
174 }
175 catch (Exception e) {
176 if (e instanceof com.liferay.portal.PortalException) {
177 throw (com.liferay.portal.PortalException)e;
178 }
179
180 if (e instanceof com.liferay.portal.SystemException) {
181 throw (com.liferay.portal.SystemException)e;
182 }
183
184 throw new com.liferay.portal.SystemException(e);
185 }
186 }
187 catch (com.liferay.portal.SystemException se) {
188 _log.error(se, se);
189
190 throw se;
191 }
192 }
193
194 private static Log _log = LogFactoryUtil.getLog(UserGroupRoleServiceHttp.class);
195 private static final Class<?>[] _addUserGroupRolesParameterTypes0 = new Class[] {
196 long.class, long.class, long[].class
197 };
198 private static final Class<?>[] _addUserGroupRolesParameterTypes1 = new Class[] {
199 long[].class, long.class, long.class
200 };
201 private static final Class<?>[] _deleteUserGroupRolesParameterTypes2 = new Class[] {
202 long.class, long.class, long[].class
203 };
204 private static final Class<?>[] _deleteUserGroupRolesParameterTypes3 = new Class[] {
205 long[].class, long.class, long.class
206 };
207 }