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.security.auth.HttpPrincipal;
022    import com.liferay.portal.kernel.service.LayoutSetBranchServiceUtil;
023    import com.liferay.portal.kernel.service.http.TunnelUtil;
024    import com.liferay.portal.kernel.util.MethodHandler;
025    import com.liferay.portal.kernel.util.MethodKey;
026    
027    /**
028     * Provides the HTTP utility for the
029     * {@link LayoutSetBranchServiceUtil} 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 HttpPrincipal} parameter.
033     *
034     * <p>
035     * The benefits of using the HTTP utility is that it is fast and allows for
036     * tunneling without the cost of serializing to text. The drawback is that it
037     * only works with Java.
038     * </p>
039     *
040     * <p>
041     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
042     * configure security.
043     * </p>
044     *
045     * <p>
046     * The HTTP utility is only generated for remote services.
047     * </p>
048     *
049     * @author Brian Wing Shun Chan
050     * @see LayoutSetBranchServiceSoap
051     * @see HttpPrincipal
052     * @see LayoutSetBranchServiceUtil
053     * @generated
054     */
055    @ProviderType
056    public class LayoutSetBranchServiceHttp {
057            public static com.liferay.portal.kernel.model.LayoutSetBranch addLayoutSetBranch(
058                    HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
059                    java.lang.String name, java.lang.String description, boolean master,
060                    long copyLayoutSetBranchId,
061                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
062                    throws com.liferay.portal.kernel.exception.PortalException {
063                    try {
064                            MethodKey methodKey = new MethodKey(LayoutSetBranchServiceUtil.class,
065                                            "addLayoutSetBranch", _addLayoutSetBranchParameterTypes0);
066    
067                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
068                                            privateLayout, name, description, master,
069                                            copyLayoutSetBranchId, 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.kernel.model.LayoutSetBranch)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 deleteLayoutSetBranch(HttpPrincipal httpPrincipal,
094                    long layoutSetBranchId)
095                    throws com.liferay.portal.kernel.exception.PortalException {
096                    try {
097                            MethodKey methodKey = new MethodKey(LayoutSetBranchServiceUtil.class,
098                                            "deleteLayoutSetBranch",
099                                            _deleteLayoutSetBranchParameterTypes1);
100    
101                            MethodHandler methodHandler = new MethodHandler(methodKey,
102                                            layoutSetBranchId);
103    
104                            try {
105                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
106                            }
107                            catch (Exception e) {
108                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
109                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
110                                    }
111    
112                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
113                            }
114                    }
115                    catch (com.liferay.portal.kernel.exception.SystemException se) {
116                            _log.error(se, se);
117    
118                            throw se;
119                    }
120            }
121    
122            public static java.util.List<com.liferay.portal.kernel.model.LayoutSetBranch> getLayoutSetBranches(
123                    HttpPrincipal httpPrincipal, long groupId, boolean privateLayout) {
124                    try {
125                            MethodKey methodKey = new MethodKey(LayoutSetBranchServiceUtil.class,
126                                            "getLayoutSetBranches", _getLayoutSetBranchesParameterTypes2);
127    
128                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
129                                            privateLayout);
130    
131                            Object returnObj = null;
132    
133                            try {
134                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
135                            }
136                            catch (Exception e) {
137                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
138                            }
139    
140                            return (java.util.List<com.liferay.portal.kernel.model.LayoutSetBranch>)returnObj;
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.model.LayoutSetBranch mergeLayoutSetBranch(
150                    HttpPrincipal httpPrincipal, long layoutSetBranchId,
151                    long mergeLayoutSetBranchId,
152                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
153                    throws com.liferay.portal.kernel.exception.PortalException {
154                    try {
155                            MethodKey methodKey = new MethodKey(LayoutSetBranchServiceUtil.class,
156                                            "mergeLayoutSetBranch", _mergeLayoutSetBranchParameterTypes3);
157    
158                            MethodHandler methodHandler = new MethodHandler(methodKey,
159                                            layoutSetBranchId, mergeLayoutSetBranchId, serviceContext);
160    
161                            Object returnObj = null;
162    
163                            try {
164                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
165                            }
166                            catch (Exception e) {
167                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
168                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
169                                    }
170    
171                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
172                            }
173    
174                            return (com.liferay.portal.kernel.model.LayoutSetBranch)returnObj;
175                    }
176                    catch (com.liferay.portal.kernel.exception.SystemException se) {
177                            _log.error(se, se);
178    
179                            throw se;
180                    }
181            }
182    
183            public static com.liferay.portal.kernel.model.LayoutSetBranch updateLayoutSetBranch(
184                    HttpPrincipal httpPrincipal, long groupId, long layoutSetBranchId,
185                    java.lang.String name, java.lang.String description,
186                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
187                    throws com.liferay.portal.kernel.exception.PortalException {
188                    try {
189                            MethodKey methodKey = new MethodKey(LayoutSetBranchServiceUtil.class,
190                                            "updateLayoutSetBranch",
191                                            _updateLayoutSetBranchParameterTypes4);
192    
193                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
194                                            layoutSetBranchId, name, description, serviceContext);
195    
196                            Object returnObj = null;
197    
198                            try {
199                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
200                            }
201                            catch (Exception e) {
202                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
203                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
204                                    }
205    
206                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
207                            }
208    
209                            return (com.liferay.portal.kernel.model.LayoutSetBranch)returnObj;
210                    }
211                    catch (com.liferay.portal.kernel.exception.SystemException se) {
212                            _log.error(se, se);
213    
214                            throw se;
215                    }
216            }
217    
218            private static Log _log = LogFactoryUtil.getLog(LayoutSetBranchServiceHttp.class);
219            private static final Class<?>[] _addLayoutSetBranchParameterTypes0 = new Class[] {
220                            long.class, boolean.class, java.lang.String.class,
221                            java.lang.String.class, boolean.class, long.class,
222                            com.liferay.portal.kernel.service.ServiceContext.class
223                    };
224            private static final Class<?>[] _deleteLayoutSetBranchParameterTypes1 = new Class[] {
225                            long.class
226                    };
227            private static final Class<?>[] _getLayoutSetBranchesParameterTypes2 = new Class[] {
228                            long.class, boolean.class
229                    };
230            private static final Class<?>[] _mergeLayoutSetBranchParameterTypes3 = new Class[] {
231                            long.class, long.class,
232                            com.liferay.portal.kernel.service.ServiceContext.class
233                    };
234            private static final Class<?>[] _updateLayoutSetBranchParameterTypes4 = new Class[] {
235                            long.class, long.class, java.lang.String.class,
236                            java.lang.String.class,
237                            com.liferay.portal.kernel.service.ServiceContext.class
238                    };
239    }