001
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.UserGroupRoleServiceUtil;
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
055 @ProviderType
056 public class UserGroupRoleServiceHttp {
057 public static void addUserGroupRoles(HttpPrincipal httpPrincipal,
058 long userId, long groupId, long[] roleIds)
059 throws com.liferay.portal.kernel.exception.PortalException {
060 try {
061 MethodKey methodKey = new MethodKey(UserGroupRoleServiceUtil.class,
062 "addUserGroupRoles", _addUserGroupRolesParameterTypes0);
063
064 MethodHandler methodHandler = new MethodHandler(methodKey, userId,
065 groupId, roleIds);
066
067 try {
068 TunnelUtil.invoke(httpPrincipal, methodHandler);
069 }
070 catch (Exception e) {
071 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
072 throw (com.liferay.portal.kernel.exception.PortalException)e;
073 }
074
075 throw new com.liferay.portal.kernel.exception.SystemException(e);
076 }
077 }
078 catch (com.liferay.portal.kernel.exception.SystemException se) {
079 _log.error(se, se);
080
081 throw se;
082 }
083 }
084
085 public static void addUserGroupRoles(HttpPrincipal httpPrincipal,
086 long[] userIds, long groupId, long roleId)
087 throws com.liferay.portal.kernel.exception.PortalException {
088 try {
089 MethodKey methodKey = new MethodKey(UserGroupRoleServiceUtil.class,
090 "addUserGroupRoles", _addUserGroupRolesParameterTypes1);
091
092 MethodHandler methodHandler = new MethodHandler(methodKey, userIds,
093 groupId, roleId);
094
095 try {
096 TunnelUtil.invoke(httpPrincipal, methodHandler);
097 }
098 catch (Exception e) {
099 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
100 throw (com.liferay.portal.kernel.exception.PortalException)e;
101 }
102
103 throw new com.liferay.portal.kernel.exception.SystemException(e);
104 }
105 }
106 catch (com.liferay.portal.kernel.exception.SystemException se) {
107 _log.error(se, se);
108
109 throw se;
110 }
111 }
112
113 public static void deleteUserGroupRoles(HttpPrincipal httpPrincipal,
114 long userId, long groupId, long[] roleIds)
115 throws com.liferay.portal.kernel.exception.PortalException {
116 try {
117 MethodKey methodKey = new MethodKey(UserGroupRoleServiceUtil.class,
118 "deleteUserGroupRoles", _deleteUserGroupRolesParameterTypes2);
119
120 MethodHandler methodHandler = new MethodHandler(methodKey, userId,
121 groupId, roleIds);
122
123 try {
124 TunnelUtil.invoke(httpPrincipal, methodHandler);
125 }
126 catch (Exception e) {
127 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
128 throw (com.liferay.portal.kernel.exception.PortalException)e;
129 }
130
131 throw new com.liferay.portal.kernel.exception.SystemException(e);
132 }
133 }
134 catch (com.liferay.portal.kernel.exception.SystemException se) {
135 _log.error(se, se);
136
137 throw se;
138 }
139 }
140
141 public static void deleteUserGroupRoles(HttpPrincipal httpPrincipal,
142 long[] userIds, long groupId, long roleId)
143 throws com.liferay.portal.kernel.exception.PortalException {
144 try {
145 MethodKey methodKey = new MethodKey(UserGroupRoleServiceUtil.class,
146 "deleteUserGroupRoles", _deleteUserGroupRolesParameterTypes3);
147
148 MethodHandler methodHandler = new MethodHandler(methodKey, userIds,
149 groupId, roleId);
150
151 try {
152 TunnelUtil.invoke(httpPrincipal, methodHandler);
153 }
154 catch (Exception e) {
155 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
156 throw (com.liferay.portal.kernel.exception.PortalException)e;
157 }
158
159 throw new com.liferay.portal.kernel.exception.SystemException(e);
160 }
161 }
162 catch (com.liferay.portal.kernel.exception.SystemException se) {
163 _log.error(se, se);
164
165 throw se;
166 }
167 }
168
169 private static Log _log = LogFactoryUtil.getLog(UserGroupRoleServiceHttp.class);
170 private static final Class<?>[] _addUserGroupRolesParameterTypes0 = new Class[] {
171 long.class, long.class, long[].class
172 };
173 private static final Class<?>[] _addUserGroupRolesParameterTypes1 = new Class[] {
174 long[].class, long.class, long.class
175 };
176 private static final Class<?>[] _deleteUserGroupRolesParameterTypes2 = new Class[] {
177 long.class, long.class, long[].class
178 };
179 private static final Class<?>[] _deleteUserGroupRolesParameterTypes3 = new Class[] {
180 long[].class, long.class, long.class
181 };
182 }