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.messageboards.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.messageboards.model.MBStatsUser;
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            /**
105            * @throws PortalException
106            */
107            @Override
108            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
109                    throws PortalException;
110    
111            public void deleteStatsUser(MBStatsUser statsUser);
112    
113            public void deleteStatsUser(long statsUserId) throws PortalException;
114    
115            public void deleteStatsUsersByGroupId(long groupId);
116    
117            public void deleteStatsUsersByUserId(long userId);
118    
119            public DynamicQuery dynamicQuery();
120    
121            /**
122            * Performs a dynamic query on the database and returns the matching rows.
123            *
124            * @param dynamicQuery the dynamic query
125            * @return the matching rows
126            */
127            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
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.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.
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 <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
142                    int end);
143    
144            /**
145            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
146            *
147            * <p>
148            * 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.
149            * </p>
150            *
151            * @param dynamicQuery the dynamic query
152            * @param start the lower bound of the range of model instances
153            * @param end the upper bound of the range of model instances (not inclusive)
154            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
155            * @return the ordered range of matching rows
156            */
157            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
158                    int end, OrderByComparator<T> orderByComparator);
159    
160            /**
161            * Returns the number of rows matching the dynamic query.
162            *
163            * @param dynamicQuery the dynamic query
164            * @return the number of rows matching the dynamic query
165            */
166            public long dynamicQueryCount(DynamicQuery dynamicQuery);
167    
168            /**
169            * Returns the number of rows matching the dynamic query.
170            *
171            * @param dynamicQuery the dynamic query
172            * @param projection the projection to apply to the query
173            * @return the number of rows matching the dynamic query
174            */
175            public long dynamicQueryCount(DynamicQuery dynamicQuery,
176                    Projection projection);
177    
178            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
179            public MBStatsUser fetchMBStatsUser(long statsUserId);
180    
181            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
182            public ActionableDynamicQuery getActionableDynamicQuery();
183    
184            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
185            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
186    
187            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
188            public Date getLastPostDateByUserId(long groupId, long userId);
189    
190            /**
191            * Returns the message boards stats user with the primary key.
192            *
193            * @param statsUserId the primary key of the message boards stats user
194            * @return the message boards stats user
195            * @throws PortalException if a message boards stats user with the primary key could not be found
196            */
197            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
198            public MBStatsUser getMBStatsUser(long statsUserId)
199                    throws PortalException;
200    
201            /**
202            * Returns a range of all the message boards stats users.
203            *
204            * <p>
205            * 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.
206            * </p>
207            *
208            * @param start the lower bound of the range of message boards stats users
209            * @param end the upper bound of the range of message boards stats users (not inclusive)
210            * @return the range of message boards stats users
211            */
212            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
213            public List<MBStatsUser> getMBStatsUsers(int start, int end);
214    
215            /**
216            * Returns the number of message boards stats users.
217            *
218            * @return the number of message boards stats users
219            */
220            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
221            public int getMBStatsUsersCount();
222    
223            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
224            public long getMessageCountByGroupId(long groupId);
225    
226            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
227            public long getMessageCountByUserId(long userId);
228    
229            /**
230            * Returns the OSGi service identifier.
231            *
232            * @return the OSGi service identifier
233            */
234            public java.lang.String getOSGiServiceIdentifier();
235    
236            @Override
237            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
238            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
239                    throws PortalException;
240    
241            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
242            public MBStatsUser getStatsUser(long groupId, long userId);
243    
244            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
245            public List<MBStatsUser> getStatsUsersByGroupId(long groupId, int start,
246                    int end) throws PortalException;
247    
248            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
249            public int getStatsUsersByGroupIdCount(long groupId)
250                    throws PortalException;
251    
252            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
253            public List<MBStatsUser> getStatsUsersByUserId(long userId);
254    
255            /**
256            * Updates the message boards stats user in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
257            *
258            * @param mbStatsUser the message boards stats user
259            * @return the message boards stats user that was updated
260            */
261            @Indexable(type = IndexableType.REINDEX)
262            public MBStatsUser updateMBStatsUser(MBStatsUser mbStatsUser);
263    
264            public MBStatsUser updateStatsUser(long groupId, long userId);
265    
266            public MBStatsUser updateStatsUser(long groupId, long userId,
267                    Date lastPostDate);
268    
269            public MBStatsUser updateStatsUser(long groupId, long userId,
270                    int messageCount, Date lastPostDate);
271    }