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.bean.PortalBeanLocatorUtil;
018    
019    /**
020     * The utility for the counter local service. This utility wraps {@link com.liferay.counter.service.impl.CounterLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
021     *
022     * <p>
023     * Never modify this class directly. Add custom service methods to {@link com.liferay.counter.service.impl.CounterLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
024     * </p>
025     *
026     * <p>
027     * 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.
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see CounterLocalService
032     * @see com.liferay.counter.service.base.CounterLocalServiceBaseImpl
033     * @see com.liferay.counter.service.impl.CounterLocalServiceImpl
034     * @generated
035     */
036    public class CounterLocalServiceUtil {
037            /**
038            * Adds the counter to the database. Also notifies the appropriate model listeners.
039            *
040            * @param counter the counter to add
041            * @return the counter that was added
042            * @throws SystemException if a system exception occurred
043            */
044            public static com.liferay.counter.model.Counter addCounter(
045                    com.liferay.counter.model.Counter counter)
046                    throws com.liferay.portal.kernel.exception.SystemException {
047                    return getService().addCounter(counter);
048            }
049    
050            /**
051            * Creates a new counter with the primary key. Does not add the counter to the database.
052            *
053            * @param name the primary key for the new counter
054            * @return the new counter
055            */
056            public static com.liferay.counter.model.Counter createCounter(
057                    java.lang.String name) {
058                    return getService().createCounter(name);
059            }
060    
061            /**
062            * Deletes the counter with the primary key from the database. Also notifies the appropriate model listeners.
063            *
064            * @param name the primary key of the counter to delete
065            * @throws PortalException if a counter with the primary key could not be found
066            * @throws SystemException if a system exception occurred
067            */
068            public static void deleteCounter(java.lang.String name)
069                    throws com.liferay.portal.kernel.exception.PortalException,
070                            com.liferay.portal.kernel.exception.SystemException {
071                    getService().deleteCounter(name);
072            }
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 static void deleteCounter(com.liferay.counter.model.Counter counter)
081                    throws com.liferay.portal.kernel.exception.SystemException {
082                    getService().deleteCounter(counter);
083            }
084    
085            /**
086            * Performs a dynamic query on the database and returns the matching rows.
087            *
088            * @param dynamicQuery the dynamic query to search with
089            * @return the matching rows
090            * @throws SystemException if a system exception occurred
091            */
092            @SuppressWarnings("rawtypes")
093            public static java.util.List dynamicQuery(
094                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
095                    throws com.liferay.portal.kernel.exception.SystemException {
096                    return getService().dynamicQuery(dynamicQuery);
097            }
098    
099            /**
100            * Performs a dynamic query on the database and returns a range of the matching rows.
101            *
102            * <p>
103            * 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.
104            * </p>
105            *
106            * @param dynamicQuery the dynamic query to search with
107            * @param start the lower bound of the range of model instances to return
108            * @param end the upper bound of the range of model instances to return (not inclusive)
109            * @return the range of matching rows
110            * @throws SystemException if a system exception occurred
111            */
112            @SuppressWarnings("rawtypes")
113            public static java.util.List dynamicQuery(
114                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
115                    int end) throws com.liferay.portal.kernel.exception.SystemException {
116                    return getService().dynamicQuery(dynamicQuery, start, end);
117            }
118    
119            /**
120            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
121            *
122            * <p>
123            * 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.
124            * </p>
125            *
126            * @param dynamicQuery the dynamic query to search with
127            * @param start the lower bound of the range of model instances to return
128            * @param end the upper bound of the range of model instances to return (not inclusive)
129            * @param orderByComparator the comparator to order the results by
130            * @return the ordered range of matching rows
131            * @throws SystemException if a system exception occurred
132            */
133            @SuppressWarnings("rawtypes")
134            public static java.util.List dynamicQuery(
135                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
136                    int end,
137                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
138                    throws com.liferay.portal.kernel.exception.SystemException {
139                    return getService()
140                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
141            }
142    
143            /**
144            * Counts the number of rows that match the dynamic query.
145            *
146            * @param dynamicQuery the dynamic query to search with
147            * @return the number of rows that match the dynamic query
148            * @throws SystemException if a system exception occurred
149            */
150            public static long dynamicQueryCount(
151                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
152                    throws com.liferay.portal.kernel.exception.SystemException {
153                    return getService().dynamicQueryCount(dynamicQuery);
154            }
155    
156            /**
157            * Gets the counter with the primary key.
158            *
159            * @param name the primary key of the counter to get
160            * @return the counter
161            * @throws PortalException if a counter with the primary key could not be found
162            * @throws SystemException if a system exception occurred
163            */
164            public static com.liferay.counter.model.Counter getCounter(
165                    java.lang.String name)
166                    throws com.liferay.portal.kernel.exception.PortalException,
167                            com.liferay.portal.kernel.exception.SystemException {
168                    return getService().getCounter(name);
169            }
170    
171            /**
172            * Gets a range of all the counters.
173            *
174            * <p>
175            * 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.
176            * </p>
177            *
178            * @param start the lower bound of the range of counters to return
179            * @param end the upper bound of the range of counters to return (not inclusive)
180            * @return the range of counters
181            * @throws SystemException if a system exception occurred
182            */
183            public static java.util.List<com.liferay.counter.model.Counter> getCounters(
184                    int start, int end)
185                    throws com.liferay.portal.kernel.exception.SystemException {
186                    return getService().getCounters(start, end);
187            }
188    
189            /**
190            * Gets the number of counters.
191            *
192            * @return the number of counters
193            * @throws SystemException if a system exception occurred
194            */
195            public static int getCountersCount()
196                    throws com.liferay.portal.kernel.exception.SystemException {
197                    return getService().getCountersCount();
198            }
199    
200            /**
201            * Updates the counter in the database. Also notifies the appropriate model listeners.
202            *
203            * @param counter the counter to update
204            * @return the counter that was updated
205            * @throws SystemException if a system exception occurred
206            */
207            public static com.liferay.counter.model.Counter updateCounter(
208                    com.liferay.counter.model.Counter counter)
209                    throws com.liferay.portal.kernel.exception.SystemException {
210                    return getService().updateCounter(counter);
211            }
212    
213            /**
214            * Updates the counter in the database. Also notifies the appropriate model listeners.
215            *
216            * @param counter the counter to update
217            * @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.
218            * @return the counter that was updated
219            * @throws SystemException if a system exception occurred
220            */
221            public static com.liferay.counter.model.Counter updateCounter(
222                    com.liferay.counter.model.Counter counter, boolean merge)
223                    throws com.liferay.portal.kernel.exception.SystemException {
224                    return getService().updateCounter(counter, merge);
225            }
226    
227            public static java.util.List<java.lang.String> getNames()
228                    throws com.liferay.portal.kernel.exception.SystemException {
229                    return getService().getNames();
230            }
231    
232            public static long increment()
233                    throws com.liferay.portal.kernel.exception.SystemException {
234                    return getService().increment();
235            }
236    
237            public static long increment(java.lang.String name)
238                    throws com.liferay.portal.kernel.exception.SystemException {
239                    return getService().increment(name);
240            }
241    
242            public static long increment(java.lang.String name, int size)
243                    throws com.liferay.portal.kernel.exception.SystemException {
244                    return getService().increment(name, size);
245            }
246    
247            public static void rename(java.lang.String oldName, java.lang.String newName)
248                    throws com.liferay.portal.kernel.exception.SystemException {
249                    getService().rename(oldName, newName);
250            }
251    
252            public static void reset(java.lang.String name)
253                    throws com.liferay.portal.kernel.exception.SystemException {
254                    getService().reset(name);
255            }
256    
257            public static void reset(java.lang.String name, long size)
258                    throws com.liferay.portal.kernel.exception.SystemException {
259                    getService().reset(name, size);
260            }
261    
262            public static CounterLocalService getService() {
263                    if (_service == null) {
264                            _service = (CounterLocalService)PortalBeanLocatorUtil.locate(CounterLocalService.class.getName());
265                    }
266    
267                    return _service;
268            }
269    
270            public void setService(CounterLocalService service) {
271                    _service = service;
272            }
273    
274            private static CounterLocalService _service;
275    }