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.exportimport.kernel.lar.PortletDataContext; 020 021 import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery; 022 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 023 import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery; 024 import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery; 025 import com.liferay.portal.kernel.dao.orm.Projection; 026 import com.liferay.portal.kernel.exception.PortalException; 027 import com.liferay.portal.kernel.exception.SystemException; 028 import com.liferay.portal.kernel.model.PersistedModel; 029 import com.liferay.portal.kernel.model.Phone; 030 import com.liferay.portal.kernel.model.SystemEventConstants; 031 import com.liferay.portal.kernel.search.Indexable; 032 import com.liferay.portal.kernel.search.IndexableType; 033 import com.liferay.portal.kernel.systemevent.SystemEvent; 034 import com.liferay.portal.kernel.transaction.Isolation; 035 import com.liferay.portal.kernel.transaction.Propagation; 036 import com.liferay.portal.kernel.transaction.Transactional; 037 import com.liferay.portal.kernel.util.OrderByComparator; 038 039 import java.io.Serializable; 040 041 import java.util.List; 042 043 /** 044 * Provides the local service interface for Phone. Methods of this 045 * service will not have security checks based on the propagated JAAS 046 * credentials because this service can only be accessed from within the same 047 * VM. 048 * 049 * @author Brian Wing Shun Chan 050 * @see PhoneLocalServiceUtil 051 * @see com.liferay.portal.service.base.PhoneLocalServiceBaseImpl 052 * @see com.liferay.portal.service.impl.PhoneLocalServiceImpl 053 * @generated 054 */ 055 @ProviderType 056 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 057 PortalException.class, SystemException.class}) 058 public interface PhoneLocalService extends BaseLocalService, 059 PersistedModelLocalService { 060 /* 061 * NOTE FOR DEVELOPERS: 062 * 063 * Never modify or reference this interface directly. Always use {@link PhoneLocalServiceUtil} to access the phone local service. Add custom service methods to {@link com.liferay.portal.service.impl.PhoneLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 064 */ 065 066 /** 067 * Adds the phone to the database. Also notifies the appropriate model listeners. 068 * 069 * @param phone the phone 070 * @return the phone that was added 071 */ 072 @Indexable(type = IndexableType.REINDEX) 073 public Phone addPhone(Phone phone); 074 075 public Phone addPhone(long userId, java.lang.String className, 076 long classPK, java.lang.String number, java.lang.String extension, 077 long typeId, boolean primary, 078 com.liferay.portal.kernel.service.ServiceContext serviceContext) 079 throws PortalException; 080 081 /** 082 * Creates a new phone with the primary key. Does not add the phone to the database. 083 * 084 * @param phoneId the primary key for the new phone 085 * @return the new phone 086 */ 087 public Phone createPhone(long phoneId); 088 089 /** 090 * @throws PortalException 091 */ 092 @Override 093 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 094 throws PortalException; 095 096 /** 097 * Deletes the phone from the database. Also notifies the appropriate model listeners. 098 * 099 * @param phone the phone 100 * @return the phone that was removed 101 */ 102 @Indexable(type = IndexableType.DELETE) 103 @SystemEvent(action = SystemEventConstants.ACTION_SKIP, type = SystemEventConstants.TYPE_DELETE) 104 public Phone deletePhone(Phone phone); 105 106 /** 107 * Deletes the phone with the primary key from the database. Also notifies the appropriate model listeners. 108 * 109 * @param phoneId the primary key of the phone 110 * @return the phone that was removed 111 * @throws PortalException if a phone with the primary key could not be found 112 */ 113 @Indexable(type = IndexableType.DELETE) 114 public Phone deletePhone(long phoneId) throws PortalException; 115 116 public void deletePhones(long companyId, java.lang.String className, 117 long classPK); 118 119 public DynamicQuery dynamicQuery(); 120 121 /** 122 * Performs a dynamic query on the database and returns the matching rows. 123 * 124 * @param dynamicQuery the dynamic query 125 * @return the matching rows 126 */ 127 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 128 129 /** 130 * Performs a dynamic query on the database and returns a range of the matching rows. 131 * 132 * <p> 133 * 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.PhoneModelImpl}. 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. 134 * </p> 135 * 136 * @param dynamicQuery the dynamic query 137 * @param start the lower bound of the range of model instances 138 * @param end the upper bound of the range of model instances (not inclusive) 139 * @return the range of matching rows 140 */ 141 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 142 int end); 143 144 /** 145 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 146 * 147 * <p> 148 * 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.PhoneModelImpl}. 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. 149 * </p> 150 * 151 * @param dynamicQuery the dynamic query 152 * @param start the lower bound of the range of model instances 153 * @param end the upper bound of the range of model instances (not inclusive) 154 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 155 * @return the ordered range of matching rows 156 */ 157 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 158 int end, OrderByComparator<T> orderByComparator); 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 long dynamicQueryCount(DynamicQuery dynamicQuery); 167 168 /** 169 * Returns the number of rows matching the dynamic query. 170 * 171 * @param dynamicQuery the dynamic query 172 * @param projection the projection to apply to the query 173 * @return the number of rows matching the dynamic query 174 */ 175 public long dynamicQueryCount(DynamicQuery dynamicQuery, 176 Projection projection); 177 178 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 179 public Phone fetchPhone(long phoneId); 180 181 /** 182 * Returns the phone with the matching UUID and company. 183 * 184 * @param uuid the phone's UUID 185 * @param companyId the primary key of the company 186 * @return the matching phone, or <code>null</code> if a matching phone could not be found 187 */ 188 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 189 public Phone fetchPhoneByUuidAndCompanyId(java.lang.String uuid, 190 long companyId); 191 192 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 193 public ActionableDynamicQuery getActionableDynamicQuery(); 194 195 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 196 public ExportActionableDynamicQuery getExportActionableDynamicQuery( 197 PortletDataContext portletDataContext); 198 199 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 200 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 201 202 /** 203 * Returns the OSGi service identifier. 204 * 205 * @return the OSGi service identifier 206 */ 207 public java.lang.String getOSGiServiceIdentifier(); 208 209 @Override 210 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 211 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 212 throws PortalException; 213 214 /** 215 * Returns the phone with the primary key. 216 * 217 * @param phoneId the primary key of the phone 218 * @return the phone 219 * @throws PortalException if a phone with the primary key could not be found 220 */ 221 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 222 public Phone getPhone(long phoneId) throws PortalException; 223 224 /** 225 * Returns the phone with the matching UUID and company. 226 * 227 * @param uuid the phone's UUID 228 * @param companyId the primary key of the company 229 * @return the matching phone 230 * @throws PortalException if a matching phone could not be found 231 */ 232 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 233 public Phone getPhoneByUuidAndCompanyId(java.lang.String uuid, 234 long companyId) throws PortalException; 235 236 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 237 public List<Phone> getPhones(); 238 239 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 240 public List<Phone> getPhones(long companyId, java.lang.String className, 241 long classPK); 242 243 /** 244 * Returns a range of all the phones. 245 * 246 * <p> 247 * 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.PhoneModelImpl}. 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. 248 * </p> 249 * 250 * @param start the lower bound of the range of phones 251 * @param end the upper bound of the range of phones (not inclusive) 252 * @return the range of phones 253 */ 254 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 255 public List<Phone> getPhones(int start, int end); 256 257 /** 258 * Returns the number of phones. 259 * 260 * @return the number of phones 261 */ 262 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 263 public int getPhonesCount(); 264 265 /** 266 * Updates the phone in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 267 * 268 * @param phone the phone 269 * @return the phone that was updated 270 */ 271 @Indexable(type = IndexableType.REINDEX) 272 public Phone updatePhone(Phone phone); 273 274 public Phone updatePhone(long phoneId, java.lang.String number, 275 java.lang.String extension, long typeId, boolean primary) 276 throws PortalException; 277 }