1   /**
2    * Copyright (c) 2000-2007 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service;
24  
25  /**
26   * <a href="PasswordPolicyLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be overwritten
30   * the next time is generated.
31   * </p>
32   *
33   * <p>
34   * This class provides static methods for the <code>com.liferay.portal.service.PasswordPolicyLocalService</code>
35   * bean. The static methods of this class calls the same methods of the bean instance.
36   * It's convenient to be able to just write one line to call a method on a bean
37   * instead of writing a lookup call and a method call.
38   * </p>
39   *
40   * <p>
41   * <code>com.liferay.portal.service.PasswordPolicyLocalServiceFactory</code> is
42   * responsible for the lookup of the bean.
43   * </p>
44   *
45   * @author Brian Wing Shun Chan
46   *
47   * @see com.liferay.portal.service.PasswordPolicyLocalService
48   * @see com.liferay.portal.service.PasswordPolicyLocalServiceFactory
49   *
50   */
51  public class PasswordPolicyLocalServiceUtil {
52      public static com.liferay.portal.model.PasswordPolicy addPasswordPolicy(
53          com.liferay.portal.model.PasswordPolicy model)
54          throws com.liferay.portal.SystemException {
55          PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
56  
57          return passwordPolicyLocalService.addPasswordPolicy(model);
58      }
59  
60      public static java.util.List dynamicQuery(
61          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
62          throws com.liferay.portal.SystemException {
63          PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
64  
65          return passwordPolicyLocalService.dynamicQuery(queryInitializer);
66      }
67  
68      public static java.util.List dynamicQuery(
69          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
70          int begin, int end) throws com.liferay.portal.SystemException {
71          PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
72  
73          return passwordPolicyLocalService.dynamicQuery(queryInitializer, begin,
74              end);
75      }
76  
77      public static com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
78          com.liferay.portal.model.PasswordPolicy model)
79          throws com.liferay.portal.SystemException {
80          PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
81  
82          return passwordPolicyLocalService.updatePasswordPolicy(model);
83      }
84  
85      public static com.liferay.portal.model.PasswordPolicy addPasswordPolicy(
86          long userId, boolean defaultPolicy, java.lang.String name,
87          java.lang.String description, boolean changeable,
88          boolean changeRequired, long minAge, boolean checkSyntax,
89          boolean allowDictionaryWords, int minLength, boolean history,
90          int historyCount, boolean expireable, long maxAge, long warningTime,
91          int graceLimit, boolean lockout, int maxFailure, long lockoutDuration,
92          long resetFailureCount)
93          throws com.liferay.portal.PortalException, 
94              com.liferay.portal.SystemException {
95          PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
96  
97          return passwordPolicyLocalService.addPasswordPolicy(userId,
98              defaultPolicy, name, description, changeable, changeRequired,
99              minAge, checkSyntax, allowDictionaryWords, minLength, history,
100             historyCount, expireable, maxAge, warningTime, graceLimit, lockout,
101             maxFailure, lockoutDuration, resetFailureCount);
102     }
103 
104     public static void checkDefaultPasswordPolicy(long companyId)
105         throws com.liferay.portal.PortalException, 
106             com.liferay.portal.SystemException {
107         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
108         passwordPolicyLocalService.checkDefaultPasswordPolicy(companyId);
109     }
110 
111     public static void deletePasswordPolicy(long passwordPolicyId)
112         throws com.liferay.portal.PortalException, 
113             com.liferay.portal.SystemException {
114         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
115         passwordPolicyLocalService.deletePasswordPolicy(passwordPolicyId);
116     }
117 
118     public static com.liferay.portal.model.PasswordPolicy getDefaultPasswordPolicy(
119         long companyId)
120         throws com.liferay.portal.PortalException, 
121             com.liferay.portal.SystemException {
122         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
123 
124         return passwordPolicyLocalService.getDefaultPasswordPolicy(companyId);
125     }
126 
127     public static com.liferay.portal.model.PasswordPolicy getPasswordPolicy(
128         long passwordPolicyId)
129         throws com.liferay.portal.PortalException, 
130             com.liferay.portal.SystemException {
131         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
132 
133         return passwordPolicyLocalService.getPasswordPolicy(passwordPolicyId);
134     }
135 
136     public static com.liferay.portal.model.PasswordPolicy getPasswordPolicy(
137         long companyId, long organizationId, long locationId)
138         throws com.liferay.portal.PortalException, 
139             com.liferay.portal.SystemException {
140         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
141 
142         return passwordPolicyLocalService.getPasswordPolicy(companyId,
143             organizationId, locationId);
144     }
145 
146     public static com.liferay.portal.model.PasswordPolicy getPasswordPolicyByUserId(
147         long userId)
148         throws com.liferay.portal.PortalException, 
149             com.liferay.portal.SystemException {
150         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
151 
152         return passwordPolicyLocalService.getPasswordPolicyByUserId(userId);
153     }
154 
155     public static java.util.List search(long companyId, java.lang.String name,
156         int begin, int end) throws com.liferay.portal.SystemException {
157         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
158 
159         return passwordPolicyLocalService.search(companyId, name, begin, end);
160     }
161 
162     public static int searchCount(long companyId, java.lang.String name)
163         throws com.liferay.portal.SystemException {
164         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
165 
166         return passwordPolicyLocalService.searchCount(companyId, name);
167     }
168 
169     public static com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
170         long passwordPolicyId, java.lang.String name,
171         java.lang.String description, boolean changeable,
172         boolean changeRequired, long minAge, boolean checkSyntax,
173         boolean allowDictionaryWords, int minLength, boolean history,
174         int historyCount, boolean expireable, long maxAge, long warningTime,
175         int graceLimit, boolean lockout, int maxFailure, long lockoutDuration,
176         long resetFailureCount)
177         throws com.liferay.portal.PortalException, 
178             com.liferay.portal.SystemException {
179         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
180 
181         return passwordPolicyLocalService.updatePasswordPolicy(passwordPolicyId,
182             name, description, changeable, changeRequired, minAge, checkSyntax,
183             allowDictionaryWords, minLength, history, historyCount, expireable,
184             maxAge, warningTime, graceLimit, lockout, maxFailure,
185             lockoutDuration, resetFailureCount);
186     }
187 }