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.dao.orm.ActionableDynamicQuery; 020 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 021 import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery; 022 import com.liferay.portal.kernel.dao.orm.Projection; 023 import com.liferay.portal.kernel.exception.PortalException; 024 import com.liferay.portal.kernel.exception.SystemException; 025 import com.liferay.portal.kernel.model.PersistedModel; 026 import com.liferay.portal.kernel.model.ServiceComponent; 027 import com.liferay.portal.kernel.search.Indexable; 028 import com.liferay.portal.kernel.search.IndexableType; 029 import com.liferay.portal.kernel.service.configuration.ServiceComponentConfiguration; 030 import com.liferay.portal.kernel.transaction.Isolation; 031 import com.liferay.portal.kernel.transaction.Propagation; 032 import com.liferay.portal.kernel.transaction.Transactional; 033 import com.liferay.portal.kernel.util.OrderByComparator; 034 035 import java.io.Serializable; 036 037 import java.util.List; 038 039 /** 040 * Provides the local service interface for ServiceComponent. Methods of this 041 * service will not have security checks based on the propagated JAAS 042 * credentials because this service can only be accessed from within the same 043 * VM. 044 * 045 * @author Brian Wing Shun Chan 046 * @see ServiceComponentLocalServiceUtil 047 * @see com.liferay.portal.service.base.ServiceComponentLocalServiceBaseImpl 048 * @see com.liferay.portal.service.impl.ServiceComponentLocalServiceImpl 049 * @generated 050 */ 051 @ProviderType 052 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 053 PortalException.class, SystemException.class}) 054 public interface ServiceComponentLocalService extends BaseLocalService, 055 PersistedModelLocalService { 056 /* 057 * NOTE FOR DEVELOPERS: 058 * 059 * Never modify or reference this interface directly. Always use {@link ServiceComponentLocalServiceUtil} to access the service component local service. Add custom service methods to {@link com.liferay.portal.service.impl.ServiceComponentLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 060 */ 061 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 062 public ActionableDynamicQuery getActionableDynamicQuery(); 063 064 public DynamicQuery dynamicQuery(); 065 066 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 067 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 068 069 /** 070 * @throws PortalException 071 */ 072 @Override 073 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 074 throws PortalException; 075 076 @Override 077 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 078 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 079 throws PortalException; 080 081 /** 082 * Adds the service component to the database. Also notifies the appropriate model listeners. 083 * 084 * @param serviceComponent the service component 085 * @return the service component that was added 086 */ 087 @Indexable(type = IndexableType.REINDEX) 088 public ServiceComponent addServiceComponent( 089 ServiceComponent serviceComponent); 090 091 /** 092 * Creates a new service component with the primary key. Does not add the service component to the database. 093 * 094 * @param serviceComponentId the primary key for the new service component 095 * @return the new service component 096 */ 097 public ServiceComponent createServiceComponent(long serviceComponentId); 098 099 /** 100 * Deletes the service component from the database. Also notifies the appropriate model listeners. 101 * 102 * @param serviceComponent the service component 103 * @return the service component that was removed 104 */ 105 @Indexable(type = IndexableType.DELETE) 106 public ServiceComponent deleteServiceComponent( 107 ServiceComponent serviceComponent); 108 109 /** 110 * Deletes the service component with the primary key from the database. Also notifies the appropriate model listeners. 111 * 112 * @param serviceComponentId the primary key of the service component 113 * @return the service component that was removed 114 * @throws PortalException if a service component with the primary key could not be found 115 */ 116 @Indexable(type = IndexableType.DELETE) 117 public ServiceComponent deleteServiceComponent(long serviceComponentId) 118 throws PortalException; 119 120 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 121 public ServiceComponent fetchServiceComponent(long serviceComponentId); 122 123 /** 124 * Returns the service component with the primary key. 125 * 126 * @param serviceComponentId the primary key of the service component 127 * @return the service component 128 * @throws PortalException if a service component with the primary key could not be found 129 */ 130 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 131 public ServiceComponent getServiceComponent(long serviceComponentId) 132 throws PortalException; 133 134 public ServiceComponent initServiceComponent( 135 ServiceComponentConfiguration serviceComponentConfiguration, 136 java.lang.ClassLoader classLoader, java.lang.String buildNamespace, 137 long buildNumber, long buildDate, boolean buildAutoUpgrade) 138 throws PortalException; 139 140 /** 141 * Updates the service component in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 142 * 143 * @param serviceComponent the service component 144 * @return the service component that was updated 145 */ 146 @Indexable(type = IndexableType.REINDEX) 147 public ServiceComponent updateServiceComponent( 148 ServiceComponent serviceComponent); 149 150 /** 151 * Returns the number of service components. 152 * 153 * @return the number of service components 154 */ 155 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 156 public int getServiceComponentsCount(); 157 158 /** 159 * Returns the OSGi service identifier. 160 * 161 * @return the OSGi service identifier 162 */ 163 public java.lang.String getOSGiServiceIdentifier(); 164 165 /** 166 * Performs a dynamic query on the database and returns the matching rows. 167 * 168 * @param dynamicQuery the dynamic query 169 * @return the matching rows 170 */ 171 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 172 173 /** 174 * Performs a dynamic query on the database and returns a range of the matching rows. 175 * 176 * <p> 177 * 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. 178 * </p> 179 * 180 * @param dynamicQuery the dynamic query 181 * @param start the lower bound of the range of model instances 182 * @param end the upper bound of the range of model instances (not inclusive) 183 * @return the range of matching rows 184 */ 185 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 186 int end); 187 188 /** 189 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 190 * 191 * <p> 192 * 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. 193 * </p> 194 * 195 * @param dynamicQuery the dynamic query 196 * @param start the lower bound of the range of model instances 197 * @param end the upper bound of the range of model instances (not inclusive) 198 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 199 * @return the ordered range of matching rows 200 */ 201 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 202 int end, OrderByComparator<T> orderByComparator); 203 204 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 205 public List<ServiceComponent> getLatestServiceComponents(); 206 207 /** 208 * Returns a range of all the service components. 209 * 210 * <p> 211 * 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. 212 * </p> 213 * 214 * @param start the lower bound of the range of service components 215 * @param end the upper bound of the range of service components (not inclusive) 216 * @return the range of service components 217 */ 218 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 219 public List<ServiceComponent> getServiceComponents(int start, int end); 220 221 /** 222 * Returns the number of rows matching the dynamic query. 223 * 224 * @param dynamicQuery the dynamic query 225 * @return the number of rows matching the dynamic query 226 */ 227 public long dynamicQueryCount(DynamicQuery dynamicQuery); 228 229 /** 230 * Returns the number of rows matching the dynamic query. 231 * 232 * @param dynamicQuery the dynamic query 233 * @param projection the projection to apply to the query 234 * @return the number of rows matching the dynamic query 235 */ 236 public long dynamicQueryCount(DynamicQuery dynamicQuery, 237 Projection projection); 238 239 public void destroyServiceComponent( 240 ServiceComponentConfiguration serviceComponentConfiguration, 241 java.lang.ClassLoader classLoader); 242 243 public void upgradeDB(java.lang.ClassLoader classLoader, 244 java.lang.String buildNamespace, long buildNumber, 245 boolean buildAutoUpgrade, ServiceComponent previousServiceComponent, 246 java.lang.String tablesSQL, java.lang.String sequencesSQL, 247 java.lang.String indexesSQL) throws java.lang.Exception; 248 249 public void verifyDB(); 250 }