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.portlet.flags.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.LongWrapper;
020    import com.liferay.portal.kernel.util.MethodWrapper;
021    import com.liferay.portal.kernel.util.NullWrapper;
022    import com.liferay.portal.security.auth.HttpPrincipal;
023    import com.liferay.portal.service.http.TunnelUtil;
024    
025    import com.liferay.portlet.flags.service.FlagsEntryServiceUtil;
026    
027    /**
028     * <p>
029     * This class provides a HTTP utility for the
030     * {@link com.liferay.portlet.flags.service.FlagsEntryServiceUtil} 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 com.liferay.portal.security.auth.HttpPrincipal} parameter.
034     * </p>
035     *
036     * <p>
037     * The benefits of using the HTTP utility is that it is fast and allows for
038     * tunneling without the cost of serializing to text. The drawback is that it
039     * only works with Java.
040     * </p>
041     *
042     * <p>
043     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
044     * configure security.
045     * </p>
046     *
047     * <p>
048     * The HTTP utility is only generated for remote services.
049     * </p>
050     *
051     * @author    Brian Wing Shun Chan
052     * @see       FlagsEntryServiceSoap
053     * @see       com.liferay.portal.security.auth.HttpPrincipal
054     * @see       com.liferay.portlet.flags.service.FlagsEntryServiceUtil
055     * @generated
056     */
057    public class FlagsEntryServiceHttp {
058            public static void addEntry(HttpPrincipal httpPrincipal,
059                    java.lang.String className, long classPK,
060                    java.lang.String reporterEmailAddress, long reportedUserId,
061                    java.lang.String contentTitle, java.lang.String contentURL,
062                    java.lang.String reason,
063                    com.liferay.portal.service.ServiceContext serviceContext)
064                    throws com.liferay.portal.kernel.exception.SystemException {
065                    try {
066                            Object paramObj0 = className;
067    
068                            if (className == null) {
069                                    paramObj0 = new NullWrapper("java.lang.String");
070                            }
071    
072                            Object paramObj1 = new LongWrapper(classPK);
073    
074                            Object paramObj2 = reporterEmailAddress;
075    
076                            if (reporterEmailAddress == null) {
077                                    paramObj2 = new NullWrapper("java.lang.String");
078                            }
079    
080                            Object paramObj3 = new LongWrapper(reportedUserId);
081    
082                            Object paramObj4 = contentTitle;
083    
084                            if (contentTitle == null) {
085                                    paramObj4 = new NullWrapper("java.lang.String");
086                            }
087    
088                            Object paramObj5 = contentURL;
089    
090                            if (contentURL == null) {
091                                    paramObj5 = new NullWrapper("java.lang.String");
092                            }
093    
094                            Object paramObj6 = reason;
095    
096                            if (reason == null) {
097                                    paramObj6 = new NullWrapper("java.lang.String");
098                            }
099    
100                            Object paramObj7 = serviceContext;
101    
102                            if (serviceContext == null) {
103                                    paramObj7 = new NullWrapper(
104                                                    "com.liferay.portal.service.ServiceContext");
105                            }
106    
107                            MethodWrapper methodWrapper = new MethodWrapper(FlagsEntryServiceUtil.class.getName(),
108                                            "addEntry",
109                                            new Object[] {
110                                                    paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
111                                                    paramObj5, paramObj6, paramObj7
112                                            });
113    
114                            try {
115                                    TunnelUtil.invoke(httpPrincipal, methodWrapper);
116                            }
117                            catch (Exception e) {
118                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
119                            }
120                    }
121                    catch (com.liferay.portal.kernel.exception.SystemException se) {
122                            _log.error(se, se);
123    
124                            throw se;
125                    }
126            }
127    
128            private static Log _log = LogFactoryUtil.getLog(FlagsEntryServiceHttp.class);
129    }