001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.base;
016    
017    import com.liferay.portal.kernel.bean.BeanReference;
018    import com.liferay.portal.kernel.dao.db.DB;
019    import com.liferay.portal.kernel.dao.db.DBManagerUtil;
020    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
021    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
022    import com.liferay.portal.kernel.exception.SystemException;
023    import com.liferay.portal.kernel.model.PasswordPolicy;
024    import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
025    import com.liferay.portal.kernel.service.BaseServiceImpl;
026    import com.liferay.portal.kernel.service.PasswordPolicyService;
027    import com.liferay.portal.kernel.service.persistence.ClassNamePersistence;
028    import com.liferay.portal.kernel.service.persistence.PasswordPolicyFinder;
029    import com.liferay.portal.kernel.service.persistence.PasswordPolicyPersistence;
030    import com.liferay.portal.kernel.service.persistence.PasswordPolicyRelPersistence;
031    import com.liferay.portal.kernel.service.persistence.UserFinder;
032    import com.liferay.portal.kernel.service.persistence.UserPersistence;
033    import com.liferay.portal.kernel.util.PortalUtil;
034    
035    import javax.sql.DataSource;
036    
037    /**
038     * Provides the base implementation for the password policy remote service.
039     *
040     * <p>
041     * This implementation exists only as a container for the default service methods generated by ServiceBuilder. All custom service methods should be put in {@link com.liferay.portal.service.impl.PasswordPolicyServiceImpl}.
042     * </p>
043     *
044     * @author Brian Wing Shun Chan
045     * @see com.liferay.portal.service.impl.PasswordPolicyServiceImpl
046     * @see com.liferay.portal.kernel.service.PasswordPolicyServiceUtil
047     * @generated
048     */
049    public abstract class PasswordPolicyServiceBaseImpl extends BaseServiceImpl
050            implements PasswordPolicyService, IdentifiableOSGiService {
051            /*
052             * NOTE FOR DEVELOPERS:
053             *
054             * Never modify or reference this class directly. Always use {@link com.liferay.portal.kernel.service.PasswordPolicyServiceUtil} to access the password policy remote service.
055             */
056    
057            /**
058             * Returns the password policy local service.
059             *
060             * @return the password policy local service
061             */
062            public com.liferay.portal.kernel.service.PasswordPolicyLocalService getPasswordPolicyLocalService() {
063                    return passwordPolicyLocalService;
064            }
065    
066            /**
067             * Sets the password policy local service.
068             *
069             * @param passwordPolicyLocalService the password policy local service
070             */
071            public void setPasswordPolicyLocalService(
072                    com.liferay.portal.kernel.service.PasswordPolicyLocalService passwordPolicyLocalService) {
073                    this.passwordPolicyLocalService = passwordPolicyLocalService;
074            }
075    
076            /**
077             * Returns the password policy remote service.
078             *
079             * @return the password policy remote service
080             */
081            public PasswordPolicyService getPasswordPolicyService() {
082                    return passwordPolicyService;
083            }
084    
085            /**
086             * Sets the password policy remote service.
087             *
088             * @param passwordPolicyService the password policy remote service
089             */
090            public void setPasswordPolicyService(
091                    PasswordPolicyService passwordPolicyService) {
092                    this.passwordPolicyService = passwordPolicyService;
093            }
094    
095            /**
096             * Returns the password policy persistence.
097             *
098             * @return the password policy persistence
099             */
100            public PasswordPolicyPersistence getPasswordPolicyPersistence() {
101                    return passwordPolicyPersistence;
102            }
103    
104            /**
105             * Sets the password policy persistence.
106             *
107             * @param passwordPolicyPersistence the password policy persistence
108             */
109            public void setPasswordPolicyPersistence(
110                    PasswordPolicyPersistence passwordPolicyPersistence) {
111                    this.passwordPolicyPersistence = passwordPolicyPersistence;
112            }
113    
114            /**
115             * Returns the password policy finder.
116             *
117             * @return the password policy finder
118             */
119            public PasswordPolicyFinder getPasswordPolicyFinder() {
120                    return passwordPolicyFinder;
121            }
122    
123            /**
124             * Sets the password policy finder.
125             *
126             * @param passwordPolicyFinder the password policy finder
127             */
128            public void setPasswordPolicyFinder(
129                    PasswordPolicyFinder passwordPolicyFinder) {
130                    this.passwordPolicyFinder = passwordPolicyFinder;
131            }
132    
133            /**
134             * Returns the counter local service.
135             *
136             * @return the counter local service
137             */
138            public com.liferay.counter.kernel.service.CounterLocalService getCounterLocalService() {
139                    return counterLocalService;
140            }
141    
142            /**
143             * Sets the counter local service.
144             *
145             * @param counterLocalService the counter local service
146             */
147            public void setCounterLocalService(
148                    com.liferay.counter.kernel.service.CounterLocalService counterLocalService) {
149                    this.counterLocalService = counterLocalService;
150            }
151    
152            /**
153             * Returns the class name local service.
154             *
155             * @return the class name local service
156             */
157            public com.liferay.portal.kernel.service.ClassNameLocalService getClassNameLocalService() {
158                    return classNameLocalService;
159            }
160    
161            /**
162             * Sets the class name local service.
163             *
164             * @param classNameLocalService the class name local service
165             */
166            public void setClassNameLocalService(
167                    com.liferay.portal.kernel.service.ClassNameLocalService classNameLocalService) {
168                    this.classNameLocalService = classNameLocalService;
169            }
170    
171            /**
172             * Returns the class name remote service.
173             *
174             * @return the class name remote service
175             */
176            public com.liferay.portal.kernel.service.ClassNameService getClassNameService() {
177                    return classNameService;
178            }
179    
180            /**
181             * Sets the class name remote service.
182             *
183             * @param classNameService the class name remote service
184             */
185            public void setClassNameService(
186                    com.liferay.portal.kernel.service.ClassNameService classNameService) {
187                    this.classNameService = classNameService;
188            }
189    
190            /**
191             * Returns the class name persistence.
192             *
193             * @return the class name persistence
194             */
195            public ClassNamePersistence getClassNamePersistence() {
196                    return classNamePersistence;
197            }
198    
199            /**
200             * Sets the class name persistence.
201             *
202             * @param classNamePersistence the class name persistence
203             */
204            public void setClassNamePersistence(
205                    ClassNamePersistence classNamePersistence) {
206                    this.classNamePersistence = classNamePersistence;
207            }
208    
209            /**
210             * Returns the password policy rel local service.
211             *
212             * @return the password policy rel local service
213             */
214            public com.liferay.portal.kernel.service.PasswordPolicyRelLocalService getPasswordPolicyRelLocalService() {
215                    return passwordPolicyRelLocalService;
216            }
217    
218            /**
219             * Sets the password policy rel local service.
220             *
221             * @param passwordPolicyRelLocalService the password policy rel local service
222             */
223            public void setPasswordPolicyRelLocalService(
224                    com.liferay.portal.kernel.service.PasswordPolicyRelLocalService passwordPolicyRelLocalService) {
225                    this.passwordPolicyRelLocalService = passwordPolicyRelLocalService;
226            }
227    
228            /**
229             * Returns the password policy rel persistence.
230             *
231             * @return the password policy rel persistence
232             */
233            public PasswordPolicyRelPersistence getPasswordPolicyRelPersistence() {
234                    return passwordPolicyRelPersistence;
235            }
236    
237            /**
238             * Sets the password policy rel persistence.
239             *
240             * @param passwordPolicyRelPersistence the password policy rel persistence
241             */
242            public void setPasswordPolicyRelPersistence(
243                    PasswordPolicyRelPersistence passwordPolicyRelPersistence) {
244                    this.passwordPolicyRelPersistence = passwordPolicyRelPersistence;
245            }
246    
247            /**
248             * Returns the resource local service.
249             *
250             * @return the resource local service
251             */
252            public com.liferay.portal.kernel.service.ResourceLocalService getResourceLocalService() {
253                    return resourceLocalService;
254            }
255    
256            /**
257             * Sets the resource local service.
258             *
259             * @param resourceLocalService the resource local service
260             */
261            public void setResourceLocalService(
262                    com.liferay.portal.kernel.service.ResourceLocalService resourceLocalService) {
263                    this.resourceLocalService = resourceLocalService;
264            }
265    
266            /**
267             * Returns the user local service.
268             *
269             * @return the user local service
270             */
271            public com.liferay.portal.kernel.service.UserLocalService getUserLocalService() {
272                    return userLocalService;
273            }
274    
275            /**
276             * Sets the user local service.
277             *
278             * @param userLocalService the user local service
279             */
280            public void setUserLocalService(
281                    com.liferay.portal.kernel.service.UserLocalService userLocalService) {
282                    this.userLocalService = userLocalService;
283            }
284    
285            /**
286             * Returns the user remote service.
287             *
288             * @return the user remote service
289             */
290            public com.liferay.portal.kernel.service.UserService getUserService() {
291                    return userService;
292            }
293    
294            /**
295             * Sets the user remote service.
296             *
297             * @param userService the user remote service
298             */
299            public void setUserService(
300                    com.liferay.portal.kernel.service.UserService userService) {
301                    this.userService = userService;
302            }
303    
304            /**
305             * Returns the user persistence.
306             *
307             * @return the user persistence
308             */
309            public UserPersistence getUserPersistence() {
310                    return userPersistence;
311            }
312    
313            /**
314             * Sets the user persistence.
315             *
316             * @param userPersistence the user persistence
317             */
318            public void setUserPersistence(UserPersistence userPersistence) {
319                    this.userPersistence = userPersistence;
320            }
321    
322            /**
323             * Returns the user finder.
324             *
325             * @return the user finder
326             */
327            public UserFinder getUserFinder() {
328                    return userFinder;
329            }
330    
331            /**
332             * Sets the user finder.
333             *
334             * @param userFinder the user finder
335             */
336            public void setUserFinder(UserFinder userFinder) {
337                    this.userFinder = userFinder;
338            }
339    
340            public void afterPropertiesSet() {
341            }
342    
343            public void destroy() {
344            }
345    
346            /**
347             * Returns the OSGi service identifier.
348             *
349             * @return the OSGi service identifier
350             */
351            @Override
352            public String getOSGiServiceIdentifier() {
353                    return PasswordPolicyService.class.getName();
354            }
355    
356            protected Class<?> getModelClass() {
357                    return PasswordPolicy.class;
358            }
359    
360            protected String getModelClassName() {
361                    return PasswordPolicy.class.getName();
362            }
363    
364            /**
365             * Performs a SQL query.
366             *
367             * @param sql the sql query
368             */
369            protected void runSQL(String sql) {
370                    try {
371                            DataSource dataSource = passwordPolicyPersistence.getDataSource();
372    
373                            DB db = DBManagerUtil.getDB();
374    
375                            sql = db.buildSQL(sql);
376                            sql = PortalUtil.transformSQL(sql);
377    
378                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
379                                            sql);
380    
381                            sqlUpdate.update();
382                    }
383                    catch (Exception e) {
384                            throw new SystemException(e);
385                    }
386            }
387    
388            @BeanReference(type = com.liferay.portal.kernel.service.PasswordPolicyLocalService.class)
389            protected com.liferay.portal.kernel.service.PasswordPolicyLocalService passwordPolicyLocalService;
390            @BeanReference(type = PasswordPolicyService.class)
391            protected PasswordPolicyService passwordPolicyService;
392            @BeanReference(type = PasswordPolicyPersistence.class)
393            protected PasswordPolicyPersistence passwordPolicyPersistence;
394            @BeanReference(type = PasswordPolicyFinder.class)
395            protected PasswordPolicyFinder passwordPolicyFinder;
396            @BeanReference(type = com.liferay.counter.kernel.service.CounterLocalService.class)
397            protected com.liferay.counter.kernel.service.CounterLocalService counterLocalService;
398            @BeanReference(type = com.liferay.portal.kernel.service.ClassNameLocalService.class)
399            protected com.liferay.portal.kernel.service.ClassNameLocalService classNameLocalService;
400            @BeanReference(type = com.liferay.portal.kernel.service.ClassNameService.class)
401            protected com.liferay.portal.kernel.service.ClassNameService classNameService;
402            @BeanReference(type = ClassNamePersistence.class)
403            protected ClassNamePersistence classNamePersistence;
404            @BeanReference(type = com.liferay.portal.kernel.service.PasswordPolicyRelLocalService.class)
405            protected com.liferay.portal.kernel.service.PasswordPolicyRelLocalService passwordPolicyRelLocalService;
406            @BeanReference(type = PasswordPolicyRelPersistence.class)
407            protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
408            @BeanReference(type = com.liferay.portal.kernel.service.ResourceLocalService.class)
409            protected com.liferay.portal.kernel.service.ResourceLocalService resourceLocalService;
410            @BeanReference(type = com.liferay.portal.kernel.service.UserLocalService.class)
411            protected com.liferay.portal.kernel.service.UserLocalService userLocalService;
412            @BeanReference(type = com.liferay.portal.kernel.service.UserService.class)
413            protected com.liferay.portal.kernel.service.UserService userService;
414            @BeanReference(type = UserPersistence.class)
415            protected UserPersistence userPersistence;
416            @BeanReference(type = UserFinder.class)
417            protected UserFinder userFinder;
418    }