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.ExportImportConfigurationServiceUtil;
025    
026    /**
027     * Provides the HTTP utility for the
028     * {@link com.liferay.portal.service.ExportImportConfigurationServiceUtil} 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 ExportImportConfigurationServiceSoap
050     * @see com.liferay.portal.security.auth.HttpPrincipal
051     * @see com.liferay.portal.service.ExportImportConfigurationServiceUtil
052     * @generated
053     */
054    @ProviderType
055    public class ExportImportConfigurationServiceHttp {
056            public static void deleteExportImportConfiguration(
057                    HttpPrincipal httpPrincipal, long exportImportConfigurationId)
058                    throws com.liferay.portal.kernel.exception.PortalException {
059                    try {
060                            MethodKey methodKey = new MethodKey(ExportImportConfigurationServiceUtil.class,
061                                            "deleteExportImportConfiguration",
062                                            _deleteExportImportConfigurationParameterTypes0);
063    
064                            MethodHandler methodHandler = new MethodHandler(methodKey,
065                                            exportImportConfigurationId);
066    
067                            try {
068                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
069                            }
070                            catch (Exception e) {
071                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
072                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
073                                    }
074    
075                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
076                            }
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 com.liferay.portal.model.ExportImportConfiguration moveExportImportConfigurationToTrash(
086                    HttpPrincipal httpPrincipal, long exportImportConfigurationId)
087                    throws com.liferay.portal.kernel.exception.PortalException {
088                    try {
089                            MethodKey methodKey = new MethodKey(ExportImportConfigurationServiceUtil.class,
090                                            "moveExportImportConfigurationToTrash",
091                                            _moveExportImportConfigurationToTrashParameterTypes1);
092    
093                            MethodHandler methodHandler = new MethodHandler(methodKey,
094                                            exportImportConfigurationId);
095    
096                            Object returnObj = null;
097    
098                            try {
099                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
100                            }
101                            catch (Exception e) {
102                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
103                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
104                                    }
105    
106                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
107                            }
108    
109                            return (com.liferay.portal.model.ExportImportConfiguration)returnObj;
110                    }
111                    catch (com.liferay.portal.kernel.exception.SystemException se) {
112                            _log.error(se, se);
113    
114                            throw se;
115                    }
116            }
117    
118            public static com.liferay.portal.model.ExportImportConfiguration restoreExportImportConfigurationFromTrash(
119                    HttpPrincipal httpPrincipal, long exportImportConfigurationId)
120                    throws com.liferay.portal.kernel.exception.PortalException {
121                    try {
122                            MethodKey methodKey = new MethodKey(ExportImportConfigurationServiceUtil.class,
123                                            "restoreExportImportConfigurationFromTrash",
124                                            _restoreExportImportConfigurationFromTrashParameterTypes2);
125    
126                            MethodHandler methodHandler = new MethodHandler(methodKey,
127                                            exportImportConfigurationId);
128    
129                            Object returnObj = null;
130    
131                            try {
132                                    returnObj = 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                            return (com.liferay.portal.model.ExportImportConfiguration)returnObj;
143                    }
144                    catch (com.liferay.portal.kernel.exception.SystemException se) {
145                            _log.error(se, se);
146    
147                            throw se;
148                    }
149            }
150    
151            private static Log _log = LogFactoryUtil.getLog(ExportImportConfigurationServiceHttp.class);
152            private static final Class<?>[] _deleteExportImportConfigurationParameterTypes0 =
153                    new Class[] { long.class };
154            private static final Class<?>[] _moveExportImportConfigurationToTrashParameterTypes1 =
155                    new Class[] { long.class };
156            private static final Class<?>[] _restoreExportImportConfigurationFromTrashParameterTypes2 =
157                    new Class[] { long.class };
158    }