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