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.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.search.Indexable;
026    import com.liferay.portal.kernel.search.IndexableType;
027    import com.liferay.portal.kernel.transaction.Isolation;
028    import com.liferay.portal.kernel.transaction.Propagation;
029    import com.liferay.portal.kernel.transaction.Transactional;
030    import com.liferay.portal.kernel.util.OrderByComparator;
031    import com.liferay.portal.model.PersistedModel;
032    import com.liferay.portal.model.Ticket;
033    
034    import java.io.Serializable;
035    
036    import java.util.Date;
037    import java.util.List;
038    
039    /**
040     * Provides the local service interface for Ticket. 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 TicketLocalServiceUtil
047     * @see com.liferay.portal.service.base.TicketLocalServiceBaseImpl
048     * @see com.liferay.portal.service.impl.TicketLocalServiceImpl
049     * @generated
050     */
051    @ProviderType
052    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
053            PortalException.class, SystemException.class})
054    public interface TicketLocalService extends BaseLocalService,
055            PersistedModelLocalService {
056            /*
057             * NOTE FOR DEVELOPERS:
058             *
059             * Never modify or reference this interface directly. Always use {@link TicketLocalServiceUtil} to access the ticket local service. Add custom service methods to {@link com.liferay.portal.service.impl.TicketLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
060             */
061            public Ticket addDistinctTicket(long companyId, java.lang.String className,
062                    long classPK, int type, java.lang.String extraInfo,
063                    Date expirationDate,
064                    com.liferay.portal.service.ServiceContext serviceContext);
065    
066            public Ticket addTicket(long companyId, java.lang.String className,
067                    long classPK, int type, java.lang.String extraInfo,
068                    Date expirationDate,
069                    com.liferay.portal.service.ServiceContext serviceContext);
070    
071            /**
072            * Adds the ticket to the database. Also notifies the appropriate model listeners.
073            *
074            * @param ticket the ticket
075            * @return the ticket that was added
076            */
077            @Indexable(type = IndexableType.REINDEX)
078            public Ticket addTicket(Ticket ticket);
079    
080            /**
081            * Creates a new ticket with the primary key. Does not add the ticket to the database.
082            *
083            * @param ticketId the primary key for the new ticket
084            * @return the new ticket
085            */
086            public Ticket createTicket(long ticketId);
087    
088            /**
089            * @throws PortalException
090            */
091            @Override
092            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
093                    throws PortalException;
094    
095            /**
096            * Deletes the ticket from the database. Also notifies the appropriate model listeners.
097            *
098            * @param ticket the ticket
099            * @return the ticket that was removed
100            */
101            @Indexable(type = IndexableType.DELETE)
102            public Ticket deleteTicket(Ticket ticket);
103    
104            /**
105            * Deletes the ticket with the primary key from the database. Also notifies the appropriate model listeners.
106            *
107            * @param ticketId the primary key of the ticket
108            * @return the ticket that was removed
109            * @throws PortalException if a ticket with the primary key could not be found
110            */
111            @Indexable(type = IndexableType.DELETE)
112            public Ticket deleteTicket(long ticketId) throws PortalException;
113    
114            public DynamicQuery dynamicQuery();
115    
116            /**
117            * Performs a dynamic query on the database and returns the matching rows.
118            *
119            * @param dynamicQuery the dynamic query
120            * @return the matching rows
121            */
122            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
123    
124            /**
125            * Performs a dynamic query on the database and returns a range of the matching rows.
126            *
127            * <p>
128            * 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.TicketModelImpl}. 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.
129            * </p>
130            *
131            * @param dynamicQuery the dynamic query
132            * @param start the lower bound of the range of model instances
133            * @param end the upper bound of the range of model instances (not inclusive)
134            * @return the range of matching rows
135            */
136            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
137                    int end);
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.TicketModelImpl}. 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 <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
153                    int end, OrderByComparator<T> orderByComparator);
154    
155            /**
156            * Returns the number of rows matching the dynamic query.
157            *
158            * @param dynamicQuery the dynamic query
159            * @return the number of rows matching the dynamic query
160            */
161            public long dynamicQueryCount(DynamicQuery dynamicQuery);
162    
163            /**
164            * Returns the number of rows matching the dynamic query.
165            *
166            * @param dynamicQuery the dynamic query
167            * @param projection the projection to apply to the query
168            * @return the number of rows matching the dynamic query
169            */
170            public long dynamicQueryCount(DynamicQuery dynamicQuery,
171                    Projection projection);
172    
173            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
174            public Ticket fetchTicket(java.lang.String key);
175    
176            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
177            public Ticket fetchTicket(long ticketId);
178    
179            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
180            public ActionableDynamicQuery getActionableDynamicQuery();
181    
182            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
183            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
184    
185            /**
186            * Returns the OSGi service identifier.
187            *
188            * @return the OSGi service identifier
189            */
190            public java.lang.String getOSGiServiceIdentifier();
191    
192            @Override
193            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
194            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
195                    throws PortalException;
196    
197            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
198            public Ticket getTicket(java.lang.String key) throws PortalException;
199    
200            /**
201            * Returns the ticket with the primary key.
202            *
203            * @param ticketId the primary key of the ticket
204            * @return the ticket
205            * @throws PortalException if a ticket with the primary key could not be found
206            */
207            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
208            public Ticket getTicket(long ticketId) throws PortalException;
209    
210            /**
211            * Returns a range of all the tickets.
212            *
213            * <p>
214            * 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.TicketModelImpl}. 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.
215            * </p>
216            *
217            * @param start the lower bound of the range of tickets
218            * @param end the upper bound of the range of tickets (not inclusive)
219            * @return the range of tickets
220            */
221            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
222            public List<Ticket> getTickets(int start, int end);
223    
224            /**
225            * Returns the number of tickets.
226            *
227            * @return the number of tickets
228            */
229            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
230            public int getTicketsCount();
231    
232            /**
233            * Updates the ticket in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
234            *
235            * @param ticket the ticket
236            * @return the ticket that was updated
237            */
238            @Indexable(type = IndexableType.REINDEX)
239            public Ticket updateTicket(Ticket ticket);
240    }