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.bean.PortalBeanLocatorUtil; 020 import com.liferay.portal.kernel.util.ReferenceRegistry; 021 022 /** 023 * Provides the local service utility for Ticket. This utility wraps 024 * {@link com.liferay.portal.service.impl.TicketLocalServiceImpl} and is the 025 * primary access point for service operations in application layer code running 026 * on the local server. Methods of this service will not have security checks 027 * based on the propagated JAAS credentials because this service can only be 028 * accessed from within the same VM. 029 * 030 * @author Brian Wing Shun Chan 031 * @see TicketLocalService 032 * @see com.liferay.portal.service.base.TicketLocalServiceBaseImpl 033 * @see com.liferay.portal.service.impl.TicketLocalServiceImpl 034 * @generated 035 */ 036 @ProviderType 037 public class TicketLocalServiceUtil { 038 /* 039 * NOTE FOR DEVELOPERS: 040 * 041 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.TicketLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 042 */ 043 public static com.liferay.portal.model.Ticket addDistinctTicket( 044 long companyId, java.lang.String className, long classPK, int type, 045 java.lang.String extraInfo, java.util.Date expirationDate, 046 com.liferay.portal.service.ServiceContext serviceContext) { 047 return getService() 048 .addDistinctTicket(companyId, className, classPK, type, 049 extraInfo, expirationDate, serviceContext); 050 } 051 052 public static com.liferay.portal.model.Ticket addTicket(long companyId, 053 java.lang.String className, long classPK, int type, 054 java.lang.String extraInfo, java.util.Date expirationDate, 055 com.liferay.portal.service.ServiceContext serviceContext) { 056 return getService() 057 .addTicket(companyId, className, classPK, type, extraInfo, 058 expirationDate, serviceContext); 059 } 060 061 /** 062 * Adds the ticket to the database. Also notifies the appropriate model listeners. 063 * 064 * @param ticket the ticket 065 * @return the ticket that was added 066 */ 067 public static com.liferay.portal.model.Ticket addTicket( 068 com.liferay.portal.model.Ticket ticket) { 069 return getService().addTicket(ticket); 070 } 071 072 /** 073 * Creates a new ticket with the primary key. Does not add the ticket to the database. 074 * 075 * @param ticketId the primary key for the new ticket 076 * @return the new ticket 077 */ 078 public static com.liferay.portal.model.Ticket createTicket(long ticketId) { 079 return getService().createTicket(ticketId); 080 } 081 082 /** 083 * @throws PortalException 084 */ 085 public static com.liferay.portal.model.PersistedModel deletePersistedModel( 086 com.liferay.portal.model.PersistedModel persistedModel) 087 throws com.liferay.portal.kernel.exception.PortalException { 088 return getService().deletePersistedModel(persistedModel); 089 } 090 091 /** 092 * Deletes the ticket from the database. Also notifies the appropriate model listeners. 093 * 094 * @param ticket the ticket 095 * @return the ticket that was removed 096 */ 097 public static com.liferay.portal.model.Ticket deleteTicket( 098 com.liferay.portal.model.Ticket ticket) { 099 return getService().deleteTicket(ticket); 100 } 101 102 /** 103 * Deletes the ticket with the primary key from the database. Also notifies the appropriate model listeners. 104 * 105 * @param ticketId the primary key of the ticket 106 * @return the ticket that was removed 107 * @throws PortalException if a ticket with the primary key could not be found 108 */ 109 public static com.liferay.portal.model.Ticket deleteTicket(long ticketId) 110 throws com.liferay.portal.kernel.exception.PortalException { 111 return getService().deleteTicket(ticketId); 112 } 113 114 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 115 return getService().dynamicQuery(); 116 } 117 118 /** 119 * Performs a dynamic query on the database and returns the matching rows. 120 * 121 * @param dynamicQuery the dynamic query 122 * @return the matching rows 123 */ 124 public static <T> java.util.List<T> dynamicQuery( 125 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 126 return getService().dynamicQuery(dynamicQuery); 127 } 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.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. 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 static <T> java.util.List<T> dynamicQuery( 142 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 143 int end) { 144 return getService().dynamicQuery(dynamicQuery, start, end); 145 } 146 147 /** 148 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 149 * 150 * <p> 151 * 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. 152 * </p> 153 * 154 * @param dynamicQuery the dynamic query 155 * @param start the lower bound of the range of model instances 156 * @param end the upper bound of the range of model instances (not inclusive) 157 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 158 * @return the ordered range of matching rows 159 */ 160 public static <T> java.util.List<T> dynamicQuery( 161 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 162 int end, 163 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) { 164 return getService() 165 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 166 } 167 168 /** 169 * Returns the number of rows matching the dynamic query. 170 * 171 * @param dynamicQuery the dynamic query 172 * @return the number of rows matching the dynamic query 173 */ 174 public static long dynamicQueryCount( 175 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 176 return getService().dynamicQueryCount(dynamicQuery); 177 } 178 179 /** 180 * Returns the number of rows matching the dynamic query. 181 * 182 * @param dynamicQuery the dynamic query 183 * @param projection the projection to apply to the query 184 * @return the number of rows matching the dynamic query 185 */ 186 public static long dynamicQueryCount( 187 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 188 com.liferay.portal.kernel.dao.orm.Projection projection) { 189 return getService().dynamicQueryCount(dynamicQuery, projection); 190 } 191 192 public static com.liferay.portal.model.Ticket fetchTicket( 193 java.lang.String key) { 194 return getService().fetchTicket(key); 195 } 196 197 public static com.liferay.portal.model.Ticket fetchTicket(long ticketId) { 198 return getService().fetchTicket(ticketId); 199 } 200 201 public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() { 202 return getService().getActionableDynamicQuery(); 203 } 204 205 public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() { 206 return getService().getIndexableActionableDynamicQuery(); 207 } 208 209 /** 210 * Returns the OSGi service identifier. 211 * 212 * @return the OSGi service identifier 213 */ 214 public static java.lang.String getOSGiServiceIdentifier() { 215 return getService().getOSGiServiceIdentifier(); 216 } 217 218 public static com.liferay.portal.model.PersistedModel getPersistedModel( 219 java.io.Serializable primaryKeyObj) 220 throws com.liferay.portal.kernel.exception.PortalException { 221 return getService().getPersistedModel(primaryKeyObj); 222 } 223 224 public static com.liferay.portal.model.Ticket getTicket( 225 java.lang.String key) 226 throws com.liferay.portal.kernel.exception.PortalException { 227 return getService().getTicket(key); 228 } 229 230 /** 231 * Returns the ticket with the primary key. 232 * 233 * @param ticketId the primary key of the ticket 234 * @return the ticket 235 * @throws PortalException if a ticket with the primary key could not be found 236 */ 237 public static com.liferay.portal.model.Ticket getTicket(long ticketId) 238 throws com.liferay.portal.kernel.exception.PortalException { 239 return getService().getTicket(ticketId); 240 } 241 242 /** 243 * Returns a range of all the tickets. 244 * 245 * <p> 246 * 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. 247 * </p> 248 * 249 * @param start the lower bound of the range of tickets 250 * @param end the upper bound of the range of tickets (not inclusive) 251 * @return the range of tickets 252 */ 253 public static java.util.List<com.liferay.portal.model.Ticket> getTickets( 254 int start, int end) { 255 return getService().getTickets(start, end); 256 } 257 258 /** 259 * Returns the number of tickets. 260 * 261 * @return the number of tickets 262 */ 263 public static int getTicketsCount() { 264 return getService().getTicketsCount(); 265 } 266 267 /** 268 * Updates the ticket in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 269 * 270 * @param ticket the ticket 271 * @return the ticket that was updated 272 */ 273 public static com.liferay.portal.model.Ticket updateTicket( 274 com.liferay.portal.model.Ticket ticket) { 275 return getService().updateTicket(ticket); 276 } 277 278 public static TicketLocalService getService() { 279 if (_service == null) { 280 _service = (TicketLocalService)PortalBeanLocatorUtil.locate(TicketLocalService.class.getName()); 281 282 ReferenceRegistry.registerReference(TicketLocalServiceUtil.class, 283 "_service"); 284 } 285 286 return _service; 287 } 288 289 private static TicketLocalService _service; 290 }