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.asset.service.http;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.log.Log;
020    import com.liferay.portal.kernel.log.LogFactoryUtil;
021    import com.liferay.portal.kernel.util.MethodHandler;
022    import com.liferay.portal.kernel.util.MethodKey;
023    import com.liferay.portal.security.auth.HttpPrincipal;
024    import com.liferay.portal.service.http.TunnelUtil;
025    
026    import com.liferay.portlet.asset.service.AssetEntryServiceUtil;
027    
028    /**
029     * Provides the HTTP utility for the
030     * {@link com.liferay.portlet.asset.service.AssetEntryServiceUtil} service utility. The
031     * static methods of this class calls the same methods of the service utility.
032     * However, the signatures are different because it requires an additional
033     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
034     *
035     * <p>
036     * The benefits of using the HTTP utility is that it is fast and allows for
037     * tunneling without the cost of serializing to text. The drawback is that it
038     * only works with Java.
039     * </p>
040     *
041     * <p>
042     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
043     * configure security.
044     * </p>
045     *
046     * <p>
047     * The HTTP utility is only generated for remote services.
048     * </p>
049     *
050     * @author Brian Wing Shun Chan
051     * @see AssetEntryServiceSoap
052     * @see com.liferay.portal.security.auth.HttpPrincipal
053     * @see com.liferay.portlet.asset.service.AssetEntryServiceUtil
054     * @generated
055     */
056    @ProviderType
057    public class AssetEntryServiceHttp {
058            public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getCompanyEntries(
059                    HttpPrincipal httpPrincipal, long companyId, int start, int end) {
060                    try {
061                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
062                                            "getCompanyEntries", _getCompanyEntriesParameterTypes0);
063    
064                            MethodHandler methodHandler = new MethodHandler(methodKey,
065                                            companyId, start, end);
066    
067                            Object returnObj = null;
068    
069                            try {
070                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
071                            }
072                            catch (Exception e) {
073                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
074                            }
075    
076                            return (java.util.List<com.liferay.portlet.asset.model.AssetEntry>)returnObj;
077                    }
078                    catch (com.liferay.portal.kernel.exception.SystemException se) {
079                            _log.error(se, se);
080    
081                            throw se;
082                    }
083            }
084    
085            public static int getCompanyEntriesCount(HttpPrincipal httpPrincipal,
086                    long companyId) {
087                    try {
088                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
089                                            "getCompanyEntriesCount",
090                                            _getCompanyEntriesCountParameterTypes1);
091    
092                            MethodHandler methodHandler = new MethodHandler(methodKey, companyId);
093    
094                            Object returnObj = null;
095    
096                            try {
097                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
098                            }
099                            catch (Exception e) {
100                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
101                            }
102    
103                            return ((Integer)returnObj).intValue();
104                    }
105                    catch (com.liferay.portal.kernel.exception.SystemException se) {
106                            _log.error(se, se);
107    
108                            throw se;
109                    }
110            }
111    
112            public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getEntries(
113                    HttpPrincipal httpPrincipal,
114                    com.liferay.portlet.asset.service.persistence.AssetEntryQuery entryQuery)
115                    throws com.liferay.portal.kernel.exception.PortalException {
116                    try {
117                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
118                                            "getEntries", _getEntriesParameterTypes2);
119    
120                            MethodHandler methodHandler = new MethodHandler(methodKey,
121                                            entryQuery);
122    
123                            Object returnObj = null;
124    
125                            try {
126                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
127                            }
128                            catch (Exception e) {
129                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
130                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
131                                    }
132    
133                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
134                            }
135    
136                            return (java.util.List<com.liferay.portlet.asset.model.AssetEntry>)returnObj;
137                    }
138                    catch (com.liferay.portal.kernel.exception.SystemException se) {
139                            _log.error(se, se);
140    
141                            throw se;
142                    }
143            }
144    
145            public static int getEntriesCount(HttpPrincipal httpPrincipal,
146                    com.liferay.portlet.asset.service.persistence.AssetEntryQuery entryQuery)
147                    throws com.liferay.portal.kernel.exception.PortalException {
148                    try {
149                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
150                                            "getEntriesCount", _getEntriesCountParameterTypes3);
151    
152                            MethodHandler methodHandler = new MethodHandler(methodKey,
153                                            entryQuery);
154    
155                            Object returnObj = null;
156    
157                            try {
158                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
159                            }
160                            catch (Exception e) {
161                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
162                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
163                                    }
164    
165                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
166                            }
167    
168                            return ((Integer)returnObj).intValue();
169                    }
170                    catch (com.liferay.portal.kernel.exception.SystemException se) {
171                            _log.error(se, se);
172    
173                            throw se;
174                    }
175            }
176    
177            public static com.liferay.portlet.asset.model.AssetEntry getEntry(
178                    HttpPrincipal httpPrincipal, long entryId)
179                    throws com.liferay.portal.kernel.exception.PortalException {
180                    try {
181                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
182                                            "getEntry", _getEntryParameterTypes4);
183    
184                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
185    
186                            Object returnObj = null;
187    
188                            try {
189                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
190                            }
191                            catch (Exception e) {
192                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
193                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
194                                    }
195    
196                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
197                            }
198    
199                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
200                    }
201                    catch (com.liferay.portal.kernel.exception.SystemException se) {
202                            _log.error(se, se);
203    
204                            throw se;
205                    }
206            }
207    
208            public static com.liferay.portlet.asset.model.AssetEntry incrementViewCounter(
209                    HttpPrincipal httpPrincipal, java.lang.String className, long classPK)
210                    throws com.liferay.portal.kernel.exception.PortalException {
211                    try {
212                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
213                                            "incrementViewCounter", _incrementViewCounterParameterTypes5);
214    
215                            MethodHandler methodHandler = new MethodHandler(methodKey,
216                                            className, classPK);
217    
218                            Object returnObj = null;
219    
220                            try {
221                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
222                            }
223                            catch (Exception e) {
224                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
225                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
226                                    }
227    
228                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
229                            }
230    
231                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
232                    }
233                    catch (com.liferay.portal.kernel.exception.SystemException se) {
234                            _log.error(se, se);
235    
236                            throw se;
237                    }
238            }
239    
240            public static com.liferay.portlet.asset.model.AssetEntry updateEntry(
241                    HttpPrincipal httpPrincipal, long groupId, java.util.Date createDate,
242                    java.util.Date modifiedDate, java.lang.String className, long classPK,
243                    java.lang.String classUuid, long classTypeId, long[] categoryIds,
244                    java.lang.String[] tagNames, boolean visible, java.util.Date startDate,
245                    java.util.Date endDate, java.util.Date expirationDate,
246                    java.lang.String mimeType, java.lang.String title,
247                    java.lang.String description, java.lang.String summary,
248                    java.lang.String url, java.lang.String layoutUuid, int height,
249                    int width, java.lang.Integer priority, boolean sync)
250                    throws com.liferay.portal.kernel.exception.PortalException {
251                    try {
252                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
253                                            "updateEntry", _updateEntryParameterTypes6);
254    
255                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
256                                            createDate, modifiedDate, className, classPK, classUuid,
257                                            classTypeId, categoryIds, tagNames, visible, startDate,
258                                            endDate, expirationDate, mimeType, title, description,
259                                            summary, url, layoutUuid, height, width, priority, sync);
260    
261                            Object returnObj = null;
262    
263                            try {
264                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
265                            }
266                            catch (Exception e) {
267                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
268                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
269                                    }
270    
271                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
272                            }
273    
274                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
275                    }
276                    catch (com.liferay.portal.kernel.exception.SystemException se) {
277                            _log.error(se, se);
278    
279                            throw se;
280                    }
281            }
282    
283            public static com.liferay.portlet.asset.model.AssetEntry updateEntry(
284                    HttpPrincipal httpPrincipal, long groupId, java.lang.String className,
285                    long classPK, java.lang.String classUuid, long classTypeId,
286                    long[] categoryIds, java.lang.String[] tagNames, boolean visible,
287                    java.util.Date startDate, java.util.Date endDate,
288                    java.util.Date publishDate, java.util.Date expirationDate,
289                    java.lang.String mimeType, java.lang.String title,
290                    java.lang.String description, java.lang.String summary,
291                    java.lang.String url, java.lang.String layoutUuid, int height,
292                    int width, java.lang.Integer priority, boolean sync)
293                    throws com.liferay.portal.kernel.exception.PortalException {
294                    try {
295                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
296                                            "updateEntry", _updateEntryParameterTypes7);
297    
298                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
299                                            className, classPK, classUuid, classTypeId, categoryIds,
300                                            tagNames, visible, startDate, endDate, publishDate,
301                                            expirationDate, mimeType, title, description, summary, url,
302                                            layoutUuid, height, width, priority, sync);
303    
304                            Object returnObj = null;
305    
306                            try {
307                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
308                            }
309                            catch (Exception e) {
310                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
311                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
312                                    }
313    
314                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
315                            }
316    
317                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
318                    }
319                    catch (com.liferay.portal.kernel.exception.SystemException se) {
320                            _log.error(se, se);
321    
322                            throw se;
323                    }
324            }
325    
326            public static com.liferay.portlet.asset.model.AssetEntry updateEntry(
327                    HttpPrincipal httpPrincipal, long groupId, java.lang.String className,
328                    long classPK, java.lang.String classUuid, long classTypeId,
329                    long[] categoryIds, java.lang.String[] tagNames, boolean visible,
330                    java.util.Date startDate, java.util.Date endDate,
331                    java.util.Date expirationDate, java.lang.String mimeType,
332                    java.lang.String title, java.lang.String description,
333                    java.lang.String summary, java.lang.String url,
334                    java.lang.String layoutUuid, int height, int width,
335                    java.lang.Integer priority, boolean sync)
336                    throws com.liferay.portal.kernel.exception.PortalException {
337                    try {
338                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
339                                            "updateEntry", _updateEntryParameterTypes8);
340    
341                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
342                                            className, classPK, classUuid, classTypeId, categoryIds,
343                                            tagNames, visible, startDate, endDate, expirationDate,
344                                            mimeType, title, description, summary, url, layoutUuid,
345                                            height, width, priority, sync);
346    
347                            Object returnObj = null;
348    
349                            try {
350                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
351                            }
352                            catch (Exception e) {
353                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
354                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
355                                    }
356    
357                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
358                            }
359    
360                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
361                    }
362                    catch (com.liferay.portal.kernel.exception.SystemException se) {
363                            _log.error(se, se);
364    
365                            throw se;
366                    }
367            }
368    
369            private static Log _log = LogFactoryUtil.getLog(AssetEntryServiceHttp.class);
370            private static final Class<?>[] _getCompanyEntriesParameterTypes0 = new Class[] {
371                            long.class, int.class, int.class
372                    };
373            private static final Class<?>[] _getCompanyEntriesCountParameterTypes1 = new Class[] {
374                            long.class
375                    };
376            private static final Class<?>[] _getEntriesParameterTypes2 = new Class[] {
377                            com.liferay.portlet.asset.service.persistence.AssetEntryQuery.class
378                    };
379            private static final Class<?>[] _getEntriesCountParameterTypes3 = new Class[] {
380                            com.liferay.portlet.asset.service.persistence.AssetEntryQuery.class
381                    };
382            private static final Class<?>[] _getEntryParameterTypes4 = new Class[] {
383                            long.class
384                    };
385            private static final Class<?>[] _incrementViewCounterParameterTypes5 = new Class[] {
386                            java.lang.String.class, long.class
387                    };
388            private static final Class<?>[] _updateEntryParameterTypes6 = new Class[] {
389                            long.class, java.util.Date.class, java.util.Date.class,
390                            java.lang.String.class, long.class, java.lang.String.class,
391                            long.class, long[].class, java.lang.String[].class, boolean.class,
392                            java.util.Date.class, java.util.Date.class, java.util.Date.class,
393                            java.lang.String.class, java.lang.String.class,
394                            java.lang.String.class, java.lang.String.class,
395                            java.lang.String.class, java.lang.String.class, int.class, int.class,
396                            java.lang.Integer.class, boolean.class
397                    };
398            private static final Class<?>[] _updateEntryParameterTypes7 = new Class[] {
399                            long.class, java.lang.String.class, long.class,
400                            java.lang.String.class, long.class, long[].class,
401                            java.lang.String[].class, boolean.class, java.util.Date.class,
402                            java.util.Date.class, java.util.Date.class, java.util.Date.class,
403                            java.lang.String.class, java.lang.String.class,
404                            java.lang.String.class, java.lang.String.class,
405                            java.lang.String.class, java.lang.String.class, int.class, int.class,
406                            java.lang.Integer.class, boolean.class
407                    };
408            private static final Class<?>[] _updateEntryParameterTypes8 = new Class[] {
409                            long.class, java.lang.String.class, long.class,
410                            java.lang.String.class, long.class, long[].class,
411                            java.lang.String[].class, boolean.class, java.util.Date.class,
412                            java.util.Date.class, java.util.Date.class, java.lang.String.class,
413                            java.lang.String.class, java.lang.String.class,
414                            java.lang.String.class, java.lang.String.class,
415                            java.lang.String.class, int.class, int.class,
416                            java.lang.Integer.class, boolean.class
417                    };
418    }