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.kernel.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for ServiceComponent. This utility wraps
024     * {@link com.liferay.portal.service.impl.ServiceComponentLocalServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on the local server. Methods of this service will not have security checks
027     * based on the propagated JAAS credentials because this service can only be
028     * accessed from within the same VM.
029     *
030     * @author Brian Wing Shun Chan
031     * @see ServiceComponentLocalService
032     * @see com.liferay.portal.service.base.ServiceComponentLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.ServiceComponentLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class ServiceComponentLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.ServiceComponentLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
044                    return getService().getActionableDynamicQuery();
045            }
046    
047            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
048                    return getService().dynamicQuery();
049            }
050    
051            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
052                    return getService().getIndexableActionableDynamicQuery();
053            }
054    
055            /**
056            * @throws PortalException
057            */
058            public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(
059                    com.liferay.portal.kernel.model.PersistedModel persistedModel)
060                    throws com.liferay.portal.kernel.exception.PortalException {
061                    return getService().deletePersistedModel(persistedModel);
062            }
063    
064            public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(
065                    java.io.Serializable primaryKeyObj)
066                    throws com.liferay.portal.kernel.exception.PortalException {
067                    return getService().getPersistedModel(primaryKeyObj);
068            }
069    
070            /**
071            * Adds the service component to the database. Also notifies the appropriate model listeners.
072            *
073            * @param serviceComponent the service component
074            * @return the service component that was added
075            */
076            public static com.liferay.portal.kernel.model.ServiceComponent addServiceComponent(
077                    com.liferay.portal.kernel.model.ServiceComponent serviceComponent) {
078                    return getService().addServiceComponent(serviceComponent);
079            }
080    
081            /**
082            * Creates a new service component with the primary key. Does not add the service component to the database.
083            *
084            * @param serviceComponentId the primary key for the new service component
085            * @return the new service component
086            */
087            public static com.liferay.portal.kernel.model.ServiceComponent createServiceComponent(
088                    long serviceComponentId) {
089                    return getService().createServiceComponent(serviceComponentId);
090            }
091    
092            /**
093            * Deletes the service component from the database. Also notifies the appropriate model listeners.
094            *
095            * @param serviceComponent the service component
096            * @return the service component that was removed
097            */
098            public static com.liferay.portal.kernel.model.ServiceComponent deleteServiceComponent(
099                    com.liferay.portal.kernel.model.ServiceComponent serviceComponent) {
100                    return getService().deleteServiceComponent(serviceComponent);
101            }
102    
103            /**
104            * Deletes the service component with the primary key from the database. Also notifies the appropriate model listeners.
105            *
106            * @param serviceComponentId the primary key of the service component
107            * @return the service component that was removed
108            * @throws PortalException if a service component with the primary key could not be found
109            */
110            public static com.liferay.portal.kernel.model.ServiceComponent deleteServiceComponent(
111                    long serviceComponentId)
112                    throws com.liferay.portal.kernel.exception.PortalException {
113                    return getService().deleteServiceComponent(serviceComponentId);
114            }
115    
116            public static com.liferay.portal.kernel.model.ServiceComponent fetchServiceComponent(
117                    long serviceComponentId) {
118                    return getService().fetchServiceComponent(serviceComponentId);
119            }
120    
121            /**
122            * Returns the service component with the primary key.
123            *
124            * @param serviceComponentId the primary key of the service component
125            * @return the service component
126            * @throws PortalException if a service component with the primary key could not be found
127            */
128            public static com.liferay.portal.kernel.model.ServiceComponent getServiceComponent(
129                    long serviceComponentId)
130                    throws com.liferay.portal.kernel.exception.PortalException {
131                    return getService().getServiceComponent(serviceComponentId);
132            }
133    
134            public static com.liferay.portal.kernel.model.ServiceComponent initServiceComponent(
135                    com.liferay.portal.kernel.service.configuration.ServiceComponentConfiguration serviceComponentConfiguration,
136                    java.lang.ClassLoader classLoader, java.lang.String buildNamespace,
137                    long buildNumber, long buildDate, boolean buildAutoUpgrade)
138                    throws com.liferay.portal.kernel.exception.PortalException {
139                    return getService()
140                                       .initServiceComponent(serviceComponentConfiguration,
141                            classLoader, buildNamespace, buildNumber, buildDate,
142                            buildAutoUpgrade);
143            }
144    
145            /**
146            * Updates the service component in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
147            *
148            * @param serviceComponent the service component
149            * @return the service component that was updated
150            */
151            public static com.liferay.portal.kernel.model.ServiceComponent updateServiceComponent(
152                    com.liferay.portal.kernel.model.ServiceComponent serviceComponent) {
153                    return getService().updateServiceComponent(serviceComponent);
154            }
155    
156            /**
157            * Returns the number of service components.
158            *
159            * @return the number of service components
160            */
161            public static int getServiceComponentsCount() {
162                    return getService().getServiceComponentsCount();
163            }
164    
165            /**
166            * Returns the OSGi service identifier.
167            *
168            * @return the OSGi service identifier
169            */
170            public static java.lang.String getOSGiServiceIdentifier() {
171                    return getService().getOSGiServiceIdentifier();
172            }
173    
174            /**
175            * Performs a dynamic query on the database and returns the matching rows.
176            *
177            * @param dynamicQuery the dynamic query
178            * @return the matching rows
179            */
180            public static <T> java.util.List<T> dynamicQuery(
181                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
182                    return getService().dynamicQuery(dynamicQuery);
183            }
184    
185            /**
186            * Performs a dynamic query on the database and returns a range of the matching rows.
187            *
188            * <p>
189            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ServiceComponentModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
190            * </p>
191            *
192            * @param dynamicQuery the dynamic query
193            * @param start the lower bound of the range of model instances
194            * @param end the upper bound of the range of model instances (not inclusive)
195            * @return the range of matching rows
196            */
197            public static <T> java.util.List<T> dynamicQuery(
198                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
199                    int end) {
200                    return getService().dynamicQuery(dynamicQuery, start, end);
201            }
202    
203            /**
204            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
205            *
206            * <p>
207            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ServiceComponentModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
208            * </p>
209            *
210            * @param dynamicQuery the dynamic query
211            * @param start the lower bound of the range of model instances
212            * @param end the upper bound of the range of model instances (not inclusive)
213            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
214            * @return the ordered range of matching rows
215            */
216            public static <T> java.util.List<T> dynamicQuery(
217                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
218                    int end,
219                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
220                    return getService()
221                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
222            }
223    
224            public static java.util.List<com.liferay.portal.kernel.model.ServiceComponent> getLatestServiceComponents() {
225                    return getService().getLatestServiceComponents();
226            }
227    
228            /**
229            * Returns a range of all the service components.
230            *
231            * <p>
232            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ServiceComponentModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
233            * </p>
234            *
235            * @param start the lower bound of the range of service components
236            * @param end the upper bound of the range of service components (not inclusive)
237            * @return the range of service components
238            */
239            public static java.util.List<com.liferay.portal.kernel.model.ServiceComponent> getServiceComponents(
240                    int start, int end) {
241                    return getService().getServiceComponents(start, end);
242            }
243    
244            /**
245            * Returns the number of rows matching the dynamic query.
246            *
247            * @param dynamicQuery the dynamic query
248            * @return the number of rows matching the dynamic query
249            */
250            public static long dynamicQueryCount(
251                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
252                    return getService().dynamicQueryCount(dynamicQuery);
253            }
254    
255            /**
256            * Returns the number of rows matching the dynamic query.
257            *
258            * @param dynamicQuery the dynamic query
259            * @param projection the projection to apply to the query
260            * @return the number of rows matching the dynamic query
261            */
262            public static long dynamicQueryCount(
263                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
264                    com.liferay.portal.kernel.dao.orm.Projection projection) {
265                    return getService().dynamicQueryCount(dynamicQuery, projection);
266            }
267    
268            public static void destroyServiceComponent(
269                    com.liferay.portal.kernel.service.configuration.ServiceComponentConfiguration serviceComponentConfiguration,
270                    java.lang.ClassLoader classLoader) {
271                    getService()
272                            .destroyServiceComponent(serviceComponentConfiguration, classLoader);
273            }
274    
275            public static void upgradeDB(java.lang.ClassLoader classLoader,
276                    java.lang.String buildNamespace, long buildNumber,
277                    boolean buildAutoUpgrade,
278                    com.liferay.portal.kernel.model.ServiceComponent previousServiceComponent,
279                    java.lang.String tablesSQL, java.lang.String sequencesSQL,
280                    java.lang.String indexesSQL) throws java.lang.Exception {
281                    getService()
282                            .upgradeDB(classLoader, buildNamespace, buildNumber,
283                            buildAutoUpgrade, previousServiceComponent, tablesSQL,
284                            sequencesSQL, indexesSQL);
285            }
286    
287            public static void verifyDB() {
288                    getService().verifyDB();
289            }
290    
291            public static ServiceComponentLocalService getService() {
292                    if (_service == null) {
293                            _service = (ServiceComponentLocalService)PortalBeanLocatorUtil.locate(ServiceComponentLocalService.class.getName());
294    
295                            ReferenceRegistry.registerReference(ServiceComponentLocalServiceUtil.class,
296                                    "_service");
297                    }
298    
299                    return _service;
300            }
301    
302            private static ServiceComponentLocalService _service;
303    }