001
014
015 package com.liferay.portal.service.http;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.kernel.util.MethodHandler;
020 import com.liferay.portal.kernel.util.MethodKey;
021 import com.liferay.portal.security.auth.HttpPrincipal;
022 import com.liferay.portal.service.UserGroupRoleServiceUtil;
023
024
054 public class UserGroupRoleServiceHttp {
055 public static void addUserGroupRoles(HttpPrincipal httpPrincipal,
056 long userId, long groupId, long[] roleIds)
057 throws com.liferay.portal.kernel.exception.PortalException,
058 com.liferay.portal.kernel.exception.SystemException {
059 try {
060 MethodKey methodKey = new MethodKey(UserGroupRoleServiceUtil.class.getName(),
061 "addUserGroupRoles", _addUserGroupRolesParameterTypes0);
062
063 MethodHandler methodHandler = new MethodHandler(methodKey, userId,
064 groupId, roleIds);
065
066 try {
067 TunnelUtil.invoke(httpPrincipal, methodHandler);
068 }
069 catch (Exception e) {
070 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
071 throw (com.liferay.portal.kernel.exception.PortalException)e;
072 }
073
074 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
075 throw (com.liferay.portal.kernel.exception.SystemException)e;
076 }
077
078 throw new com.liferay.portal.kernel.exception.SystemException(e);
079 }
080 }
081 catch (com.liferay.portal.kernel.exception.SystemException se) {
082 _log.error(se, se);
083
084 throw se;
085 }
086 }
087
088 public static void addUserGroupRoles(HttpPrincipal httpPrincipal,
089 long[] userIds, long groupId, long roleId)
090 throws com.liferay.portal.kernel.exception.PortalException,
091 com.liferay.portal.kernel.exception.SystemException {
092 try {
093 MethodKey methodKey = new MethodKey(UserGroupRoleServiceUtil.class.getName(),
094 "addUserGroupRoles", _addUserGroupRolesParameterTypes1);
095
096 MethodHandler methodHandler = new MethodHandler(methodKey, userIds,
097 groupId, roleId);
098
099 try {
100 TunnelUtil.invoke(httpPrincipal, methodHandler);
101 }
102 catch (Exception e) {
103 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
104 throw (com.liferay.portal.kernel.exception.PortalException)e;
105 }
106
107 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
108 throw (com.liferay.portal.kernel.exception.SystemException)e;
109 }
110
111 throw new com.liferay.portal.kernel.exception.SystemException(e);
112 }
113 }
114 catch (com.liferay.portal.kernel.exception.SystemException se) {
115 _log.error(se, se);
116
117 throw se;
118 }
119 }
120
121 public static void deleteUserGroupRoles(HttpPrincipal httpPrincipal,
122 long userId, long groupId, long[] roleIds)
123 throws com.liferay.portal.kernel.exception.PortalException,
124 com.liferay.portal.kernel.exception.SystemException {
125 try {
126 MethodKey methodKey = new MethodKey(UserGroupRoleServiceUtil.class.getName(),
127 "deleteUserGroupRoles", _deleteUserGroupRolesParameterTypes2);
128
129 MethodHandler methodHandler = new MethodHandler(methodKey, userId,
130 groupId, roleIds);
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 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
141 throw (com.liferay.portal.kernel.exception.SystemException)e;
142 }
143
144 throw new com.liferay.portal.kernel.exception.SystemException(e);
145 }
146 }
147 catch (com.liferay.portal.kernel.exception.SystemException se) {
148 _log.error(se, se);
149
150 throw se;
151 }
152 }
153
154 public static void deleteUserGroupRoles(HttpPrincipal httpPrincipal,
155 long[] userIds, long groupId, long roleId)
156 throws com.liferay.portal.kernel.exception.PortalException,
157 com.liferay.portal.kernel.exception.SystemException {
158 try {
159 MethodKey methodKey = new MethodKey(UserGroupRoleServiceUtil.class.getName(),
160 "deleteUserGroupRoles", _deleteUserGroupRolesParameterTypes3);
161
162 MethodHandler methodHandler = new MethodHandler(methodKey, userIds,
163 groupId, roleId);
164
165 try {
166 TunnelUtil.invoke(httpPrincipal, methodHandler);
167 }
168 catch (Exception e) {
169 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
170 throw (com.liferay.portal.kernel.exception.PortalException)e;
171 }
172
173 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
174 throw (com.liferay.portal.kernel.exception.SystemException)e;
175 }
176
177 throw new com.liferay.portal.kernel.exception.SystemException(e);
178 }
179 }
180 catch (com.liferay.portal.kernel.exception.SystemException se) {
181 _log.error(se, se);
182
183 throw se;
184 }
185 }
186
187 private static Log _log = LogFactoryUtil.getLog(UserGroupRoleServiceHttp.class);
188 private static final Class<?>[] _addUserGroupRolesParameterTypes0 = new Class[] {
189 long.class, long.class, long[].class
190 };
191 private static final Class<?>[] _addUserGroupRolesParameterTypes1 = new Class[] {
192 long[].class, long.class, long.class
193 };
194 private static final Class<?>[] _deleteUserGroupRolesParameterTypes2 = new Class[] {
195 long.class, long.class, long[].class
196 };
197 private static final Class<?>[] _deleteUserGroupRolesParameterTypes3 = new Class[] {
198 long[].class, long.class, long.class
199 };
200 }