001    /**
002     * Copyright (c) 2000-2010 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.counter.service;
016    
017    import com.liferay.portal.kernel.annotation.Isolation;
018    import com.liferay.portal.kernel.annotation.Propagation;
019    import com.liferay.portal.kernel.annotation.Transactional;
020    import com.liferay.portal.kernel.exception.PortalException;
021    import com.liferay.portal.kernel.exception.SystemException;
022    
023    /**
024     * The interface for the counter local service.
025     *
026     * <p>
027     * Never modify or reference this interface directly. Always use {@link CounterLocalServiceUtil} to access the counter local service. Add custom service methods to {@link com.liferay.counter.service.impl.CounterLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
028     * </p>
029     *
030     * <p>
031     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see CounterLocalServiceUtil
036     * @see com.liferay.counter.service.base.CounterLocalServiceBaseImpl
037     * @see com.liferay.counter.service.impl.CounterLocalServiceImpl
038     * @generated
039     */
040    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
041            PortalException.class, SystemException.class})
042    public interface CounterLocalService {
043            /**
044            * Adds the counter to the database. Also notifies the appropriate model listeners.
045            *
046            * @param counter the counter to add
047            * @return the counter that was added
048            * @throws SystemException if a system exception occurred
049            */
050            public com.liferay.counter.model.Counter addCounter(
051                    com.liferay.counter.model.Counter counter)
052                    throws com.liferay.portal.kernel.exception.SystemException;
053    
054            /**
055            * Creates a new counter with the primary key. Does not add the counter to the database.
056            *
057            * @param name the primary key for the new counter
058            * @return the new counter
059            */
060            public com.liferay.counter.model.Counter createCounter(
061                    java.lang.String name);
062    
063            /**
064            * Deletes the counter with the primary key from the database. Also notifies the appropriate model listeners.
065            *
066            * @param name the primary key of the counter to delete
067            * @throws PortalException if a counter with the primary key could not be found
068            * @throws SystemException if a system exception occurred
069            */
070            public void deleteCounter(java.lang.String name)
071                    throws com.liferay.portal.kernel.exception.PortalException,
072                            com.liferay.portal.kernel.exception.SystemException;
073    
074            /**
075            * Deletes the counter from the database. Also notifies the appropriate model listeners.
076            *
077            * @param counter the counter to delete
078            * @throws SystemException if a system exception occurred
079            */
080            public void deleteCounter(com.liferay.counter.model.Counter counter)
081                    throws com.liferay.portal.kernel.exception.SystemException;
082    
083            /**
084            * Performs a dynamic query on the database and returns the matching rows.
085            *
086            * @param dynamicQuery the dynamic query to search with
087            * @return the matching rows
088            * @throws SystemException if a system exception occurred
089            */
090            @SuppressWarnings("rawtypes")
091            public java.util.List dynamicQuery(
092                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
093                    throws com.liferay.portal.kernel.exception.SystemException;
094    
095            /**
096            * Performs a dynamic query on the database and returns a range of the matching rows.
097            *
098            * <p>
099            * 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.
100            * </p>
101            *
102            * @param dynamicQuery the dynamic query to search with
103            * @param start the lower bound of the range of model instances to return
104            * @param end the upper bound of the range of model instances to return (not inclusive)
105            * @return the range of matching rows
106            * @throws SystemException if a system exception occurred
107            */
108            @SuppressWarnings("rawtypes")
109            public java.util.List dynamicQuery(
110                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
111                    int end) throws com.liferay.portal.kernel.exception.SystemException;
112    
113            /**
114            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
115            *
116            * <p>
117            * 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.
118            * </p>
119            *
120            * @param dynamicQuery the dynamic query to search with
121            * @param start the lower bound of the range of model instances to return
122            * @param end the upper bound of the range of model instances to return (not inclusive)
123            * @param orderByComparator the comparator to order the results by
124            * @return the ordered range of matching rows
125            * @throws SystemException if a system exception occurred
126            */
127            @SuppressWarnings("rawtypes")
128            public java.util.List dynamicQuery(
129                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
130                    int end,
131                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
132                    throws com.liferay.portal.kernel.exception.SystemException;
133    
134            /**
135            * Counts the number of rows that match the dynamic query.
136            *
137            * @param dynamicQuery the dynamic query to search with
138            * @return the number of rows that match the dynamic query
139            * @throws SystemException if a system exception occurred
140            */
141            public long dynamicQueryCount(
142                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
143                    throws com.liferay.portal.kernel.exception.SystemException;
144    
145            /**
146            * Gets the counter with the primary key.
147            *
148            * @param name the primary key of the counter to get
149            * @return the counter
150            * @throws PortalException if a counter with the primary key could not be found
151            * @throws SystemException if a system exception occurred
152            */
153            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
154            public com.liferay.counter.model.Counter getCounter(java.lang.String name)
155                    throws com.liferay.portal.kernel.exception.PortalException,
156                            com.liferay.portal.kernel.exception.SystemException;
157    
158            /**
159            * Gets a range of all the counters.
160            *
161            * <p>
162            * 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.
163            * </p>
164            *
165            * @param start the lower bound of the range of counters to return
166            * @param end the upper bound of the range of counters to return (not inclusive)
167            * @return the range of counters
168            * @throws SystemException if a system exception occurred
169            */
170            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
171            public java.util.List<com.liferay.counter.model.Counter> getCounters(
172                    int start, int end)
173                    throws com.liferay.portal.kernel.exception.SystemException;
174    
175            /**
176            * Gets the number of counters.
177            *
178            * @return the number of counters
179            * @throws SystemException if a system exception occurred
180            */
181            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
182            public int getCountersCount()
183                    throws com.liferay.portal.kernel.exception.SystemException;
184    
185            /**
186            * Updates the counter in the database. Also notifies the appropriate model listeners.
187            *
188            * @param counter the counter to update
189            * @return the counter that was updated
190            * @throws SystemException if a system exception occurred
191            */
192            public com.liferay.counter.model.Counter updateCounter(
193                    com.liferay.counter.model.Counter counter)
194                    throws com.liferay.portal.kernel.exception.SystemException;
195    
196            /**
197            * Updates the counter in the database. Also notifies the appropriate model listeners.
198            *
199            * @param counter the counter to update
200            * @param merge whether to merge the counter with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
201            * @return the counter that was updated
202            * @throws SystemException if a system exception occurred
203            */
204            public com.liferay.counter.model.Counter updateCounter(
205                    com.liferay.counter.model.Counter counter, boolean merge)
206                    throws com.liferay.portal.kernel.exception.SystemException;
207    
208            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
209            public java.util.List<java.lang.String> getNames()
210                    throws com.liferay.portal.kernel.exception.SystemException;
211    
212            public long increment()
213                    throws com.liferay.portal.kernel.exception.SystemException;
214    
215            public long increment(java.lang.String name)
216                    throws com.liferay.portal.kernel.exception.SystemException;
217    
218            public long increment(java.lang.String name, int size)
219                    throws com.liferay.portal.kernel.exception.SystemException;
220    
221            public void rename(java.lang.String oldName, java.lang.String newName)
222                    throws com.liferay.portal.kernel.exception.SystemException;
223    
224            public void reset(java.lang.String name)
225                    throws com.liferay.portal.kernel.exception.SystemException;
226    
227            public void reset(java.lang.String name, long size)
228                    throws com.liferay.portal.kernel.exception.SystemException;
229    }