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.security.auth.HttpPrincipal;
022    import com.liferay.portal.kernel.util.MethodHandler;
023    import com.liferay.portal.kernel.util.MethodKey;
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            private static Log _log = LogFactoryUtil.getLog(AssetEntryServiceHttp.class);
358            private static final Class<?>[] _fetchEntryParameterTypes0 = new Class[] {
359                            long.class
360                    };
361            private static final Class<?>[] _getCompanyEntriesParameterTypes1 = new Class[] {
362                            long.class, int.class, int.class
363                    };
364            private static final Class<?>[] _getCompanyEntriesCountParameterTypes2 = new Class[] {
365                            long.class
366                    };
367            private static final Class<?>[] _getEntriesParameterTypes3 = new Class[] {
368                            com.liferay.portlet.asset.service.persistence.AssetEntryQuery.class
369                    };
370            private static final Class<?>[] _getEntriesCountParameterTypes4 = new Class[] {
371                            com.liferay.portlet.asset.service.persistence.AssetEntryQuery.class
372                    };
373            private static final Class<?>[] _getEntryParameterTypes5 = new Class[] {
374                            long.class
375                    };
376            private static final Class<?>[] _incrementViewCounterParameterTypes6 = new Class[] {
377                            java.lang.String.class, long.class
378                    };
379            private static final Class<?>[] _updateEntryParameterTypes7 = new Class[] {
380                            long.class, java.util.Date.class, java.util.Date.class,
381                            java.lang.String.class, long.class, java.lang.String.class,
382                            long.class, long[].class, java.lang.String[].class, boolean.class,
383                            java.util.Date.class, java.util.Date.class, java.util.Date.class,
384                            java.lang.String.class, java.lang.String.class,
385                            java.lang.String.class, java.lang.String.class,
386                            java.lang.String.class, java.lang.String.class, int.class, int.class,
387                            java.lang.Double.class
388                    };
389            private static final Class<?>[] _updateEntryParameterTypes8 = new Class[] {
390                            long.class, java.util.Date.class, java.util.Date.class,
391                            java.lang.String.class, long.class, java.lang.String.class,
392                            long.class, long[].class, java.lang.String[].class, boolean.class,
393                            java.util.Date.class, java.util.Date.class, java.util.Date.class,
394                            java.lang.String.class, java.lang.String.class,
395                            java.lang.String.class, java.lang.String.class,
396                            java.lang.String.class, java.lang.String.class, int.class, int.class,
397                            java.lang.Integer.class, boolean.class
398                    };
399    }