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 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 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 HttpPrincipal
053     * @see AssetEntryServiceUtil
054     * @generated
055     */
056    @ProviderType
057    public class AssetEntryServiceHttp {
058            public static com.liferay.portlet.asset.model.AssetEntry fetchEntry(
059                    HttpPrincipal httpPrincipal, long entryId)
060                    throws com.liferay.portal.kernel.exception.PortalException {
061                    try {
062                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
063                                            "fetchEntry", _fetchEntryParameterTypes0);
064    
065                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
066    
067                            Object returnObj = null;
068    
069                            try {
070                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
071                            }
072                            catch (Exception e) {
073                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
074                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
075                                    }
076    
077                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
078                            }
079    
080                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
081                    }
082                    catch (com.liferay.portal.kernel.exception.SystemException se) {
083                            _log.error(se, se);
084    
085                            throw se;
086                    }
087            }
088    
089            public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getCompanyEntries(
090                    HttpPrincipal httpPrincipal, long companyId, int start, int end) {
091                    try {
092                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
093                                            "getCompanyEntries", _getCompanyEntriesParameterTypes1);
094    
095                            MethodHandler methodHandler = new MethodHandler(methodKey,
096                                            companyId, start, end);
097    
098                            Object returnObj = null;
099    
100                            try {
101                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
102                            }
103                            catch (Exception e) {
104                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
105                            }
106    
107                            return (java.util.List<com.liferay.portlet.asset.model.AssetEntry>)returnObj;
108                    }
109                    catch (com.liferay.portal.kernel.exception.SystemException se) {
110                            _log.error(se, se);
111    
112                            throw se;
113                    }
114            }
115    
116            public static int getCompanyEntriesCount(HttpPrincipal httpPrincipal,
117                    long companyId) {
118                    try {
119                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
120                                            "getCompanyEntriesCount",
121                                            _getCompanyEntriesCountParameterTypes2);
122    
123                            MethodHandler methodHandler = new MethodHandler(methodKey, companyId);
124    
125                            Object returnObj = null;
126    
127                            try {
128                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
129                            }
130                            catch (Exception e) {
131                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
132                            }
133    
134                            return ((Integer)returnObj).intValue();
135                    }
136                    catch (com.liferay.portal.kernel.exception.SystemException se) {
137                            _log.error(se, se);
138    
139                            throw se;
140                    }
141            }
142    
143            public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getEntries(
144                    HttpPrincipal httpPrincipal,
145                    com.liferay.portlet.asset.service.persistence.AssetEntryQuery entryQuery)
146                    throws com.liferay.portal.kernel.exception.PortalException {
147                    try {
148                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
149                                            "getEntries", _getEntriesParameterTypes3);
150    
151                            MethodHandler methodHandler = new MethodHandler(methodKey,
152                                            entryQuery);
153    
154                            Object returnObj = null;
155    
156                            try {
157                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
158                            }
159                            catch (Exception e) {
160                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
161                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
162                                    }
163    
164                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
165                            }
166    
167                            return (java.util.List<com.liferay.portlet.asset.model.AssetEntry>)returnObj;
168                    }
169                    catch (com.liferay.portal.kernel.exception.SystemException se) {
170                            _log.error(se, se);
171    
172                            throw se;
173                    }
174            }
175    
176            public static int getEntriesCount(HttpPrincipal httpPrincipal,
177                    com.liferay.portlet.asset.service.persistence.AssetEntryQuery entryQuery)
178                    throws com.liferay.portal.kernel.exception.PortalException {
179                    try {
180                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
181                                            "getEntriesCount", _getEntriesCountParameterTypes4);
182    
183                            MethodHandler methodHandler = new MethodHandler(methodKey,
184                                            entryQuery);
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 ((Integer)returnObj).intValue();
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 getEntry(
209                    HttpPrincipal httpPrincipal, long entryId)
210                    throws com.liferay.portal.kernel.exception.PortalException {
211                    try {
212                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
213                                            "getEntry", _getEntryParameterTypes5);
214    
215                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
216    
217                            Object returnObj = null;
218    
219                            try {
220                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
221                            }
222                            catch (Exception e) {
223                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
224                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
225                                    }
226    
227                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
228                            }
229    
230                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
231                    }
232                    catch (com.liferay.portal.kernel.exception.SystemException se) {
233                            _log.error(se, se);
234    
235                            throw se;
236                    }
237            }
238    
239            public static com.liferay.portlet.asset.model.AssetEntry incrementViewCounter(
240                    HttpPrincipal httpPrincipal, java.lang.String className, long classPK)
241                    throws com.liferay.portal.kernel.exception.PortalException {
242                    try {
243                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
244                                            "incrementViewCounter", _incrementViewCounterParameterTypes6);
245    
246                            MethodHandler methodHandler = new MethodHandler(methodKey,
247                                            className, classPK);
248    
249                            Object returnObj = null;
250    
251                            try {
252                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
253                            }
254                            catch (Exception e) {
255                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
256                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
257                                    }
258    
259                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
260                            }
261    
262                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
263                    }
264                    catch (com.liferay.portal.kernel.exception.SystemException se) {
265                            _log.error(se, se);
266    
267                            throw se;
268                    }
269            }
270    
271            public static com.liferay.portlet.asset.model.AssetEntry updateEntry(
272                    HttpPrincipal httpPrincipal, long groupId, java.util.Date createDate,
273                    java.util.Date modifiedDate, java.lang.String className, long classPK,
274                    java.lang.String classUuid, long classTypeId, long[] categoryIds,
275                    java.lang.String[] tagNames, boolean visible, java.util.Date startDate,
276                    java.util.Date endDate, java.util.Date expirationDate,
277                    java.lang.String mimeType, java.lang.String title,
278                    java.lang.String description, java.lang.String summary,
279                    java.lang.String url, java.lang.String layoutUuid, int height,
280                    int width, java.lang.Double priority)
281                    throws com.liferay.portal.kernel.exception.PortalException {
282                    try {
283                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
284                                            "updateEntry", _updateEntryParameterTypes7);
285    
286                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
287                                            createDate, modifiedDate, className, classPK, classUuid,
288                                            classTypeId, categoryIds, tagNames, visible, startDate,
289                                            endDate, expirationDate, mimeType, title, description,
290                                            summary, url, layoutUuid, height, width, priority);
291    
292                            Object returnObj = null;
293    
294                            try {
295                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
296                            }
297                            catch (Exception e) {
298                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
299                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
300                                    }
301    
302                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
303                            }
304    
305                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
306                    }
307                    catch (com.liferay.portal.kernel.exception.SystemException se) {
308                            _log.error(se, se);
309    
310                            throw se;
311                    }
312            }
313    
314            public static com.liferay.portlet.asset.model.AssetEntry updateEntry(
315                    HttpPrincipal httpPrincipal, long groupId, java.util.Date createDate,
316                    java.util.Date modifiedDate, java.lang.String className, long classPK,
317                    java.lang.String classUuid, long classTypeId, long[] categoryIds,
318                    java.lang.String[] tagNames, boolean visible, java.util.Date startDate,
319                    java.util.Date endDate, java.util.Date expirationDate,
320                    java.lang.String mimeType, java.lang.String title,
321                    java.lang.String description, java.lang.String summary,
322                    java.lang.String url, java.lang.String layoutUuid, int height,
323                    int width, java.lang.Integer priority, boolean sync)
324                    throws com.liferay.portal.kernel.exception.PortalException {
325                    try {
326                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
327                                            "updateEntry", _updateEntryParameterTypes8);
328    
329                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
330                                            createDate, modifiedDate, className, classPK, classUuid,
331                                            classTypeId, categoryIds, tagNames, visible, startDate,
332                                            endDate, expirationDate, mimeType, title, description,
333                                            summary, url, layoutUuid, height, width, priority, sync);
334    
335                            Object returnObj = null;
336    
337                            try {
338                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
339                            }
340                            catch (Exception e) {
341                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
342                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
343                                    }
344    
345                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
346                            }
347    
348                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
349                    }
350                    catch (com.liferay.portal.kernel.exception.SystemException se) {
351                            _log.error(se, se);
352    
353                            throw se;
354                    }
355            }
356    
357            public static com.liferay.portlet.asset.model.AssetEntry updateEntry(
358                    HttpPrincipal httpPrincipal, long groupId, java.lang.String className,
359                    long classPK, java.lang.String classUuid, long classTypeId,
360                    long[] categoryIds, java.lang.String[] tagNames, boolean visible,
361                    java.util.Date startDate, java.util.Date endDate,
362                    java.util.Date publishDate, java.util.Date expirationDate,
363                    java.lang.String mimeType, java.lang.String title,
364                    java.lang.String description, java.lang.String summary,
365                    java.lang.String url, java.lang.String layoutUuid, int height,
366                    int width, java.lang.Integer priority, boolean sync)
367                    throws com.liferay.portal.kernel.exception.PortalException {
368                    try {
369                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
370                                            "updateEntry", _updateEntryParameterTypes9);
371    
372                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
373                                            className, classPK, classUuid, classTypeId, categoryIds,
374                                            tagNames, visible, startDate, endDate, publishDate,
375                                            expirationDate, mimeType, title, description, summary, url,
376                                            layoutUuid, height, width, priority, sync);
377    
378                            Object returnObj = null;
379    
380                            try {
381                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
382                            }
383                            catch (Exception e) {
384                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
385                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
386                                    }
387    
388                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
389                            }
390    
391                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
392                    }
393                    catch (com.liferay.portal.kernel.exception.SystemException se) {
394                            _log.error(se, se);
395    
396                            throw se;
397                    }
398            }
399    
400            public static com.liferay.portlet.asset.model.AssetEntry updateEntry(
401                    HttpPrincipal httpPrincipal, long groupId, java.lang.String className,
402                    long classPK, java.lang.String classUuid, long classTypeId,
403                    long[] categoryIds, java.lang.String[] tagNames, boolean visible,
404                    java.util.Date startDate, java.util.Date endDate,
405                    java.util.Date expirationDate, java.lang.String mimeType,
406                    java.lang.String title, java.lang.String description,
407                    java.lang.String summary, java.lang.String url,
408                    java.lang.String layoutUuid, int height, int width,
409                    java.lang.Integer priority, boolean sync)
410                    throws com.liferay.portal.kernel.exception.PortalException {
411                    try {
412                            MethodKey methodKey = new MethodKey(AssetEntryServiceUtil.class,
413                                            "updateEntry", _updateEntryParameterTypes10);
414    
415                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
416                                            className, classPK, classUuid, classTypeId, categoryIds,
417                                            tagNames, visible, startDate, endDate, expirationDate,
418                                            mimeType, title, description, summary, url, layoutUuid,
419                                            height, width, priority, sync);
420    
421                            Object returnObj = null;
422    
423                            try {
424                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
425                            }
426                            catch (Exception e) {
427                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
428                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
429                                    }
430    
431                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
432                            }
433    
434                            return (com.liferay.portlet.asset.model.AssetEntry)returnObj;
435                    }
436                    catch (com.liferay.portal.kernel.exception.SystemException se) {
437                            _log.error(se, se);
438    
439                            throw se;
440                    }
441            }
442    
443            private static Log _log = LogFactoryUtil.getLog(AssetEntryServiceHttp.class);
444            private static final Class<?>[] _fetchEntryParameterTypes0 = new Class[] {
445                            long.class
446                    };
447            private static final Class<?>[] _getCompanyEntriesParameterTypes1 = new Class[] {
448                            long.class, int.class, int.class
449                    };
450            private static final Class<?>[] _getCompanyEntriesCountParameterTypes2 = new Class[] {
451                            long.class
452                    };
453            private static final Class<?>[] _getEntriesParameterTypes3 = new Class[] {
454                            com.liferay.portlet.asset.service.persistence.AssetEntryQuery.class
455                    };
456            private static final Class<?>[] _getEntriesCountParameterTypes4 = new Class[] {
457                            com.liferay.portlet.asset.service.persistence.AssetEntryQuery.class
458                    };
459            private static final Class<?>[] _getEntryParameterTypes5 = new Class[] {
460                            long.class
461                    };
462            private static final Class<?>[] _incrementViewCounterParameterTypes6 = new Class[] {
463                            java.lang.String.class, long.class
464                    };
465            private static final Class<?>[] _updateEntryParameterTypes7 = new Class[] {
466                            long.class, java.util.Date.class, java.util.Date.class,
467                            java.lang.String.class, long.class, java.lang.String.class,
468                            long.class, long[].class, java.lang.String[].class, boolean.class,
469                            java.util.Date.class, java.util.Date.class, java.util.Date.class,
470                            java.lang.String.class, java.lang.String.class,
471                            java.lang.String.class, java.lang.String.class,
472                            java.lang.String.class, java.lang.String.class, int.class, int.class,
473                            java.lang.Double.class
474                    };
475            private static final Class<?>[] _updateEntryParameterTypes8 = new Class[] {
476                            long.class, java.util.Date.class, java.util.Date.class,
477                            java.lang.String.class, long.class, java.lang.String.class,
478                            long.class, long[].class, java.lang.String[].class, boolean.class,
479                            java.util.Date.class, java.util.Date.class, java.util.Date.class,
480                            java.lang.String.class, java.lang.String.class,
481                            java.lang.String.class, java.lang.String.class,
482                            java.lang.String.class, java.lang.String.class, int.class, int.class,
483                            java.lang.Integer.class, boolean.class
484                    };
485            private static final Class<?>[] _updateEntryParameterTypes9 = new Class[] {
486                            long.class, java.lang.String.class, long.class,
487                            java.lang.String.class, long.class, long[].class,
488                            java.lang.String[].class, boolean.class, java.util.Date.class,
489                            java.util.Date.class, java.util.Date.class, java.util.Date.class,
490                            java.lang.String.class, java.lang.String.class,
491                            java.lang.String.class, java.lang.String.class,
492                            java.lang.String.class, java.lang.String.class, int.class, int.class,
493                            java.lang.Integer.class, boolean.class
494                    };
495            private static final Class<?>[] _updateEntryParameterTypes10 = new Class[] {
496                            long.class, java.lang.String.class, long.class,
497                            java.lang.String.class, long.class, long[].class,
498                            java.lang.String[].class, boolean.class, java.util.Date.class,
499                            java.util.Date.class, java.util.Date.class, java.lang.String.class,
500                            java.lang.String.class, java.lang.String.class,
501                            java.lang.String.class, java.lang.String.class,
502                            java.lang.String.class, int.class, int.class,
503                            java.lang.Integer.class, boolean.class
504                    };
505    }