1   /**
2    * Copyright (c) 2000-2008 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  /**
27   * <a href="PasswordPolicyLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * <p>
35   * This class provides static methods for the
36   * <code>com.liferay.portal.service.PasswordPolicyLocalService</code>
37   * bean. The static methods of this class calls the same methods of the bean
38   * instance. It's convenient to be able to just write one line to call a method
39   * on a bean instead of writing a lookup call and a method call.
40   * </p>
41   *
42   * <p>
43   * <code>com.liferay.portal.service.PasswordPolicyLocalServiceFactory</code>
44   * is responsible for the lookup of the bean.
45   * </p>
46   *
47   * @author Brian Wing Shun Chan
48   *
49   * @see com.liferay.portal.service.PasswordPolicyLocalService
50   * @see com.liferay.portal.service.PasswordPolicyLocalServiceFactory
51   *
52   */
53  public class PasswordPolicyLocalServiceUtil {
54      public static com.liferay.portal.model.PasswordPolicy addPasswordPolicy(
55          com.liferay.portal.model.PasswordPolicy passwordPolicy)
56          throws com.liferay.portal.SystemException {
57          PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
58  
59          return passwordPolicyLocalService.addPasswordPolicy(passwordPolicy);
60      }
61  
62      public static void deletePasswordPolicy(long passwordPolicyId)
63          throws com.liferay.portal.PortalException,
64              com.liferay.portal.SystemException {
65          PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
66  
67          passwordPolicyLocalService.deletePasswordPolicy(passwordPolicyId);
68      }
69  
70      public static void deletePasswordPolicy(
71          com.liferay.portal.model.PasswordPolicy passwordPolicy)
72          throws com.liferay.portal.PortalException,
73              com.liferay.portal.SystemException {
74          PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
75  
76          passwordPolicyLocalService.deletePasswordPolicy(passwordPolicy);
77      }
78  
79      public static java.util.List<com.liferay.portal.model.PasswordPolicy> dynamicQuery(
80          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
81          throws com.liferay.portal.SystemException {
82          PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
83  
84          return passwordPolicyLocalService.dynamicQuery(queryInitializer);
85      }
86  
87      public static java.util.List<com.liferay.portal.model.PasswordPolicy> dynamicQuery(
88          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
89          int begin, int end) throws com.liferay.portal.SystemException {
90          PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
91  
92          return passwordPolicyLocalService.dynamicQuery(queryInitializer, begin,
93              end);
94      }
95  
96      public static com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
97          com.liferay.portal.model.PasswordPolicy passwordPolicy)
98          throws com.liferay.portal.SystemException {
99          PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
100 
101         return passwordPolicyLocalService.updatePasswordPolicy(passwordPolicy);
102     }
103 
104     public static com.liferay.portal.model.PasswordPolicy addPasswordPolicy(
105         long userId, boolean defaultPolicy, java.lang.String name,
106         java.lang.String description, boolean changeable,
107         boolean changeRequired, long minAge, boolean checkSyntax,
108         boolean allowDictionaryWords, int minLength, boolean history,
109         int historyCount, boolean expireable, long maxAge, long warningTime,
110         int graceLimit, boolean lockout, int maxFailure, long lockoutDuration,
111         long resetFailureCount)
112         throws com.liferay.portal.PortalException,
113             com.liferay.portal.SystemException {
114         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
115 
116         return passwordPolicyLocalService.addPasswordPolicy(userId,
117             defaultPolicy, name, description, changeable, changeRequired,
118             minAge, checkSyntax, allowDictionaryWords, minLength, history,
119             historyCount, expireable, maxAge, warningTime, graceLimit, lockout,
120             maxFailure, lockoutDuration, resetFailureCount);
121     }
122 
123     public static void checkDefaultPasswordPolicy(long companyId)
124         throws com.liferay.portal.PortalException,
125             com.liferay.portal.SystemException {
126         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
127 
128         passwordPolicyLocalService.checkDefaultPasswordPolicy(companyId);
129     }
130 
131     public static com.liferay.portal.model.PasswordPolicy getDefaultPasswordPolicy(
132         long companyId)
133         throws com.liferay.portal.PortalException,
134             com.liferay.portal.SystemException {
135         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
136 
137         return passwordPolicyLocalService.getDefaultPasswordPolicy(companyId);
138     }
139 
140     public static com.liferay.portal.model.PasswordPolicy getPasswordPolicy(
141         long passwordPolicyId)
142         throws com.liferay.portal.PortalException,
143             com.liferay.portal.SystemException {
144         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
145 
146         return passwordPolicyLocalService.getPasswordPolicy(passwordPolicyId);
147     }
148 
149     public static com.liferay.portal.model.PasswordPolicy getPasswordPolicy(
150         long companyId, long organizationId, long locationId)
151         throws com.liferay.portal.PortalException,
152             com.liferay.portal.SystemException {
153         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
154 
155         return passwordPolicyLocalService.getPasswordPolicy(companyId,
156             organizationId, locationId);
157     }
158 
159     public static com.liferay.portal.model.PasswordPolicy getPasswordPolicy(
160         long companyId, long[] organizationIds)
161         throws com.liferay.portal.PortalException,
162             com.liferay.portal.SystemException {
163         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
164 
165         return passwordPolicyLocalService.getPasswordPolicy(companyId,
166             organizationIds);
167     }
168 
169     public static com.liferay.portal.model.PasswordPolicy getPasswordPolicyByUserId(
170         long userId)
171         throws com.liferay.portal.PortalException,
172             com.liferay.portal.SystemException {
173         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
174 
175         return passwordPolicyLocalService.getPasswordPolicyByUserId(userId);
176     }
177 
178     public static java.util.List<com.liferay.portal.model.PasswordPolicy> search(
179         long companyId, java.lang.String name, int begin, int end,
180         com.liferay.portal.kernel.util.OrderByComparator obc)
181         throws com.liferay.portal.SystemException {
182         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
183 
184         return passwordPolicyLocalService.search(companyId, name, begin, end,
185             obc);
186     }
187 
188     public static int searchCount(long companyId, java.lang.String name)
189         throws com.liferay.portal.SystemException {
190         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
191 
192         return passwordPolicyLocalService.searchCount(companyId, name);
193     }
194 
195     public static com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
196         long passwordPolicyId, java.lang.String name,
197         java.lang.String description, boolean changeable,
198         boolean changeRequired, long minAge, boolean checkSyntax,
199         boolean allowDictionaryWords, int minLength, boolean history,
200         int historyCount, boolean expireable, long maxAge, long warningTime,
201         int graceLimit, boolean lockout, int maxFailure, long lockoutDuration,
202         long resetFailureCount)
203         throws com.liferay.portal.PortalException,
204             com.liferay.portal.SystemException {
205         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
206 
207         return passwordPolicyLocalService.updatePasswordPolicy(passwordPolicyId,
208             name, description, changeable, changeRequired, minAge, checkSyntax,
209             allowDictionaryWords, minLength, history, historyCount, expireable,
210             maxAge, warningTime, graceLimit, lockout, maxFailure,
211             lockoutDuration, resetFailureCount);
212     }
213 }