001    /**
002     * Copyright (c) 2000-2013 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.MethodHandler;
020    import com.liferay.portal.kernel.util.MethodKey;
021    import com.liferay.portal.security.auth.HttpPrincipal;
022    import com.liferay.portal.service.LayoutSetBranchServiceUtil;
023    
024    /**
025     * <p>
026     * This class provides a HTTP utility for the
027     * {@link com.liferay.portal.service.LayoutSetBranchServiceUtil} service utility. The
028     * static methods of this class calls the same methods of the service utility.
029     * However, the signatures are different because it requires an additional
030     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
031     * </p>
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       LayoutSetBranchServiceSoap
050     * @see       com.liferay.portal.security.auth.HttpPrincipal
051     * @see       com.liferay.portal.service.LayoutSetBranchServiceUtil
052     * @generated
053     */
054    public class LayoutSetBranchServiceHttp {
055            public static com.liferay.portal.model.LayoutSetBranch addLayoutSetBranch(
056                    HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
057                    java.lang.String name, java.lang.String description, boolean master,
058                    long copyLayoutSetBranchId,
059                    com.liferay.portal.service.ServiceContext serviceContext)
060                    throws com.liferay.portal.kernel.exception.PortalException,
061                            com.liferay.portal.kernel.exception.SystemException {
062                    try {
063                            MethodKey methodKey = new MethodKey(LayoutSetBranchServiceUtil.class.getName(),
064                                            "addLayoutSetBranch", _addLayoutSetBranchParameterTypes0);
065    
066                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
067                                            privateLayout, name, description, master,
068                                            copyLayoutSetBranchId, serviceContext);
069    
070                            Object returnObj = null;
071    
072                            try {
073                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
074                            }
075                            catch (Exception e) {
076                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
077                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
078                                    }
079    
080                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
081                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
082                                    }
083    
084                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
085                            }
086    
087                            return (com.liferay.portal.model.LayoutSetBranch)returnObj;
088                    }
089                    catch (com.liferay.portal.kernel.exception.SystemException se) {
090                            _log.error(se, se);
091    
092                            throw se;
093                    }
094            }
095    
096            public static void deleteLayoutSetBranch(HttpPrincipal httpPrincipal,
097                    long layoutSetBranchId)
098                    throws com.liferay.portal.kernel.exception.PortalException,
099                            com.liferay.portal.kernel.exception.SystemException {
100                    try {
101                            MethodKey methodKey = new MethodKey(LayoutSetBranchServiceUtil.class.getName(),
102                                            "deleteLayoutSetBranch",
103                                            _deleteLayoutSetBranchParameterTypes1);
104    
105                            MethodHandler methodHandler = new MethodHandler(methodKey,
106                                            layoutSetBranchId);
107    
108                            try {
109                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
110                            }
111                            catch (Exception e) {
112                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
113                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
114                                    }
115    
116                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
117                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
118                                    }
119    
120                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
121                            }
122                    }
123                    catch (com.liferay.portal.kernel.exception.SystemException se) {
124                            _log.error(se, se);
125    
126                            throw se;
127                    }
128            }
129    
130            public static java.util.List<com.liferay.portal.model.LayoutSetBranch> getLayoutSetBranches(
131                    HttpPrincipal httpPrincipal, long groupId, boolean privateLayout)
132                    throws com.liferay.portal.kernel.exception.SystemException {
133                    try {
134                            MethodKey methodKey = new MethodKey(LayoutSetBranchServiceUtil.class.getName(),
135                                            "getLayoutSetBranches", _getLayoutSetBranchesParameterTypes2);
136    
137                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
138                                            privateLayout);
139    
140                            Object returnObj = null;
141    
142                            try {
143                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
144                            }
145                            catch (Exception e) {
146                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
147                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
148                                    }
149    
150                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
151                            }
152    
153                            return (java.util.List<com.liferay.portal.model.LayoutSetBranch>)returnObj;
154                    }
155                    catch (com.liferay.portal.kernel.exception.SystemException se) {
156                            _log.error(se, se);
157    
158                            throw se;
159                    }
160            }
161    
162            public static com.liferay.portal.model.LayoutSetBranch mergeLayoutSetBranch(
163                    HttpPrincipal httpPrincipal, long layoutSetBranchId,
164                    long mergeLayoutSetBranchId,
165                    com.liferay.portal.service.ServiceContext serviceContext)
166                    throws com.liferay.portal.kernel.exception.PortalException,
167                            com.liferay.portal.kernel.exception.SystemException {
168                    try {
169                            MethodKey methodKey = new MethodKey(LayoutSetBranchServiceUtil.class.getName(),
170                                            "mergeLayoutSetBranch", _mergeLayoutSetBranchParameterTypes3);
171    
172                            MethodHandler methodHandler = new MethodHandler(methodKey,
173                                            layoutSetBranchId, mergeLayoutSetBranchId, serviceContext);
174    
175                            Object returnObj = null;
176    
177                            try {
178                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
179                            }
180                            catch (Exception e) {
181                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
182                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
183                                    }
184    
185                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
186                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
187                                    }
188    
189                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
190                            }
191    
192                            return (com.liferay.portal.model.LayoutSetBranch)returnObj;
193                    }
194                    catch (com.liferay.portal.kernel.exception.SystemException se) {
195                            _log.error(se, se);
196    
197                            throw se;
198                    }
199            }
200    
201            public static com.liferay.portal.model.LayoutSetBranch updateLayoutSetBranch(
202                    HttpPrincipal httpPrincipal, long groupId, long layoutSetBranchId,
203                    java.lang.String name, java.lang.String description,
204                    com.liferay.portal.service.ServiceContext serviceContext)
205                    throws com.liferay.portal.kernel.exception.PortalException,
206                            com.liferay.portal.kernel.exception.SystemException {
207                    try {
208                            MethodKey methodKey = new MethodKey(LayoutSetBranchServiceUtil.class.getName(),
209                                            "updateLayoutSetBranch",
210                                            _updateLayoutSetBranchParameterTypes4);
211    
212                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
213                                            layoutSetBranchId, name, description, serviceContext);
214    
215                            Object returnObj = null;
216    
217                            try {
218                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
219                            }
220                            catch (Exception e) {
221                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
222                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
223                                    }
224    
225                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
226                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
227                                    }
228    
229                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
230                            }
231    
232                            return (com.liferay.portal.model.LayoutSetBranch)returnObj;
233                    }
234                    catch (com.liferay.portal.kernel.exception.SystemException se) {
235                            _log.error(se, se);
236    
237                            throw se;
238                    }
239            }
240    
241            private static Log _log = LogFactoryUtil.getLog(LayoutSetBranchServiceHttp.class);
242            private static final Class<?>[] _addLayoutSetBranchParameterTypes0 = new Class[] {
243                            long.class, boolean.class, java.lang.String.class,
244                            java.lang.String.class, boolean.class, long.class,
245                            com.liferay.portal.service.ServiceContext.class
246                    };
247            private static final Class<?>[] _deleteLayoutSetBranchParameterTypes1 = new Class[] {
248                            long.class
249                    };
250            private static final Class<?>[] _getLayoutSetBranchesParameterTypes2 = new Class[] {
251                            long.class, boolean.class
252                    };
253            private static final Class<?>[] _mergeLayoutSetBranchParameterTypes3 = new Class[] {
254                            long.class, long.class,
255                            com.liferay.portal.service.ServiceContext.class
256                    };
257            private static final Class<?>[] _updateLayoutSetBranchParameterTypes4 = new Class[] {
258                            long.class, long.class, java.lang.String.class,
259                            java.lang.String.class,
260                            com.liferay.portal.service.ServiceContext.class
261                    };
262    }