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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.BeanReference;
020    import com.liferay.portal.kernel.dao.db.DB;
021    import com.liferay.portal.kernel.dao.db.DBManagerUtil;
022    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
023    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
024    import com.liferay.portal.kernel.exception.SystemException;
025    import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
026    import com.liferay.portal.kernel.util.InfrastructureUtil;
027    import com.liferay.portal.service.BaseLocalServiceImpl;
028    import com.liferay.portal.service.ResourceLocalService;
029    import com.liferay.portal.service.persistence.ResourceBlockFinder;
030    import com.liferay.portal.service.persistence.ResourceBlockPersistence;
031    import com.liferay.portal.service.persistence.ResourcePermissionFinder;
032    import com.liferay.portal.service.persistence.ResourcePermissionPersistence;
033    import com.liferay.portal.service.persistence.RoleFinder;
034    import com.liferay.portal.service.persistence.RolePersistence;
035    import com.liferay.portal.util.PortalUtil;
036    
037    import javax.sql.DataSource;
038    
039    /**
040     * Provides the base implementation for the resource local service.
041     *
042     * <p>
043     * 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.ResourceLocalServiceImpl}.
044     * </p>
045     *
046     * @author Brian Wing Shun Chan
047     * @see com.liferay.portal.service.impl.ResourceLocalServiceImpl
048     * @see com.liferay.portal.service.ResourceLocalServiceUtil
049     * @generated
050     */
051    @ProviderType
052    public abstract class ResourceLocalServiceBaseImpl extends BaseLocalServiceImpl
053            implements ResourceLocalService, IdentifiableOSGiService {
054            /*
055             * NOTE FOR DEVELOPERS:
056             *
057             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.ResourceLocalServiceUtil} to access the resource local service.
058             */
059    
060            /**
061             * Returns the resource local service.
062             *
063             * @return the resource local service
064             */
065            public ResourceLocalService getResourceLocalService() {
066                    return resourceLocalService;
067            }
068    
069            /**
070             * Sets the resource local service.
071             *
072             * @param resourceLocalService the resource local service
073             */
074            public void setResourceLocalService(
075                    ResourceLocalService resourceLocalService) {
076                    this.resourceLocalService = resourceLocalService;
077            }
078    
079            /**
080             * Returns the counter local service.
081             *
082             * @return the counter local service
083             */
084            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
085                    return counterLocalService;
086            }
087    
088            /**
089             * Sets the counter local service.
090             *
091             * @param counterLocalService the counter local service
092             */
093            public void setCounterLocalService(
094                    com.liferay.counter.service.CounterLocalService counterLocalService) {
095                    this.counterLocalService = counterLocalService;
096            }
097    
098            /**
099             * Returns the resource block local service.
100             *
101             * @return the resource block local service
102             */
103            public com.liferay.portal.service.ResourceBlockLocalService getResourceBlockLocalService() {
104                    return resourceBlockLocalService;
105            }
106    
107            /**
108             * Sets the resource block local service.
109             *
110             * @param resourceBlockLocalService the resource block local service
111             */
112            public void setResourceBlockLocalService(
113                    com.liferay.portal.service.ResourceBlockLocalService resourceBlockLocalService) {
114                    this.resourceBlockLocalService = resourceBlockLocalService;
115            }
116    
117            /**
118             * Returns the resource block persistence.
119             *
120             * @return the resource block persistence
121             */
122            public ResourceBlockPersistence getResourceBlockPersistence() {
123                    return resourceBlockPersistence;
124            }
125    
126            /**
127             * Sets the resource block persistence.
128             *
129             * @param resourceBlockPersistence the resource block persistence
130             */
131            public void setResourceBlockPersistence(
132                    ResourceBlockPersistence resourceBlockPersistence) {
133                    this.resourceBlockPersistence = resourceBlockPersistence;
134            }
135    
136            /**
137             * Returns the resource block finder.
138             *
139             * @return the resource block finder
140             */
141            public ResourceBlockFinder getResourceBlockFinder() {
142                    return resourceBlockFinder;
143            }
144    
145            /**
146             * Sets the resource block finder.
147             *
148             * @param resourceBlockFinder the resource block finder
149             */
150            public void setResourceBlockFinder(ResourceBlockFinder resourceBlockFinder) {
151                    this.resourceBlockFinder = resourceBlockFinder;
152            }
153    
154            /**
155             * Returns the resource permission local service.
156             *
157             * @return the resource permission local service
158             */
159            public com.liferay.portal.service.ResourcePermissionLocalService getResourcePermissionLocalService() {
160                    return resourcePermissionLocalService;
161            }
162    
163            /**
164             * Sets the resource permission local service.
165             *
166             * @param resourcePermissionLocalService the resource permission local service
167             */
168            public void setResourcePermissionLocalService(
169                    com.liferay.portal.service.ResourcePermissionLocalService resourcePermissionLocalService) {
170                    this.resourcePermissionLocalService = resourcePermissionLocalService;
171            }
172    
173            /**
174             * Returns the resource permission persistence.
175             *
176             * @return the resource permission persistence
177             */
178            public ResourcePermissionPersistence getResourcePermissionPersistence() {
179                    return resourcePermissionPersistence;
180            }
181    
182            /**
183             * Sets the resource permission persistence.
184             *
185             * @param resourcePermissionPersistence the resource permission persistence
186             */
187            public void setResourcePermissionPersistence(
188                    ResourcePermissionPersistence resourcePermissionPersistence) {
189                    this.resourcePermissionPersistence = resourcePermissionPersistence;
190            }
191    
192            /**
193             * Returns the resource permission finder.
194             *
195             * @return the resource permission finder
196             */
197            public ResourcePermissionFinder getResourcePermissionFinder() {
198                    return resourcePermissionFinder;
199            }
200    
201            /**
202             * Sets the resource permission finder.
203             *
204             * @param resourcePermissionFinder the resource permission finder
205             */
206            public void setResourcePermissionFinder(
207                    ResourcePermissionFinder resourcePermissionFinder) {
208                    this.resourcePermissionFinder = resourcePermissionFinder;
209            }
210    
211            /**
212             * Returns the role local service.
213             *
214             * @return the role local service
215             */
216            public com.liferay.portal.service.RoleLocalService getRoleLocalService() {
217                    return roleLocalService;
218            }
219    
220            /**
221             * Sets the role local service.
222             *
223             * @param roleLocalService the role local service
224             */
225            public void setRoleLocalService(
226                    com.liferay.portal.service.RoleLocalService roleLocalService) {
227                    this.roleLocalService = roleLocalService;
228            }
229    
230            /**
231             * Returns the role persistence.
232             *
233             * @return the role persistence
234             */
235            public RolePersistence getRolePersistence() {
236                    return rolePersistence;
237            }
238    
239            /**
240             * Sets the role persistence.
241             *
242             * @param rolePersistence the role persistence
243             */
244            public void setRolePersistence(RolePersistence rolePersistence) {
245                    this.rolePersistence = rolePersistence;
246            }
247    
248            /**
249             * Returns the role finder.
250             *
251             * @return the role finder
252             */
253            public RoleFinder getRoleFinder() {
254                    return roleFinder;
255            }
256    
257            /**
258             * Sets the role finder.
259             *
260             * @param roleFinder the role finder
261             */
262            public void setRoleFinder(RoleFinder roleFinder) {
263                    this.roleFinder = roleFinder;
264            }
265    
266            public void afterPropertiesSet() {
267            }
268    
269            public void destroy() {
270            }
271    
272            /**
273             * Returns the OSGi service identifier.
274             *
275             * @return the OSGi service identifier
276             */
277            @Override
278            public String getOSGiServiceIdentifier() {
279                    return ResourceLocalService.class.getName();
280            }
281    
282            /**
283             * Performs a SQL query.
284             *
285             * @param sql the sql query
286             */
287            protected void runSQL(String sql) {
288                    try {
289                            DataSource dataSource = InfrastructureUtil.getDataSource();
290    
291                            DB db = DBManagerUtil.getDB();
292    
293                            sql = db.buildSQL(sql);
294                            sql = PortalUtil.transformSQL(sql);
295    
296                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
297                                            sql, new int[0]);
298    
299                            sqlUpdate.update();
300                    }
301                    catch (Exception e) {
302                            throw new SystemException(e);
303                    }
304            }
305    
306            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
307            protected ResourceLocalService resourceLocalService;
308            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
309            protected com.liferay.counter.service.CounterLocalService counterLocalService;
310            @BeanReference(type = com.liferay.portal.service.ResourceBlockLocalService.class)
311            protected com.liferay.portal.service.ResourceBlockLocalService resourceBlockLocalService;
312            @BeanReference(type = ResourceBlockPersistence.class)
313            protected ResourceBlockPersistence resourceBlockPersistence;
314            @BeanReference(type = ResourceBlockFinder.class)
315            protected ResourceBlockFinder resourceBlockFinder;
316            @BeanReference(type = com.liferay.portal.service.ResourcePermissionLocalService.class)
317            protected com.liferay.portal.service.ResourcePermissionLocalService resourcePermissionLocalService;
318            @BeanReference(type = ResourcePermissionPersistence.class)
319            protected ResourcePermissionPersistence resourcePermissionPersistence;
320            @BeanReference(type = ResourcePermissionFinder.class)
321            protected ResourcePermissionFinder resourcePermissionFinder;
322            @BeanReference(type = com.liferay.portal.service.RoleLocalService.class)
323            protected com.liferay.portal.service.RoleLocalService roleLocalService;
324            @BeanReference(type = RolePersistence.class)
325            protected RolePersistence rolePersistence;
326            @BeanReference(type = RoleFinder.class)
327            protected RoleFinder roleFinder;
328    }