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.SystemException {
73          PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
74  
75          passwordPolicyLocalService.deletePasswordPolicy(passwordPolicy);
76      }
77  
78      public static java.util.List<Object> dynamicQuery(
79          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
80          throws com.liferay.portal.SystemException {
81          PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
82  
83          return passwordPolicyLocalService.dynamicQuery(dynamicQuery);
84      }
85  
86      public static java.util.List<Object> dynamicQuery(
87          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
88          int end) throws com.liferay.portal.SystemException {
89          PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
90  
91          return passwordPolicyLocalService.dynamicQuery(dynamicQuery, start, end);
92      }
93  
94      public static com.liferay.portal.model.PasswordPolicy getPasswordPolicy(
95          long passwordPolicyId)
96          throws com.liferay.portal.PortalException,
97              com.liferay.portal.SystemException {
98          PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
99  
100         return passwordPolicyLocalService.getPasswordPolicy(passwordPolicyId);
101     }
102 
103     public static com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
104         com.liferay.portal.model.PasswordPolicy passwordPolicy)
105         throws com.liferay.portal.SystemException {
106         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
107 
108         return passwordPolicyLocalService.updatePasswordPolicy(passwordPolicy);
109     }
110 
111     public static com.liferay.portal.model.PasswordPolicy addPasswordPolicy(
112         long userId, boolean defaultPolicy, java.lang.String name,
113         java.lang.String description, boolean changeable,
114         boolean changeRequired, long minAge, boolean checkSyntax,
115         boolean allowDictionaryWords, int minLength, boolean history,
116         int historyCount, boolean expireable, long maxAge, long warningTime,
117         int graceLimit, boolean lockout, int maxFailure, long lockoutDuration,
118         long resetFailureCount)
119         throws com.liferay.portal.PortalException,
120             com.liferay.portal.SystemException {
121         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
122 
123         return passwordPolicyLocalService.addPasswordPolicy(userId,
124             defaultPolicy, name, description, changeable, changeRequired,
125             minAge, checkSyntax, allowDictionaryWords, minLength, history,
126             historyCount, expireable, maxAge, warningTime, graceLimit, lockout,
127             maxFailure, lockoutDuration, resetFailureCount);
128     }
129 
130     public static void checkDefaultPasswordPolicy(long companyId)
131         throws com.liferay.portal.PortalException,
132             com.liferay.portal.SystemException {
133         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
134 
135         passwordPolicyLocalService.checkDefaultPasswordPolicy(companyId);
136     }
137 
138     public static com.liferay.portal.model.PasswordPolicy getDefaultPasswordPolicy(
139         long companyId)
140         throws com.liferay.portal.PortalException,
141             com.liferay.portal.SystemException {
142         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
143 
144         return passwordPolicyLocalService.getDefaultPasswordPolicy(companyId);
145     }
146 
147     public static com.liferay.portal.model.PasswordPolicy getPasswordPolicy(
148         long companyId, long organizationId, long locationId)
149         throws com.liferay.portal.PortalException,
150             com.liferay.portal.SystemException {
151         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
152 
153         return passwordPolicyLocalService.getPasswordPolicy(companyId,
154             organizationId, locationId);
155     }
156 
157     public static com.liferay.portal.model.PasswordPolicy getPasswordPolicy(
158         long companyId, long[] organizationIds)
159         throws com.liferay.portal.PortalException,
160             com.liferay.portal.SystemException {
161         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
162 
163         return passwordPolicyLocalService.getPasswordPolicy(companyId,
164             organizationIds);
165     }
166 
167     public static com.liferay.portal.model.PasswordPolicy getPasswordPolicyByUserId(
168         long userId)
169         throws com.liferay.portal.PortalException,
170             com.liferay.portal.SystemException {
171         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
172 
173         return passwordPolicyLocalService.getPasswordPolicyByUserId(userId);
174     }
175 
176     public static java.util.List<com.liferay.portal.model.PasswordPolicy> search(
177         long companyId, java.lang.String name, int start, int end,
178         com.liferay.portal.kernel.util.OrderByComparator obc)
179         throws com.liferay.portal.SystemException {
180         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
181 
182         return passwordPolicyLocalService.search(companyId, name, start, end,
183             obc);
184     }
185 
186     public static int searchCount(long companyId, java.lang.String name)
187         throws com.liferay.portal.SystemException {
188         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
189 
190         return passwordPolicyLocalService.searchCount(companyId, name);
191     }
192 
193     public static com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
194         long passwordPolicyId, java.lang.String name,
195         java.lang.String description, boolean changeable,
196         boolean changeRequired, long minAge, boolean checkSyntax,
197         boolean allowDictionaryWords, int minLength, boolean history,
198         int historyCount, boolean expireable, long maxAge, long warningTime,
199         int graceLimit, boolean lockout, int maxFailure, long lockoutDuration,
200         long resetFailureCount)
201         throws com.liferay.portal.PortalException,
202             com.liferay.portal.SystemException {
203         PasswordPolicyLocalService passwordPolicyLocalService = PasswordPolicyLocalServiceFactory.getService();
204 
205         return passwordPolicyLocalService.updatePasswordPolicy(passwordPolicyId,
206             name, description, changeable, changeRequired, minAge, checkSyntax,
207             allowDictionaryWords, minLength, history, historyCount, expireable,
208             maxAge, warningTime, graceLimit, lockout, maxFailure,
209             lockoutDuration, resetFailureCount);
210     }
211 }