1
22
23 package com.liferay.portal.service.http;
24
25 import com.liferay.portal.kernel.log.Log;
26 import com.liferay.portal.kernel.log.LogFactoryUtil;
27 import com.liferay.portal.kernel.util.BooleanWrapper;
28 import com.liferay.portal.kernel.util.IntegerWrapper;
29 import com.liferay.portal.kernel.util.LongWrapper;
30 import com.liferay.portal.kernel.util.MethodWrapper;
31 import com.liferay.portal.kernel.util.NullWrapper;
32 import com.liferay.portal.security.auth.HttpPrincipal;
33 import com.liferay.portal.service.PasswordPolicyServiceUtil;
34 import com.liferay.portal.service.http.TunnelUtil;
35
36
73 public class PasswordPolicyServiceHttp {
74 public static com.liferay.portal.model.PasswordPolicy addPasswordPolicy(
75 HttpPrincipal httpPrincipal, java.lang.String name,
76 java.lang.String description, boolean changeable,
77 boolean changeRequired, long minAge, boolean checkSyntax,
78 boolean allowDictionaryWords, int minLength, boolean history,
79 int historyCount, boolean expireable, long maxAge, long warningTime,
80 int graceLimit, boolean lockout, int maxFailure, long lockoutDuration,
81 long resetFailureCount)
82 throws com.liferay.portal.SystemException,
83 com.liferay.portal.PortalException {
84 try {
85 Object paramObj0 = name;
86
87 if (name == null) {
88 paramObj0 = new NullWrapper("java.lang.String");
89 }
90
91 Object paramObj1 = description;
92
93 if (description == null) {
94 paramObj1 = new NullWrapper("java.lang.String");
95 }
96
97 Object paramObj2 = new BooleanWrapper(changeable);
98 Object paramObj3 = new BooleanWrapper(changeRequired);
99 Object paramObj4 = new LongWrapper(minAge);
100 Object paramObj5 = new BooleanWrapper(checkSyntax);
101 Object paramObj6 = new BooleanWrapper(allowDictionaryWords);
102 Object paramObj7 = new IntegerWrapper(minLength);
103 Object paramObj8 = new BooleanWrapper(history);
104 Object paramObj9 = new IntegerWrapper(historyCount);
105 Object paramObj10 = new BooleanWrapper(expireable);
106 Object paramObj11 = new LongWrapper(maxAge);
107 Object paramObj12 = new LongWrapper(warningTime);
108 Object paramObj13 = new IntegerWrapper(graceLimit);
109 Object paramObj14 = new BooleanWrapper(lockout);
110 Object paramObj15 = new IntegerWrapper(maxFailure);
111 Object paramObj16 = new LongWrapper(lockoutDuration);
112 Object paramObj17 = new LongWrapper(resetFailureCount);
113 MethodWrapper methodWrapper = new MethodWrapper(PasswordPolicyServiceUtil.class.getName(),
114 "addPasswordPolicy",
115 new Object[] {
116 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
117 paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
118 paramObj10, paramObj11, paramObj12, paramObj13,
119 paramObj14, paramObj15, paramObj16, paramObj17
120 });
121 Object returnObj = null;
122
123 try {
124 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
125 }
126 catch (Exception e) {
127 if (e instanceof com.liferay.portal.SystemException) {
128 throw (com.liferay.portal.SystemException)e;
129 }
130
131 if (e instanceof com.liferay.portal.PortalException) {
132 throw (com.liferay.portal.PortalException)e;
133 }
134
135 throw new com.liferay.portal.SystemException(e);
136 }
137
138 return (com.liferay.portal.model.PasswordPolicy)returnObj;
139 }
140 catch (com.liferay.portal.SystemException se) {
141 _log.error(se, se);
142 throw se;
143 }
144 }
145
146 public static void deletePasswordPolicy(HttpPrincipal httpPrincipal,
147 long passwordPolicyId)
148 throws com.liferay.portal.SystemException,
149 com.liferay.portal.PortalException {
150 try {
151 Object paramObj0 = new LongWrapper(passwordPolicyId);
152 MethodWrapper methodWrapper = new MethodWrapper(PasswordPolicyServiceUtil.class.getName(),
153 "deletePasswordPolicy", new Object[] { paramObj0 });
154
155 try {
156 TunnelUtil.invoke(httpPrincipal, methodWrapper);
157 }
158 catch (Exception e) {
159 if (e instanceof com.liferay.portal.SystemException) {
160 throw (com.liferay.portal.SystemException)e;
161 }
162
163 if (e instanceof com.liferay.portal.PortalException) {
164 throw (com.liferay.portal.PortalException)e;
165 }
166
167 throw new com.liferay.portal.SystemException(e);
168 }
169 }
170 catch (com.liferay.portal.SystemException se) {
171 _log.error(se, se);
172 throw se;
173 }
174 }
175
176 public static com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
177 HttpPrincipal httpPrincipal, long passwordPolicyId,
178 java.lang.String name, java.lang.String description,
179 boolean changeable, boolean changeRequired, long minAge,
180 boolean checkSyntax, boolean allowDictionaryWords, int minLength,
181 boolean history, int historyCount, boolean expireable, long maxAge,
182 long warningTime, int graceLimit, boolean lockout, int maxFailure,
183 long lockoutDuration, long resetFailureCount)
184 throws com.liferay.portal.SystemException,
185 com.liferay.portal.PortalException {
186 try {
187 Object paramObj0 = new LongWrapper(passwordPolicyId);
188 Object paramObj1 = name;
189
190 if (name == null) {
191 paramObj1 = new NullWrapper("java.lang.String");
192 }
193
194 Object paramObj2 = description;
195
196 if (description == null) {
197 paramObj2 = new NullWrapper("java.lang.String");
198 }
199
200 Object paramObj3 = new BooleanWrapper(changeable);
201 Object paramObj4 = new BooleanWrapper(changeRequired);
202 Object paramObj5 = new LongWrapper(minAge);
203 Object paramObj6 = new BooleanWrapper(checkSyntax);
204 Object paramObj7 = new BooleanWrapper(allowDictionaryWords);
205 Object paramObj8 = new IntegerWrapper(minLength);
206 Object paramObj9 = new BooleanWrapper(history);
207 Object paramObj10 = new IntegerWrapper(historyCount);
208 Object paramObj11 = new BooleanWrapper(expireable);
209 Object paramObj12 = new LongWrapper(maxAge);
210 Object paramObj13 = new LongWrapper(warningTime);
211 Object paramObj14 = new IntegerWrapper(graceLimit);
212 Object paramObj15 = new BooleanWrapper(lockout);
213 Object paramObj16 = new IntegerWrapper(maxFailure);
214 Object paramObj17 = new LongWrapper(lockoutDuration);
215 Object paramObj18 = new LongWrapper(resetFailureCount);
216 MethodWrapper methodWrapper = new MethodWrapper(PasswordPolicyServiceUtil.class.getName(),
217 "updatePasswordPolicy",
218 new Object[] {
219 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
220 paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
221 paramObj10, paramObj11, paramObj12, paramObj13,
222 paramObj14, paramObj15, paramObj16, paramObj17,
223 paramObj18
224 });
225 Object returnObj = null;
226
227 try {
228 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
229 }
230 catch (Exception e) {
231 if (e instanceof com.liferay.portal.SystemException) {
232 throw (com.liferay.portal.SystemException)e;
233 }
234
235 if (e instanceof com.liferay.portal.PortalException) {
236 throw (com.liferay.portal.PortalException)e;
237 }
238
239 throw new com.liferay.portal.SystemException(e);
240 }
241
242 return (com.liferay.portal.model.PasswordPolicy)returnObj;
243 }
244 catch (com.liferay.portal.SystemException se) {
245 _log.error(se, se);
246 throw se;
247 }
248 }
249
250 private static Log _log = LogFactoryUtil.getLog(PasswordPolicyServiceHttp.class);
251 }