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