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.announcements.kernel.service; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.announcements.kernel.model.AnnouncementsDelivery; 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.IndexableActionableDynamicQuery; 024 import com.liferay.portal.kernel.dao.orm.Projection; 025 import com.liferay.portal.kernel.exception.PortalException; 026 import com.liferay.portal.kernel.exception.SystemException; 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 import com.liferay.portal.model.PersistedModel; 034 import com.liferay.portal.service.BaseLocalService; 035 import com.liferay.portal.service.PersistedModelLocalService; 036 037 import java.io.Serializable; 038 039 import java.util.List; 040 041 /** 042 * Provides the local service interface for AnnouncementsDelivery. Methods of this 043 * service will not have security checks based on the propagated JAAS 044 * credentials because this service can only be accessed from within the same 045 * VM. 046 * 047 * @author Brian Wing Shun Chan 048 * @see AnnouncementsDeliveryLocalServiceUtil 049 * @see com.liferay.portlet.announcements.service.base.AnnouncementsDeliveryLocalServiceBaseImpl 050 * @see com.liferay.portlet.announcements.service.impl.AnnouncementsDeliveryLocalServiceImpl 051 * @generated 052 */ 053 @ProviderType 054 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 055 PortalException.class, SystemException.class}) 056 public interface AnnouncementsDeliveryLocalService extends BaseLocalService, 057 PersistedModelLocalService { 058 /* 059 * NOTE FOR DEVELOPERS: 060 * 061 * Never modify or reference this interface directly. Always use {@link AnnouncementsDeliveryLocalServiceUtil} to access the announcements delivery local service. Add custom service methods to {@link com.liferay.portlet.announcements.service.impl.AnnouncementsDeliveryLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 062 */ 063 064 /** 065 * Adds the announcements delivery to the database. Also notifies the appropriate model listeners. 066 * 067 * @param announcementsDelivery the announcements delivery 068 * @return the announcements delivery that was added 069 */ 070 @Indexable(type = IndexableType.REINDEX) 071 public AnnouncementsDelivery addAnnouncementsDelivery( 072 AnnouncementsDelivery announcementsDelivery); 073 074 public AnnouncementsDelivery addUserDelivery(long userId, 075 java.lang.String type) throws PortalException; 076 077 /** 078 * Creates a new announcements delivery with the primary key. Does not add the announcements delivery to the database. 079 * 080 * @param deliveryId the primary key for the new announcements delivery 081 * @return the new announcements delivery 082 */ 083 public AnnouncementsDelivery createAnnouncementsDelivery(long deliveryId); 084 085 /** 086 * Deletes the announcements delivery from the database. Also notifies the appropriate model listeners. 087 * 088 * @param announcementsDelivery the announcements delivery 089 * @return the announcements delivery that was removed 090 */ 091 @Indexable(type = IndexableType.DELETE) 092 public AnnouncementsDelivery deleteAnnouncementsDelivery( 093 AnnouncementsDelivery announcementsDelivery); 094 095 /** 096 * Deletes the announcements delivery with the primary key from the database. Also notifies the appropriate model listeners. 097 * 098 * @param deliveryId the primary key of the announcements delivery 099 * @return the announcements delivery that was removed 100 * @throws PortalException if a announcements delivery with the primary key could not be found 101 */ 102 @Indexable(type = IndexableType.DELETE) 103 public AnnouncementsDelivery deleteAnnouncementsDelivery(long deliveryId) 104 throws PortalException; 105 106 public void deleteDeliveries(long userId); 107 108 public void deleteDelivery(AnnouncementsDelivery delivery); 109 110 public void deleteDelivery(long deliveryId) throws PortalException; 111 112 public void deleteDelivery(long userId, java.lang.String type); 113 114 /** 115 * @throws PortalException 116 */ 117 @Override 118 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 119 throws PortalException; 120 121 public DynamicQuery dynamicQuery(); 122 123 /** 124 * Performs a dynamic query on the database and returns the matching rows. 125 * 126 * @param dynamicQuery the dynamic query 127 * @return the matching rows 128 */ 129 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 130 131 /** 132 * Performs a dynamic query on the database and returns a range of the matching rows. 133 * 134 * <p> 135 * 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.portlet.announcements.model.impl.AnnouncementsDeliveryModelImpl}. 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. 136 * </p> 137 * 138 * @param dynamicQuery the dynamic query 139 * @param start the lower bound of the range of model instances 140 * @param end the upper bound of the range of model instances (not inclusive) 141 * @return the range of matching rows 142 */ 143 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 144 int end); 145 146 /** 147 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 148 * 149 * <p> 150 * 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.portlet.announcements.model.impl.AnnouncementsDeliveryModelImpl}. 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. 151 * </p> 152 * 153 * @param dynamicQuery the dynamic query 154 * @param start the lower bound of the range of model instances 155 * @param end the upper bound of the range of model instances (not inclusive) 156 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 157 * @return the ordered range of matching rows 158 */ 159 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 160 int end, OrderByComparator<T> orderByComparator); 161 162 /** 163 * Returns the number of rows matching the dynamic query. 164 * 165 * @param dynamicQuery the dynamic query 166 * @return the number of rows matching the dynamic query 167 */ 168 public long dynamicQueryCount(DynamicQuery dynamicQuery); 169 170 /** 171 * Returns the number of rows matching the dynamic query. 172 * 173 * @param dynamicQuery the dynamic query 174 * @param projection the projection to apply to the query 175 * @return the number of rows matching the dynamic query 176 */ 177 public long dynamicQueryCount(DynamicQuery dynamicQuery, 178 Projection projection); 179 180 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 181 public AnnouncementsDelivery fetchAnnouncementsDelivery(long deliveryId); 182 183 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 184 public ActionableDynamicQuery getActionableDynamicQuery(); 185 186 /** 187 * Returns a range of all the announcements deliveries. 188 * 189 * <p> 190 * 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.portlet.announcements.model.impl.AnnouncementsDeliveryModelImpl}. 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. 191 * </p> 192 * 193 * @param start the lower bound of the range of announcements deliveries 194 * @param end the upper bound of the range of announcements deliveries (not inclusive) 195 * @return the range of announcements deliveries 196 */ 197 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 198 public List<AnnouncementsDelivery> getAnnouncementsDeliveries(int start, 199 int end); 200 201 /** 202 * Returns the number of announcements deliveries. 203 * 204 * @return the number of announcements deliveries 205 */ 206 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 207 public int getAnnouncementsDeliveriesCount(); 208 209 /** 210 * Returns the announcements delivery with the primary key. 211 * 212 * @param deliveryId the primary key of the announcements delivery 213 * @return the announcements delivery 214 * @throws PortalException if a announcements delivery with the primary key could not be found 215 */ 216 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 217 public AnnouncementsDelivery getAnnouncementsDelivery(long deliveryId) 218 throws PortalException; 219 220 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 221 public AnnouncementsDelivery getDelivery(long deliveryId) 222 throws PortalException; 223 224 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 225 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 226 227 /** 228 * Returns the OSGi service identifier. 229 * 230 * @return the OSGi service identifier 231 */ 232 public java.lang.String getOSGiServiceIdentifier(); 233 234 @Override 235 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 236 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 237 throws PortalException; 238 239 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 240 public List<AnnouncementsDelivery> getUserDeliveries(long userId) 241 throws PortalException; 242 243 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 244 public AnnouncementsDelivery getUserDelivery(long userId, 245 java.lang.String type) throws PortalException; 246 247 /** 248 * Updates the announcements delivery in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 249 * 250 * @param announcementsDelivery the announcements delivery 251 * @return the announcements delivery that was updated 252 */ 253 @Indexable(type = IndexableType.REINDEX) 254 public AnnouncementsDelivery updateAnnouncementsDelivery( 255 AnnouncementsDelivery announcementsDelivery); 256 257 public AnnouncementsDelivery updateDelivery(long userId, 258 java.lang.String type, boolean email, boolean sms, boolean website) 259 throws PortalException; 260 }