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 com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() { 194 return getService().getIndexableActionableDynamicQuery(); 195 } 196 197 public static java.util.List<com.liferay.portal.model.ServiceComponent> getLatestServiceComponents() { 198 return getService().getLatestServiceComponents(); 199 } 200 201 /** 202 * Returns the OSGi service identifier. 203 * 204 * @return the OSGi service identifier 205 */ 206 public static java.lang.String getOSGiServiceIdentifier() { 207 return getService().getOSGiServiceIdentifier(); 208 } 209 210 public static com.liferay.portal.model.PersistedModel getPersistedModel( 211 java.io.Serializable primaryKeyObj) 212 throws com.liferay.portal.kernel.exception.PortalException { 213 return getService().getPersistedModel(primaryKeyObj); 214 } 215 216 /** 217 * Returns the service component with the primary key. 218 * 219 * @param serviceComponentId the primary key of the service component 220 * @return the service component 221 * @throws PortalException if a service component with the primary key could not be found 222 */ 223 public static com.liferay.portal.model.ServiceComponent getServiceComponent( 224 long serviceComponentId) 225 throws com.liferay.portal.kernel.exception.PortalException { 226 return getService().getServiceComponent(serviceComponentId); 227 } 228 229 /** 230 * Returns a range of all the service components. 231 * 232 * <p> 233 * 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. 234 * </p> 235 * 236 * @param start the lower bound of the range of service components 237 * @param end the upper bound of the range of service components (not inclusive) 238 * @return the range of service components 239 */ 240 public static java.util.List<com.liferay.portal.model.ServiceComponent> getServiceComponents( 241 int start, int end) { 242 return getService().getServiceComponents(start, end); 243 } 244 245 /** 246 * Returns the number of service components. 247 * 248 * @return the number of service components 249 */ 250 public static int getServiceComponentsCount() { 251 return getService().getServiceComponentsCount(); 252 } 253 254 public static com.liferay.portal.model.ServiceComponent initServiceComponent( 255 com.liferay.portal.service.configuration.ServiceComponentConfiguration serviceComponentConfiguration, 256 java.lang.ClassLoader classLoader, java.lang.String buildNamespace, 257 long buildNumber, long buildDate, boolean buildAutoUpgrade) 258 throws com.liferay.portal.kernel.exception.PortalException { 259 return getService() 260 .initServiceComponent(serviceComponentConfiguration, 261 classLoader, buildNamespace, buildNumber, buildDate, 262 buildAutoUpgrade); 263 } 264 265 /** 266 * Updates the service component in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 267 * 268 * @param serviceComponent the service component 269 * @return the service component that was updated 270 */ 271 public static com.liferay.portal.model.ServiceComponent updateServiceComponent( 272 com.liferay.portal.model.ServiceComponent serviceComponent) { 273 return getService().updateServiceComponent(serviceComponent); 274 } 275 276 public static void upgradeDB(java.lang.ClassLoader classLoader, 277 java.lang.String buildNamespace, long buildNumber, 278 boolean buildAutoUpgrade, 279 com.liferay.portal.model.ServiceComponent previousServiceComponent, 280 java.lang.String tablesSQL, java.lang.String sequencesSQL, 281 java.lang.String indexesSQL) throws java.lang.Exception { 282 getService() 283 .upgradeDB(classLoader, buildNamespace, buildNumber, 284 buildAutoUpgrade, previousServiceComponent, tablesSQL, 285 sequencesSQL, indexesSQL); 286 } 287 288 public static void verifyDB() { 289 getService().verifyDB(); 290 } 291 292 public static ServiceComponentLocalService getService() { 293 if (_service == null) { 294 _service = (ServiceComponentLocalService)PortalBeanLocatorUtil.locate(ServiceComponentLocalService.class.getName()); 295 296 ReferenceRegistry.registerReference(ServiceComponentLocalServiceUtil.class, 297 "_service"); 298 } 299 300 return _service; 301 } 302 303 private static ServiceComponentLocalService _service; 304 }