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.portal.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.RepositoryServiceUtil;
025    
026    /**
027     * Provides the HTTP utility for the
028     * {@link com.liferay.portal.service.RepositoryServiceUtil} service utility. The
029     * static methods of this class calls the same methods of the service utility.
030     * However, the signatures are different because it requires an additional
031     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
032     *
033     * <p>
034     * The benefits of using the HTTP utility is that it is fast and allows for
035     * tunneling without the cost of serializing to text. The drawback is that it
036     * only works with Java.
037     * </p>
038     *
039     * <p>
040     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
041     * configure security.
042     * </p>
043     *
044     * <p>
045     * The HTTP utility is only generated for remote services.
046     * </p>
047     *
048     * @author Brian Wing Shun Chan
049     * @see RepositoryServiceSoap
050     * @see com.liferay.portal.security.auth.HttpPrincipal
051     * @see com.liferay.portal.service.RepositoryServiceUtil
052     * @generated
053     */
054    @ProviderType
055    public class RepositoryServiceHttp {
056            public static com.liferay.portal.model.Repository addRepository(
057                    HttpPrincipal httpPrincipal, long groupId, long classNameId,
058                    long parentFolderId, java.lang.String name,
059                    java.lang.String description, java.lang.String portletId,
060                    com.liferay.portal.kernel.util.UnicodeProperties typeSettingsProperties,
061                    com.liferay.portal.service.ServiceContext serviceContext)
062                    throws com.liferay.portal.kernel.exception.PortalException {
063                    try {
064                            MethodKey methodKey = new MethodKey(RepositoryServiceUtil.class,
065                                            "addRepository", _addRepositoryParameterTypes0);
066    
067                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
068                                            classNameId, parentFolderId, name, description, portletId,
069                                            typeSettingsProperties, serviceContext);
070    
071                            Object returnObj = null;
072    
073                            try {
074                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
075                            }
076                            catch (Exception e) {
077                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
078                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
079                                    }
080    
081                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
082                            }
083    
084                            return (com.liferay.portal.model.Repository)returnObj;
085                    }
086                    catch (com.liferay.portal.kernel.exception.SystemException se) {
087                            _log.error(se, se);
088    
089                            throw se;
090                    }
091            }
092    
093            public static void checkRepository(HttpPrincipal httpPrincipal,
094                    long repositoryId)
095                    throws com.liferay.portal.kernel.exception.PortalException {
096                    try {
097                            MethodKey methodKey = new MethodKey(RepositoryServiceUtil.class,
098                                            "checkRepository", _checkRepositoryParameterTypes1);
099    
100                            MethodHandler methodHandler = new MethodHandler(methodKey,
101                                            repositoryId);
102    
103                            try {
104                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
105                            }
106                            catch (Exception e) {
107                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
108                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
109                                    }
110    
111                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
112                            }
113                    }
114                    catch (com.liferay.portal.kernel.exception.SystemException se) {
115                            _log.error(se, se);
116    
117                            throw se;
118                    }
119            }
120    
121            public static void deleteRepository(HttpPrincipal httpPrincipal,
122                    long repositoryId)
123                    throws com.liferay.portal.kernel.exception.PortalException {
124                    try {
125                            MethodKey methodKey = new MethodKey(RepositoryServiceUtil.class,
126                                            "deleteRepository", _deleteRepositoryParameterTypes2);
127    
128                            MethodHandler methodHandler = new MethodHandler(methodKey,
129                                            repositoryId);
130    
131                            try {
132                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
133                            }
134                            catch (Exception e) {
135                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
136                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
137                                    }
138    
139                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
140                            }
141                    }
142                    catch (com.liferay.portal.kernel.exception.SystemException se) {
143                            _log.error(se, se);
144    
145                            throw se;
146                    }
147            }
148    
149            public static com.liferay.portal.kernel.repository.LocalRepository getLocalRepositoryImpl(
150                    HttpPrincipal httpPrincipal, long repositoryId)
151                    throws com.liferay.portal.kernel.exception.PortalException {
152                    try {
153                            MethodKey methodKey = new MethodKey(RepositoryServiceUtil.class,
154                                            "getLocalRepositoryImpl",
155                                            _getLocalRepositoryImplParameterTypes3);
156    
157                            MethodHandler methodHandler = new MethodHandler(methodKey,
158                                            repositoryId);
159    
160                            Object returnObj = null;
161    
162                            try {
163                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
164                            }
165                            catch (Exception e) {
166                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
167                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
168                                    }
169    
170                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
171                            }
172    
173                            return (com.liferay.portal.kernel.repository.LocalRepository)returnObj;
174                    }
175                    catch (com.liferay.portal.kernel.exception.SystemException se) {
176                            _log.error(se, se);
177    
178                            throw se;
179                    }
180            }
181    
182            public static com.liferay.portal.kernel.repository.LocalRepository getLocalRepositoryImpl(
183                    HttpPrincipal httpPrincipal, long folderId, long fileEntryId,
184                    long fileVersionId)
185                    throws com.liferay.portal.kernel.exception.PortalException {
186                    try {
187                            MethodKey methodKey = new MethodKey(RepositoryServiceUtil.class,
188                                            "getLocalRepositoryImpl",
189                                            _getLocalRepositoryImplParameterTypes4);
190    
191                            MethodHandler methodHandler = new MethodHandler(methodKey,
192                                            folderId, fileEntryId, fileVersionId);
193    
194                            Object returnObj = null;
195    
196                            try {
197                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
198                            }
199                            catch (Exception e) {
200                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
201                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
202                                    }
203    
204                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
205                            }
206    
207                            return (com.liferay.portal.kernel.repository.LocalRepository)returnObj;
208                    }
209                    catch (com.liferay.portal.kernel.exception.SystemException se) {
210                            _log.error(se, se);
211    
212                            throw se;
213                    }
214            }
215    
216            public static com.liferay.portal.model.Repository getRepository(
217                    HttpPrincipal httpPrincipal, long repositoryId)
218                    throws com.liferay.portal.kernel.exception.PortalException {
219                    try {
220                            MethodKey methodKey = new MethodKey(RepositoryServiceUtil.class,
221                                            "getRepository", _getRepositoryParameterTypes5);
222    
223                            MethodHandler methodHandler = new MethodHandler(methodKey,
224                                            repositoryId);
225    
226                            Object returnObj = null;
227    
228                            try {
229                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
230                            }
231                            catch (Exception e) {
232                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
233                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
234                                    }
235    
236                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
237                            }
238    
239                            return (com.liferay.portal.model.Repository)returnObj;
240                    }
241                    catch (com.liferay.portal.kernel.exception.SystemException se) {
242                            _log.error(se, se);
243    
244                            throw se;
245                    }
246            }
247    
248            public static com.liferay.portal.kernel.repository.Repository getRepositoryImpl(
249                    HttpPrincipal httpPrincipal, long repositoryId)
250                    throws com.liferay.portal.kernel.exception.PortalException {
251                    try {
252                            MethodKey methodKey = new MethodKey(RepositoryServiceUtil.class,
253                                            "getRepositoryImpl", _getRepositoryImplParameterTypes6);
254    
255                            MethodHandler methodHandler = new MethodHandler(methodKey,
256                                            repositoryId);
257    
258                            Object returnObj = null;
259    
260                            try {
261                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
262                            }
263                            catch (Exception e) {
264                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
265                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
266                                    }
267    
268                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
269                            }
270    
271                            return (com.liferay.portal.kernel.repository.Repository)returnObj;
272                    }
273                    catch (com.liferay.portal.kernel.exception.SystemException se) {
274                            _log.error(se, se);
275    
276                            throw se;
277                    }
278            }
279    
280            public static com.liferay.portal.kernel.repository.Repository getRepositoryImpl(
281                    HttpPrincipal httpPrincipal, long folderId, long fileEntryId,
282                    long fileVersionId)
283                    throws com.liferay.portal.kernel.exception.PortalException {
284                    try {
285                            MethodKey methodKey = new MethodKey(RepositoryServiceUtil.class,
286                                            "getRepositoryImpl", _getRepositoryImplParameterTypes7);
287    
288                            MethodHandler methodHandler = new MethodHandler(methodKey,
289                                            folderId, fileEntryId, fileVersionId);
290    
291                            Object returnObj = null;
292    
293                            try {
294                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
295                            }
296                            catch (Exception e) {
297                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
298                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
299                                    }
300    
301                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
302                            }
303    
304                            return (com.liferay.portal.kernel.repository.Repository)returnObj;
305                    }
306                    catch (com.liferay.portal.kernel.exception.SystemException se) {
307                            _log.error(se, se);
308    
309                            throw se;
310                    }
311            }
312    
313            public static java.lang.String[] getSupportedConfigurations(
314                    HttpPrincipal httpPrincipal, long classNameId) {
315                    try {
316                            MethodKey methodKey = new MethodKey(RepositoryServiceUtil.class,
317                                            "getSupportedConfigurations",
318                                            _getSupportedConfigurationsParameterTypes8);
319    
320                            MethodHandler methodHandler = new MethodHandler(methodKey,
321                                            classNameId);
322    
323                            Object returnObj = null;
324    
325                            try {
326                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
327                            }
328                            catch (Exception e) {
329                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
330                            }
331    
332                            return (java.lang.String[])returnObj;
333                    }
334                    catch (com.liferay.portal.kernel.exception.SystemException se) {
335                            _log.error(se, se);
336    
337                            throw se;
338                    }
339            }
340    
341            public static java.lang.String[] getSupportedParameters(
342                    HttpPrincipal httpPrincipal, long classNameId,
343                    java.lang.String configuration) {
344                    try {
345                            MethodKey methodKey = new MethodKey(RepositoryServiceUtil.class,
346                                            "getSupportedParameters",
347                                            _getSupportedParametersParameterTypes9);
348    
349                            MethodHandler methodHandler = new MethodHandler(methodKey,
350                                            classNameId, configuration);
351    
352                            Object returnObj = null;
353    
354                            try {
355                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
356                            }
357                            catch (Exception e) {
358                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
359                            }
360    
361                            return (java.lang.String[])returnObj;
362                    }
363                    catch (com.liferay.portal.kernel.exception.SystemException se) {
364                            _log.error(se, se);
365    
366                            throw se;
367                    }
368            }
369    
370            public static com.liferay.portal.kernel.util.UnicodeProperties getTypeSettingsProperties(
371                    HttpPrincipal httpPrincipal, long repositoryId)
372                    throws com.liferay.portal.kernel.exception.PortalException {
373                    try {
374                            MethodKey methodKey = new MethodKey(RepositoryServiceUtil.class,
375                                            "getTypeSettingsProperties",
376                                            _getTypeSettingsPropertiesParameterTypes10);
377    
378                            MethodHandler methodHandler = new MethodHandler(methodKey,
379                                            repositoryId);
380    
381                            Object returnObj = null;
382    
383                            try {
384                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
385                            }
386                            catch (Exception e) {
387                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
388                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
389                                    }
390    
391                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
392                            }
393    
394                            return (com.liferay.portal.kernel.util.UnicodeProperties)returnObj;
395                    }
396                    catch (com.liferay.portal.kernel.exception.SystemException se) {
397                            _log.error(se, se);
398    
399                            throw se;
400                    }
401            }
402    
403            public static void updateRepository(HttpPrincipal httpPrincipal,
404                    long repositoryId, java.lang.String name, java.lang.String description)
405                    throws com.liferay.portal.kernel.exception.PortalException {
406                    try {
407                            MethodKey methodKey = new MethodKey(RepositoryServiceUtil.class,
408                                            "updateRepository", _updateRepositoryParameterTypes11);
409    
410                            MethodHandler methodHandler = new MethodHandler(methodKey,
411                                            repositoryId, name, description);
412    
413                            try {
414                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
415                            }
416                            catch (Exception e) {
417                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
418                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
419                                    }
420    
421                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
422                            }
423                    }
424                    catch (com.liferay.portal.kernel.exception.SystemException se) {
425                            _log.error(se, se);
426    
427                            throw se;
428                    }
429            }
430    
431            private static Log _log = LogFactoryUtil.getLog(RepositoryServiceHttp.class);
432            private static final Class<?>[] _addRepositoryParameterTypes0 = new Class[] {
433                            long.class, long.class, long.class, java.lang.String.class,
434                            java.lang.String.class, java.lang.String.class,
435                            com.liferay.portal.kernel.util.UnicodeProperties.class,
436                            com.liferay.portal.service.ServiceContext.class
437                    };
438            private static final Class<?>[] _checkRepositoryParameterTypes1 = new Class[] {
439                            long.class
440                    };
441            private static final Class<?>[] _deleteRepositoryParameterTypes2 = new Class[] {
442                            long.class
443                    };
444            private static final Class<?>[] _getLocalRepositoryImplParameterTypes3 = new Class[] {
445                            long.class
446                    };
447            private static final Class<?>[] _getLocalRepositoryImplParameterTypes4 = new Class[] {
448                            long.class, long.class, long.class
449                    };
450            private static final Class<?>[] _getRepositoryParameterTypes5 = new Class[] {
451                            long.class
452                    };
453            private static final Class<?>[] _getRepositoryImplParameterTypes6 = new Class[] {
454                            long.class
455                    };
456            private static final Class<?>[] _getRepositoryImplParameterTypes7 = new Class[] {
457                            long.class, long.class, long.class
458                    };
459            private static final Class<?>[] _getSupportedConfigurationsParameterTypes8 = new Class[] {
460                            long.class
461                    };
462            private static final Class<?>[] _getSupportedParametersParameterTypes9 = new Class[] {
463                            long.class, java.lang.String.class
464                    };
465            private static final Class<?>[] _getTypeSettingsPropertiesParameterTypes10 = new Class[] {
466                            long.class
467                    };
468            private static final Class<?>[] _updateRepositoryParameterTypes11 = new Class[] {
469                            long.class, java.lang.String.class, java.lang.String.class
470                    };
471    }