001    /**
002     * Copyright (c) 2000-2010 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 com.liferay.portal.kernel.log.Log;
018    import com.liferay.portal.kernel.log.LogFactoryUtil;
019    import com.liferay.portal.kernel.util.BooleanWrapper;
020    import com.liferay.portal.kernel.util.LongWrapper;
021    import com.liferay.portal.kernel.util.MethodWrapper;
022    import com.liferay.portal.kernel.util.NullWrapper;
023    import com.liferay.portal.security.auth.HttpPrincipal;
024    import com.liferay.portal.service.PluginSettingServiceUtil;
025    
026    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portal.service.PluginSettingServiceUtil} service utility. The
030     * static methods of this class calls the same methods of the service utility.
031     * However, the signatures are different because it requires an additional
032     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
033     * </p>
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       PluginSettingServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portal.service.PluginSettingServiceUtil
054     * @generated
055     */
056    public class PluginSettingServiceHttp {
057            public static com.liferay.portal.model.PluginSetting updatePluginSetting(
058                    HttpPrincipal httpPrincipal, long companyId, java.lang.String pluginId,
059                    java.lang.String pluginType, java.lang.String roles, boolean active)
060                    throws com.liferay.portal.kernel.exception.PortalException,
061                            com.liferay.portal.kernel.exception.SystemException {
062                    try {
063                            Object paramObj0 = new LongWrapper(companyId);
064    
065                            Object paramObj1 = pluginId;
066    
067                            if (pluginId == null) {
068                                    paramObj1 = new NullWrapper("java.lang.String");
069                            }
070    
071                            Object paramObj2 = pluginType;
072    
073                            if (pluginType == null) {
074                                    paramObj2 = new NullWrapper("java.lang.String");
075                            }
076    
077                            Object paramObj3 = roles;
078    
079                            if (roles == null) {
080                                    paramObj3 = new NullWrapper("java.lang.String");
081                            }
082    
083                            Object paramObj4 = new BooleanWrapper(active);
084    
085                            MethodWrapper methodWrapper = new MethodWrapper(PluginSettingServiceUtil.class.getName(),
086                                            "updatePluginSetting",
087                                            new Object[] {
088                                                    paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
089                                            });
090    
091                            Object returnObj = null;
092    
093                            try {
094                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
095                            }
096                            catch (Exception e) {
097                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
098                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
099                                    }
100    
101                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
102                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
103                                    }
104    
105                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
106                            }
107    
108                            return (com.liferay.portal.model.PluginSetting)returnObj;
109                    }
110                    catch (com.liferay.portal.kernel.exception.SystemException se) {
111                            _log.error(se, se);
112    
113                            throw se;
114                    }
115            }
116    
117            private static Log _log = LogFactoryUtil.getLog(PluginSettingServiceHttp.class);
118    }