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