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.portlet.documentlibrary.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.service.BaseLocalService; 033 import com.liferay.portal.service.PersistedModelLocalService; 034 035 import com.liferay.portlet.documentlibrary.model.DLSyncEvent; 036 037 import java.io.Serializable; 038 039 import java.util.List; 040 041 /** 042 * Provides the local service interface for DLSyncEvent. 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 DLSyncEventLocalServiceUtil 049 * @see com.liferay.portlet.documentlibrary.service.base.DLSyncEventLocalServiceBaseImpl 050 * @see com.liferay.portlet.documentlibrary.service.impl.DLSyncEventLocalServiceImpl 051 * @generated 052 */ 053 @ProviderType 054 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 055 PortalException.class, SystemException.class}) 056 public interface DLSyncEventLocalService extends BaseLocalService, 057 PersistedModelLocalService { 058 /* 059 * NOTE FOR DEVELOPERS: 060 * 061 * Never modify or reference this interface directly. Always use {@link DLSyncEventLocalServiceUtil} to access the d l sync event local service. Add custom service methods to {@link com.liferay.portlet.documentlibrary.service.impl.DLSyncEventLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 062 */ 063 064 /** 065 * Adds the d l sync event to the database. Also notifies the appropriate model listeners. 066 * 067 * @param dlSyncEvent the d l sync event 068 * @return the d l sync event that was added 069 */ 070 @Indexable(type = IndexableType.REINDEX) 071 public DLSyncEvent addDLSyncEvent(DLSyncEvent dlSyncEvent); 072 073 public DLSyncEvent addDLSyncEvent(java.lang.String event, 074 java.lang.String type, long typePK); 075 076 /** 077 * Creates a new d l sync event with the primary key. Does not add the d l sync event to the database. 078 * 079 * @param syncEventId the primary key for the new d l sync event 080 * @return the new d l sync event 081 */ 082 public DLSyncEvent createDLSyncEvent(long syncEventId); 083 084 /** 085 * Deletes the d l sync event from the database. Also notifies the appropriate model listeners. 086 * 087 * @param dlSyncEvent the d l sync event 088 * @return the d l sync event that was removed 089 */ 090 @Indexable(type = IndexableType.DELETE) 091 public DLSyncEvent deleteDLSyncEvent(DLSyncEvent dlSyncEvent); 092 093 /** 094 * Deletes the d l sync event with the primary key from the database. Also notifies the appropriate model listeners. 095 * 096 * @param syncEventId the primary key of the d l sync event 097 * @return the d l sync event that was removed 098 * @throws PortalException if a d l sync event with the primary key could not be found 099 */ 100 @Indexable(type = IndexableType.DELETE) 101 public DLSyncEvent deleteDLSyncEvent(long syncEventId) 102 throws PortalException; 103 104 public void deleteDLSyncEvents(); 105 106 /** 107 * @throws PortalException 108 */ 109 @Override 110 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 111 throws PortalException; 112 113 public DynamicQuery dynamicQuery(); 114 115 /** 116 * Performs a dynamic query on the database and returns the matching rows. 117 * 118 * @param dynamicQuery the dynamic query 119 * @return the matching rows 120 */ 121 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 122 123 /** 124 * Performs a dynamic query on the database and returns a range of the matching rows. 125 * 126 * <p> 127 * 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.documentlibrary.model.impl.DLSyncEventModelImpl}. 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. 128 * </p> 129 * 130 * @param dynamicQuery the dynamic query 131 * @param start the lower bound of the range of model instances 132 * @param end the upper bound of the range of model instances (not inclusive) 133 * @return the range of matching rows 134 */ 135 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 136 int end); 137 138 /** 139 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 140 * 141 * <p> 142 * 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.documentlibrary.model.impl.DLSyncEventModelImpl}. 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. 143 * </p> 144 * 145 * @param dynamicQuery the dynamic query 146 * @param start the lower bound of the range of model instances 147 * @param end the upper bound of the range of model instances (not inclusive) 148 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 149 * @return the ordered range of matching rows 150 */ 151 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 152 int end, OrderByComparator<T> orderByComparator); 153 154 /** 155 * Returns the number of rows matching the dynamic query. 156 * 157 * @param dynamicQuery the dynamic query 158 * @return the number of rows matching the dynamic query 159 */ 160 public long dynamicQueryCount(DynamicQuery dynamicQuery); 161 162 /** 163 * Returns the number of rows matching the dynamic query. 164 * 165 * @param dynamicQuery the dynamic query 166 * @param projection the projection to apply to the query 167 * @return the number of rows matching the dynamic query 168 */ 169 public long dynamicQueryCount(DynamicQuery dynamicQuery, 170 Projection projection); 171 172 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 173 public DLSyncEvent fetchDLSyncEvent(long syncEventId); 174 175 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 176 public ActionableDynamicQuery getActionableDynamicQuery(); 177 178 /** 179 * Returns the d l sync event with the primary key. 180 * 181 * @param syncEventId the primary key of the d l sync event 182 * @return the d l sync event 183 * @throws PortalException if a d l sync event with the primary key could not be found 184 */ 185 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 186 public DLSyncEvent getDLSyncEvent(long syncEventId) 187 throws PortalException; 188 189 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 190 public List<DLSyncEvent> getDLSyncEvents(long modifiedTime); 191 192 /** 193 * Returns a range of all the d l sync events. 194 * 195 * <p> 196 * 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.documentlibrary.model.impl.DLSyncEventModelImpl}. 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. 197 * </p> 198 * 199 * @param start the lower bound of the range of d l sync events 200 * @param end the upper bound of the range of d l sync events (not inclusive) 201 * @return the range of d l sync events 202 */ 203 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 204 public List<DLSyncEvent> getDLSyncEvents(int start, int end); 205 206 /** 207 * Returns the number of d l sync events. 208 * 209 * @return the number of d l sync events 210 */ 211 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 212 public int getDLSyncEventsCount(); 213 214 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 215 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 216 217 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 218 public List<DLSyncEvent> getLatestDLSyncEvents(); 219 220 /** 221 * Returns the OSGi service identifier. 222 * 223 * @return the OSGi service identifier 224 */ 225 public java.lang.String getOSGiServiceIdentifier(); 226 227 @Override 228 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 229 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 230 throws PortalException; 231 232 /** 233 * Updates the d l sync event in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 234 * 235 * @param dlSyncEvent the d l sync event 236 * @return the d l sync event that was updated 237 */ 238 @Indexable(type = IndexableType.REINDEX) 239 public DLSyncEvent updateDLSyncEvent(DLSyncEvent dlSyncEvent); 240 }