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.model.PersistedModel; 028 import com.liferay.portal.kernel.search.Indexable; 029 import com.liferay.portal.kernel.search.IndexableType; 030 import com.liferay.portal.kernel.service.BaseLocalService; 031 import com.liferay.portal.kernel.service.PersistedModelLocalService; 032 import com.liferay.portal.kernel.transaction.Isolation; 033 import com.liferay.portal.kernel.transaction.Propagation; 034 import com.liferay.portal.kernel.transaction.Transactional; 035 import com.liferay.portal.kernel.util.OrderByComparator; 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 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 107 public AnnouncementsDelivery fetchAnnouncementsDelivery(long deliveryId); 108 109 /** 110 * Returns the announcements delivery with the primary key. 111 * 112 * @param deliveryId the primary key of the announcements delivery 113 * @return the announcements delivery 114 * @throws PortalException if a announcements delivery with the primary key could not be found 115 */ 116 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 117 public AnnouncementsDelivery getAnnouncementsDelivery(long deliveryId) 118 throws PortalException; 119 120 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 121 public AnnouncementsDelivery getDelivery(long deliveryId) 122 throws PortalException; 123 124 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 125 public AnnouncementsDelivery getUserDelivery(long userId, 126 java.lang.String type) throws PortalException; 127 128 /** 129 * Updates the announcements delivery in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 130 * 131 * @param announcementsDelivery the announcements delivery 132 * @return the announcements delivery that was updated 133 */ 134 @Indexable(type = IndexableType.REINDEX) 135 public AnnouncementsDelivery updateAnnouncementsDelivery( 136 AnnouncementsDelivery announcementsDelivery); 137 138 public AnnouncementsDelivery updateDelivery(long userId, 139 java.lang.String type, boolean email, boolean sms, boolean website) 140 throws PortalException; 141 142 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 143 public ActionableDynamicQuery getActionableDynamicQuery(); 144 145 public DynamicQuery dynamicQuery(); 146 147 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 148 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 149 150 /** 151 * @throws PortalException 152 */ 153 @Override 154 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 155 throws PortalException; 156 157 @Override 158 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 159 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 160 throws PortalException; 161 162 /** 163 * Returns the number of announcements deliveries. 164 * 165 * @return the number of announcements deliveries 166 */ 167 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 168 public int getAnnouncementsDeliveriesCount(); 169 170 /** 171 * Returns the OSGi service identifier. 172 * 173 * @return the OSGi service identifier 174 */ 175 public java.lang.String getOSGiServiceIdentifier(); 176 177 /** 178 * Performs a dynamic query on the database and returns the matching rows. 179 * 180 * @param dynamicQuery the dynamic query 181 * @return the matching rows 182 */ 183 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 184 185 /** 186 * Performs a dynamic query on the database and returns a range of the matching rows. 187 * 188 * <p> 189 * 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. 190 * </p> 191 * 192 * @param dynamicQuery the dynamic query 193 * @param start the lower bound of the range of model instances 194 * @param end the upper bound of the range of model instances (not inclusive) 195 * @return the range of matching rows 196 */ 197 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 198 int end); 199 200 /** 201 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 202 * 203 * <p> 204 * 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. 205 * </p> 206 * 207 * @param dynamicQuery the dynamic query 208 * @param start the lower bound of the range of model instances 209 * @param end the upper bound of the range of model instances (not inclusive) 210 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 211 * @return the ordered range of matching rows 212 */ 213 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 214 int end, OrderByComparator<T> orderByComparator); 215 216 /** 217 * Returns a range of all the announcements deliveries. 218 * 219 * <p> 220 * 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. 221 * </p> 222 * 223 * @param start the lower bound of the range of announcements deliveries 224 * @param end the upper bound of the range of announcements deliveries (not inclusive) 225 * @return the range of announcements deliveries 226 */ 227 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 228 public List<AnnouncementsDelivery> getAnnouncementsDeliveries(int start, 229 int end); 230 231 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 232 public List<AnnouncementsDelivery> getUserDeliveries(long userId) 233 throws PortalException; 234 235 /** 236 * Returns the number of rows matching the dynamic query. 237 * 238 * @param dynamicQuery the dynamic query 239 * @return the number of rows matching the dynamic query 240 */ 241 public long dynamicQueryCount(DynamicQuery dynamicQuery); 242 243 /** 244 * Returns the number of rows matching the dynamic query. 245 * 246 * @param dynamicQuery the dynamic query 247 * @param projection the projection to apply to the query 248 * @return the number of rows matching the dynamic query 249 */ 250 public long dynamicQueryCount(DynamicQuery dynamicQuery, 251 Projection projection); 252 253 public void deleteDeliveries(long userId); 254 255 public void deleteDelivery(AnnouncementsDelivery delivery); 256 257 public void deleteDelivery(long deliveryId) throws PortalException; 258 259 public void deleteDelivery(long userId, java.lang.String type); 260 }