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.bean.IdentifiableBean;
019    import com.liferay.portal.kernel.dao.db.DB;
020    import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
021    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
022    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
023    import com.liferay.portal.kernel.exception.SystemException;
024    import com.liferay.portal.model.BackgroundTask;
025    import com.liferay.portal.service.BackgroundTaskService;
026    import com.liferay.portal.service.BaseServiceImpl;
027    import com.liferay.portal.service.persistence.BackgroundTaskPersistence;
028    import com.liferay.portal.service.persistence.LockFinder;
029    import com.liferay.portal.service.persistence.LockPersistence;
030    import com.liferay.portal.service.persistence.UserFinder;
031    import com.liferay.portal.service.persistence.UserPersistence;
032    import com.liferay.portal.util.PortalUtil;
033    
034    import javax.sql.DataSource;
035    
036    /**
037     * Provides the base implementation for the background task remote service.
038     *
039     * <p>
040     * 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.BackgroundTaskServiceImpl}.
041     * </p>
042     *
043     * @author Brian Wing Shun Chan
044     * @see com.liferay.portal.service.impl.BackgroundTaskServiceImpl
045     * @see com.liferay.portal.service.BackgroundTaskServiceUtil
046     * @generated
047     */
048    public abstract class BackgroundTaskServiceBaseImpl extends BaseServiceImpl
049            implements BackgroundTaskService, IdentifiableBean {
050            /*
051             * NOTE FOR DEVELOPERS:
052             *
053             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.BackgroundTaskServiceUtil} to access the background task remote service.
054             */
055    
056            /**
057             * Returns the background task local service.
058             *
059             * @return the background task local service
060             */
061            public com.liferay.portal.service.BackgroundTaskLocalService getBackgroundTaskLocalService() {
062                    return backgroundTaskLocalService;
063            }
064    
065            /**
066             * Sets the background task local service.
067             *
068             * @param backgroundTaskLocalService the background task local service
069             */
070            public void setBackgroundTaskLocalService(
071                    com.liferay.portal.service.BackgroundTaskLocalService backgroundTaskLocalService) {
072                    this.backgroundTaskLocalService = backgroundTaskLocalService;
073            }
074    
075            /**
076             * Returns the background task remote service.
077             *
078             * @return the background task remote service
079             */
080            public com.liferay.portal.service.BackgroundTaskService getBackgroundTaskService() {
081                    return backgroundTaskService;
082            }
083    
084            /**
085             * Sets the background task remote service.
086             *
087             * @param backgroundTaskService the background task remote service
088             */
089            public void setBackgroundTaskService(
090                    com.liferay.portal.service.BackgroundTaskService backgroundTaskService) {
091                    this.backgroundTaskService = backgroundTaskService;
092            }
093    
094            /**
095             * Returns the background task persistence.
096             *
097             * @return the background task persistence
098             */
099            public BackgroundTaskPersistence getBackgroundTaskPersistence() {
100                    return backgroundTaskPersistence;
101            }
102    
103            /**
104             * Sets the background task persistence.
105             *
106             * @param backgroundTaskPersistence the background task persistence
107             */
108            public void setBackgroundTaskPersistence(
109                    BackgroundTaskPersistence backgroundTaskPersistence) {
110                    this.backgroundTaskPersistence = backgroundTaskPersistence;
111            }
112    
113            /**
114             * Returns the counter local service.
115             *
116             * @return the counter local service
117             */
118            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
119                    return counterLocalService;
120            }
121    
122            /**
123             * Sets the counter local service.
124             *
125             * @param counterLocalService the counter local service
126             */
127            public void setCounterLocalService(
128                    com.liferay.counter.service.CounterLocalService counterLocalService) {
129                    this.counterLocalService = counterLocalService;
130            }
131    
132            /**
133             * Returns the lock local service.
134             *
135             * @return the lock local service
136             */
137            public com.liferay.portal.service.LockLocalService getLockLocalService() {
138                    return lockLocalService;
139            }
140    
141            /**
142             * Sets the lock local service.
143             *
144             * @param lockLocalService the lock local service
145             */
146            public void setLockLocalService(
147                    com.liferay.portal.service.LockLocalService lockLocalService) {
148                    this.lockLocalService = lockLocalService;
149            }
150    
151            /**
152             * Returns the lock persistence.
153             *
154             * @return the lock persistence
155             */
156            public LockPersistence getLockPersistence() {
157                    return lockPersistence;
158            }
159    
160            /**
161             * Sets the lock persistence.
162             *
163             * @param lockPersistence the lock persistence
164             */
165            public void setLockPersistence(LockPersistence lockPersistence) {
166                    this.lockPersistence = lockPersistence;
167            }
168    
169            /**
170             * Returns the lock finder.
171             *
172             * @return the lock finder
173             */
174            public LockFinder getLockFinder() {
175                    return lockFinder;
176            }
177    
178            /**
179             * Sets the lock finder.
180             *
181             * @param lockFinder the lock finder
182             */
183            public void setLockFinder(LockFinder lockFinder) {
184                    this.lockFinder = lockFinder;
185            }
186    
187            /**
188             * Returns the user local service.
189             *
190             * @return the user local service
191             */
192            public com.liferay.portal.service.UserLocalService getUserLocalService() {
193                    return userLocalService;
194            }
195    
196            /**
197             * Sets the user local service.
198             *
199             * @param userLocalService the user local service
200             */
201            public void setUserLocalService(
202                    com.liferay.portal.service.UserLocalService userLocalService) {
203                    this.userLocalService = userLocalService;
204            }
205    
206            /**
207             * Returns the user remote service.
208             *
209             * @return the user remote service
210             */
211            public com.liferay.portal.service.UserService getUserService() {
212                    return userService;
213            }
214    
215            /**
216             * Sets the user remote service.
217             *
218             * @param userService the user remote service
219             */
220            public void setUserService(
221                    com.liferay.portal.service.UserService userService) {
222                    this.userService = userService;
223            }
224    
225            /**
226             * Returns the user persistence.
227             *
228             * @return the user persistence
229             */
230            public UserPersistence getUserPersistence() {
231                    return userPersistence;
232            }
233    
234            /**
235             * Sets the user persistence.
236             *
237             * @param userPersistence the user persistence
238             */
239            public void setUserPersistence(UserPersistence userPersistence) {
240                    this.userPersistence = userPersistence;
241            }
242    
243            /**
244             * Returns the user finder.
245             *
246             * @return the user finder
247             */
248            public UserFinder getUserFinder() {
249                    return userFinder;
250            }
251    
252            /**
253             * Sets the user finder.
254             *
255             * @param userFinder the user finder
256             */
257            public void setUserFinder(UserFinder userFinder) {
258                    this.userFinder = userFinder;
259            }
260    
261            public void afterPropertiesSet() {
262            }
263    
264            public void destroy() {
265            }
266    
267            /**
268             * Returns the Spring bean ID for this bean.
269             *
270             * @return the Spring bean ID for this bean
271             */
272            @Override
273            public String getBeanIdentifier() {
274                    return _beanIdentifier;
275            }
276    
277            /**
278             * Sets the Spring bean ID for this bean.
279             *
280             * @param beanIdentifier the Spring bean ID for this bean
281             */
282            @Override
283            public void setBeanIdentifier(String beanIdentifier) {
284                    _beanIdentifier = beanIdentifier;
285            }
286    
287            protected Class<?> getModelClass() {
288                    return BackgroundTask.class;
289            }
290    
291            protected String getModelClassName() {
292                    return BackgroundTask.class.getName();
293            }
294    
295            /**
296             * Performs a SQL query.
297             *
298             * @param sql the sql query
299             */
300            protected void runSQL(String sql) {
301                    try {
302                            DataSource dataSource = backgroundTaskPersistence.getDataSource();
303    
304                            DB db = DBFactoryUtil.getDB();
305    
306                            sql = db.buildSQL(sql);
307                            sql = PortalUtil.transformSQL(sql);
308    
309                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
310                                            sql, new int[0]);
311    
312                            sqlUpdate.update();
313                    }
314                    catch (Exception e) {
315                            throw new SystemException(e);
316                    }
317            }
318    
319            @BeanReference(type = com.liferay.portal.service.BackgroundTaskLocalService.class)
320            protected com.liferay.portal.service.BackgroundTaskLocalService backgroundTaskLocalService;
321            @BeanReference(type = com.liferay.portal.service.BackgroundTaskService.class)
322            protected com.liferay.portal.service.BackgroundTaskService backgroundTaskService;
323            @BeanReference(type = BackgroundTaskPersistence.class)
324            protected BackgroundTaskPersistence backgroundTaskPersistence;
325            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
326            protected com.liferay.counter.service.CounterLocalService counterLocalService;
327            @BeanReference(type = com.liferay.portal.service.LockLocalService.class)
328            protected com.liferay.portal.service.LockLocalService lockLocalService;
329            @BeanReference(type = LockPersistence.class)
330            protected LockPersistence lockPersistence;
331            @BeanReference(type = LockFinder.class)
332            protected LockFinder lockFinder;
333            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
334            protected com.liferay.portal.service.UserLocalService userLocalService;
335            @BeanReference(type = com.liferay.portal.service.UserService.class)
336            protected com.liferay.portal.service.UserService userService;
337            @BeanReference(type = UserPersistence.class)
338            protected UserPersistence userPersistence;
339            @BeanReference(type = UserFinder.class)
340            protected UserFinder userFinder;
341            private String _beanIdentifier;
342    }