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            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
066            public ActionableDynamicQuery getActionableDynamicQuery();
067    
068            public DynamicQuery dynamicQuery();
069    
070            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
071            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
072                    PortletDataContext portletDataContext);
073    
074            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
075            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
076    
077            /**
078            * @throws PortalException
079            */
080            @Override
081            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
082                    throws PortalException;
083    
084            @Override
085            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
086            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
087                    throws PortalException;
088    
089            /**
090            * Adds the phone to the database. Also notifies the appropriate model listeners.
091            *
092            * @param phone the phone
093            * @return the phone that was added
094            */
095            @Indexable(type = IndexableType.REINDEX)
096            public Phone addPhone(Phone phone);
097    
098            public Phone addPhone(long userId, java.lang.String className,
099                    long classPK, java.lang.String number, java.lang.String extension,
100                    long typeId, boolean primary, ServiceContext serviceContext)
101                    throws PortalException;
102    
103            /**
104            * Creates a new phone with the primary key. Does not add the phone to the database.
105            *
106            * @param phoneId the primary key for the new phone
107            * @return the new phone
108            */
109            public Phone createPhone(long phoneId);
110    
111            /**
112            * Deletes the phone from the database. Also notifies the appropriate model listeners.
113            *
114            * @param phone the phone
115            * @return the phone that was removed
116            */
117            @Indexable(type = IndexableType.DELETE)
118            @SystemEvent(action = SystemEventConstants.ACTION_SKIP, type = SystemEventConstants.TYPE_DELETE)
119            public Phone deletePhone(Phone phone);
120    
121            /**
122            * Deletes the phone with the primary key from the database. Also notifies the appropriate model listeners.
123            *
124            * @param phoneId the primary key of the phone
125            * @return the phone that was removed
126            * @throws PortalException if a phone with the primary key could not be found
127            */
128            @Indexable(type = IndexableType.DELETE)
129            public Phone deletePhone(long phoneId) throws PortalException;
130    
131            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
132            public Phone fetchPhone(long phoneId);
133    
134            /**
135            * Returns the phone with the matching UUID and company.
136            *
137            * @param uuid the phone's UUID
138            * @param companyId the primary key of the company
139            * @return the matching phone, or <code>null</code> if a matching phone could not be found
140            */
141            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
142            public Phone fetchPhoneByUuidAndCompanyId(java.lang.String uuid,
143                    long companyId);
144    
145            /**
146            * Returns the phone with the primary key.
147            *
148            * @param phoneId the primary key of the phone
149            * @return the phone
150            * @throws PortalException if a phone with the primary key could not be found
151            */
152            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
153            public Phone getPhone(long phoneId) throws PortalException;
154    
155            /**
156            * Returns the phone with the matching UUID and company.
157            *
158            * @param uuid the phone's UUID
159            * @param companyId the primary key of the company
160            * @return the matching phone
161            * @throws PortalException if a matching phone could not be found
162            */
163            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
164            public Phone getPhoneByUuidAndCompanyId(java.lang.String uuid,
165                    long companyId) throws PortalException;
166    
167            /**
168            * Updates the phone in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
169            *
170            * @param phone the phone
171            * @return the phone that was updated
172            */
173            @Indexable(type = IndexableType.REINDEX)
174            public Phone updatePhone(Phone phone);
175    
176            public Phone updatePhone(long phoneId, java.lang.String number,
177                    java.lang.String extension, long typeId, boolean primary)
178                    throws PortalException;
179    
180            /**
181            * Returns the number of phones.
182            *
183            * @return the number of phones
184            */
185            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
186            public int getPhonesCount();
187    
188            /**
189            * Returns the OSGi service identifier.
190            *
191            * @return the OSGi service identifier
192            */
193            public java.lang.String getOSGiServiceIdentifier();
194    
195            /**
196            * Performs a dynamic query on the database and returns the matching rows.
197            *
198            * @param dynamicQuery the dynamic query
199            * @return the matching rows
200            */
201            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
202    
203            /**
204            * Performs a dynamic query on the database and returns a range of the matching rows.
205            *
206            * <p>
207            * 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.
208            * </p>
209            *
210            * @param dynamicQuery the dynamic query
211            * @param start the lower bound of the range of model instances
212            * @param end the upper bound of the range of model instances (not inclusive)
213            * @return the range of matching rows
214            */
215            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
216                    int end);
217    
218            /**
219            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
220            *
221            * <p>
222            * 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.
223            * </p>
224            *
225            * @param dynamicQuery the dynamic query
226            * @param start the lower bound of the range of model instances
227            * @param end the upper bound of the range of model instances (not inclusive)
228            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
229            * @return the ordered range of matching rows
230            */
231            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
232                    int end, OrderByComparator<T> orderByComparator);
233    
234            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
235            public List<Phone> getPhones();
236    
237            /**
238            * Returns a range of all the phones.
239            *
240            * <p>
241            * 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.
242            * </p>
243            *
244            * @param start the lower bound of the range of phones
245            * @param end the upper bound of the range of phones (not inclusive)
246            * @return the range of phones
247            */
248            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
249            public List<Phone> getPhones(int start, int end);
250    
251            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
252            public List<Phone> getPhones(long companyId, java.lang.String className,
253                    long classPK);
254    
255            /**
256            * Returns the number of rows matching the dynamic query.
257            *
258            * @param dynamicQuery the dynamic query
259            * @return the number of rows matching the dynamic query
260            */
261            public long dynamicQueryCount(DynamicQuery dynamicQuery);
262    
263            /**
264            * Returns the number of rows matching the dynamic query.
265            *
266            * @param dynamicQuery the dynamic query
267            * @param projection the projection to apply to the query
268            * @return the number of rows matching the dynamic query
269            */
270            public long dynamicQueryCount(DynamicQuery dynamicQuery,
271                    Projection projection);
272    
273            public void deletePhones(long companyId, java.lang.String className,
274                    long classPK);
275    }