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;
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    
044            /**
045            * Adds the service component to the database. Also notifies the appropriate model listeners.
046            *
047            * @param serviceComponent the service component
048            * @return the service component that was added
049            */
050            public static com.liferay.portal.model.ServiceComponent addServiceComponent(
051                    com.liferay.portal.model.ServiceComponent serviceComponent) {
052                    return getService().addServiceComponent(serviceComponent);
053            }
054    
055            /**
056            * Creates a new service component with the primary key. Does not add the service component to the database.
057            *
058            * @param serviceComponentId the primary key for the new service component
059            * @return the new service component
060            */
061            public static com.liferay.portal.model.ServiceComponent createServiceComponent(
062                    long serviceComponentId) {
063                    return getService().createServiceComponent(serviceComponentId);
064            }
065    
066            /**
067            * @throws PortalException
068            */
069            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
070                    com.liferay.portal.model.PersistedModel persistedModel)
071                    throws com.liferay.portal.kernel.exception.PortalException {
072                    return getService().deletePersistedModel(persistedModel);
073            }
074    
075            /**
076            * Deletes the service component from the database. Also notifies the appropriate model listeners.
077            *
078            * @param serviceComponent the service component
079            * @return the service component that was removed
080            */
081            public static com.liferay.portal.model.ServiceComponent deleteServiceComponent(
082                    com.liferay.portal.model.ServiceComponent serviceComponent) {
083                    return getService().deleteServiceComponent(serviceComponent);
084            }
085    
086            /**
087            * Deletes the service component with the primary key from the database. Also notifies the appropriate model listeners.
088            *
089            * @param serviceComponentId the primary key of the service component
090            * @return the service component that was removed
091            * @throws PortalException if a service component with the primary key could not be found
092            */
093            public static com.liferay.portal.model.ServiceComponent deleteServiceComponent(
094                    long serviceComponentId)
095                    throws com.liferay.portal.kernel.exception.PortalException {
096                    return getService().deleteServiceComponent(serviceComponentId);
097            }
098    
099            public static void destroyServiceComponent(
100                    com.liferay.portal.service.configuration.ServiceComponentConfiguration serviceComponentConfiguration,
101                    java.lang.ClassLoader classLoader) {
102                    getService()
103                            .destroyServiceComponent(serviceComponentConfiguration, classLoader);
104            }
105    
106            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
107                    return getService().dynamicQuery();
108            }
109    
110            /**
111            * Performs a dynamic query on the database and returns the matching rows.
112            *
113            * @param dynamicQuery the dynamic query
114            * @return the matching rows
115            */
116            public static <T> java.util.List<T> dynamicQuery(
117                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
118                    return getService().dynamicQuery(dynamicQuery);
119            }
120    
121            /**
122            * Performs a dynamic query on the database and returns a range of the matching rows.
123            *
124            * <p>
125            * 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.
126            * </p>
127            *
128            * @param dynamicQuery the dynamic query
129            * @param start the lower bound of the range of model instances
130            * @param end the upper bound of the range of model instances (not inclusive)
131            * @return the range of matching rows
132            */
133            public static <T> java.util.List<T> dynamicQuery(
134                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
135                    int end) {
136                    return getService().dynamicQuery(dynamicQuery, start, end);
137            }
138    
139            /**
140            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
141            *
142            * <p>
143            * 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.
144            * </p>
145            *
146            * @param dynamicQuery the dynamic query
147            * @param start the lower bound of the range of model instances
148            * @param end the upper bound of the range of model instances (not inclusive)
149            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
150            * @return the ordered range of matching rows
151            */
152            public static <T> java.util.List<T> dynamicQuery(
153                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
154                    int end,
155                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
156                    return getService()
157                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
158            }
159    
160            /**
161            * Returns the number of rows matching the dynamic query.
162            *
163            * @param dynamicQuery the dynamic query
164            * @return the number of rows matching the dynamic query
165            */
166            public static long dynamicQueryCount(
167                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
168                    return getService().dynamicQueryCount(dynamicQuery);
169            }
170    
171            /**
172            * Returns the number of rows matching the dynamic query.
173            *
174            * @param dynamicQuery the dynamic query
175            * @param projection the projection to apply to the query
176            * @return the number of rows matching the dynamic query
177            */
178            public static long dynamicQueryCount(
179                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
180                    com.liferay.portal.kernel.dao.orm.Projection projection) {
181                    return getService().dynamicQueryCount(dynamicQuery, projection);
182            }
183    
184            public static com.liferay.portal.model.ServiceComponent fetchServiceComponent(
185                    long serviceComponentId) {
186                    return getService().fetchServiceComponent(serviceComponentId);
187            }
188    
189            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
190                    return getService().getActionableDynamicQuery();
191            }
192    
193            public static java.util.List<com.liferay.portal.model.ServiceComponent> getLatestServiceComponents() {
194                    return getService().getLatestServiceComponents();
195            }
196    
197            /**
198            * Returns the OSGi service identifier.
199            *
200            * @return the OSGi service identifier
201            */
202            public static java.lang.String getOSGiServiceIdentifier() {
203                    return getService().getOSGiServiceIdentifier();
204            }
205    
206            public static com.liferay.portal.model.PersistedModel getPersistedModel(
207                    java.io.Serializable primaryKeyObj)
208                    throws com.liferay.portal.kernel.exception.PortalException {
209                    return getService().getPersistedModel(primaryKeyObj);
210            }
211    
212            /**
213            * Returns the service component with the primary key.
214            *
215            * @param serviceComponentId the primary key of the service component
216            * @return the service component
217            * @throws PortalException if a service component with the primary key could not be found
218            */
219            public static com.liferay.portal.model.ServiceComponent getServiceComponent(
220                    long serviceComponentId)
221                    throws com.liferay.portal.kernel.exception.PortalException {
222                    return getService().getServiceComponent(serviceComponentId);
223            }
224    
225            /**
226            * Returns a range of all the service components.
227            *
228            * <p>
229            * 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.
230            * </p>
231            *
232            * @param start the lower bound of the range of service components
233            * @param end the upper bound of the range of service components (not inclusive)
234            * @return the range of service components
235            */
236            public static java.util.List<com.liferay.portal.model.ServiceComponent> getServiceComponents(
237                    int start, int end) {
238                    return getService().getServiceComponents(start, end);
239            }
240    
241            /**
242            * Returns the number of service components.
243            *
244            * @return the number of service components
245            */
246            public static int getServiceComponentsCount() {
247                    return getService().getServiceComponentsCount();
248            }
249    
250            public static com.liferay.portal.model.ServiceComponent initServiceComponent(
251                    com.liferay.portal.service.configuration.ServiceComponentConfiguration serviceComponentConfiguration,
252                    java.lang.ClassLoader classLoader, java.lang.String buildNamespace,
253                    long buildNumber, long buildDate, boolean buildAutoUpgrade)
254                    throws com.liferay.portal.kernel.exception.PortalException {
255                    return getService()
256                                       .initServiceComponent(serviceComponentConfiguration,
257                            classLoader, buildNamespace, buildNumber, buildDate,
258                            buildAutoUpgrade);
259            }
260    
261            /**
262            * Updates the service component in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
263            *
264            * @param serviceComponent the service component
265            * @return the service component that was updated
266            */
267            public static com.liferay.portal.model.ServiceComponent updateServiceComponent(
268                    com.liferay.portal.model.ServiceComponent serviceComponent) {
269                    return getService().updateServiceComponent(serviceComponent);
270            }
271    
272            public static void upgradeDB(java.lang.ClassLoader classLoader,
273                    java.lang.String buildNamespace, long buildNumber,
274                    boolean buildAutoUpgrade,
275                    com.liferay.portal.model.ServiceComponent previousServiceComponent,
276                    java.lang.String tablesSQL, java.lang.String sequencesSQL,
277                    java.lang.String indexesSQL) throws java.lang.Exception {
278                    getService()
279                            .upgradeDB(classLoader, buildNamespace, buildNumber,
280                            buildAutoUpgrade, previousServiceComponent, tablesSQL,
281                            sequencesSQL, indexesSQL);
282            }
283    
284            public static void verifyDB() {
285                    getService().verifyDB();
286            }
287    
288            public static ServiceComponentLocalService getService() {
289                    if (_service == null) {
290                            _service = (ServiceComponentLocalService)PortalBeanLocatorUtil.locate(ServiceComponentLocalService.class.getName());
291    
292                            ReferenceRegistry.registerReference(ServiceComponentLocalServiceUtil.class,
293                                    "_service");
294                    }
295    
296                    return _service;
297            }
298    
299            /**
300             * @deprecated As of 6.2.0
301             */
302            @Deprecated
303            public void setService(ServiceComponentLocalService service) {
304            }
305    
306            private static ServiceComponentLocalService _service;
307    }