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.Ticket;
027    import com.liferay.portal.kernel.search.Indexable;
028    import com.liferay.portal.kernel.search.IndexableType;
029    import com.liferay.portal.kernel.transaction.Isolation;
030    import com.liferay.portal.kernel.transaction.Propagation;
031    import com.liferay.portal.kernel.transaction.Transactional;
032    import com.liferay.portal.kernel.util.OrderByComparator;
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            @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            public Ticket addDistinctTicket(long companyId, java.lang.String className,
082                    long classPK, int type, java.lang.String extraInfo,
083                    Date expirationDate, ServiceContext serviceContext);
084    
085            /**
086            * Adds the ticket to the database. Also notifies the appropriate model listeners.
087            *
088            * @param ticket the ticket
089            * @return the ticket that was added
090            */
091            @Indexable(type = IndexableType.REINDEX)
092            public Ticket addTicket(Ticket ticket);
093    
094            public Ticket addTicket(long companyId, java.lang.String className,
095                    long classPK, int type, java.lang.String extraInfo,
096                    Date expirationDate, ServiceContext serviceContext);
097    
098            /**
099            * Creates a new ticket with the primary key. Does not add the ticket to the database.
100            *
101            * @param ticketId the primary key for the new ticket
102            * @return the new ticket
103            */
104            public Ticket createTicket(long ticketId);
105    
106            /**
107            * Deletes the ticket from the database. Also notifies the appropriate model listeners.
108            *
109            * @param ticket the ticket
110            * @return the ticket that was removed
111            */
112            @Indexable(type = IndexableType.DELETE)
113            public Ticket deleteTicket(Ticket ticket);
114    
115            /**
116            * Deletes the ticket with the primary key from the database. Also notifies the appropriate model listeners.
117            *
118            * @param ticketId the primary key of the ticket
119            * @return the ticket that was removed
120            * @throws PortalException if a ticket with the primary key could not be found
121            */
122            @Indexable(type = IndexableType.DELETE)
123            public Ticket deleteTicket(long ticketId) throws PortalException;
124    
125            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
126            public Ticket fetchTicket(java.lang.String key);
127    
128            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
129            public Ticket fetchTicket(long ticketId);
130    
131            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
132            public Ticket getTicket(java.lang.String key) throws PortalException;
133    
134            /**
135            * Returns the ticket with the primary key.
136            *
137            * @param ticketId the primary key of the ticket
138            * @return the ticket
139            * @throws PortalException if a ticket with the primary key could not be found
140            */
141            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
142            public Ticket getTicket(long ticketId) throws PortalException;
143    
144            /**
145            * Updates the ticket in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
146            *
147            * @param ticket the ticket
148            * @return the ticket that was updated
149            */
150            @Indexable(type = IndexableType.REINDEX)
151            public Ticket updateTicket(Ticket ticket);
152    
153            /**
154            * Returns the number of tickets.
155            *
156            * @return the number of tickets
157            */
158            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
159            public int getTicketsCount();
160    
161            /**
162            * Returns the OSGi service identifier.
163            *
164            * @return the OSGi service identifier
165            */
166            public java.lang.String getOSGiServiceIdentifier();
167    
168            /**
169            * Performs a dynamic query on the database and returns the matching rows.
170            *
171            * @param dynamicQuery the dynamic query
172            * @return the matching rows
173            */
174            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
175    
176            /**
177            * Performs a dynamic query on the database and returns a range of the matching rows.
178            *
179            * <p>
180            * 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.
181            * </p>
182            *
183            * @param dynamicQuery the dynamic query
184            * @param start the lower bound of the range of model instances
185            * @param end the upper bound of the range of model instances (not inclusive)
186            * @return the range of matching rows
187            */
188            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
189                    int end);
190    
191            /**
192            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
193            *
194            * <p>
195            * 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.
196            * </p>
197            *
198            * @param dynamicQuery the dynamic query
199            * @param start the lower bound of the range of model instances
200            * @param end the upper bound of the range of model instances (not inclusive)
201            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
202            * @return the ordered range of matching rows
203            */
204            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
205                    int end, OrderByComparator<T> orderByComparator);
206    
207            /**
208            * Returns a range of all the tickets.
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.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.
212            * </p>
213            *
214            * @param start the lower bound of the range of tickets
215            * @param end the upper bound of the range of tickets (not inclusive)
216            * @return the range of tickets
217            */
218            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
219            public List<Ticket> getTickets(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    }