001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portlet.dynamicdatalists.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.http.TunnelUtil;
023    
024    import com.liferay.portlet.dynamicdatalists.service.DDLRecordServiceUtil;
025    
026    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.dynamicdatalists.service.DDLRecordServiceUtil} 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       DDLRecordServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.dynamicdatalists.service.DDLRecordServiceUtil
054     * @generated
055     */
056    public class DDLRecordServiceHttp {
057            public static com.liferay.portlet.dynamicdatalists.model.DDLRecord addRecord(
058                    HttpPrincipal httpPrincipal, long groupId, long recordSetId,
059                    int displayIndex,
060                    com.liferay.portlet.dynamicdatamapping.storage.Fields fields,
061                    com.liferay.portal.service.ServiceContext serviceContext)
062                    throws com.liferay.portal.kernel.exception.PortalException,
063                            com.liferay.portal.kernel.exception.SystemException {
064                    try {
065                            MethodKey methodKey = new MethodKey(DDLRecordServiceUtil.class.getName(),
066                                            "addRecord", _addRecordParameterTypes0);
067    
068                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
069                                            recordSetId, displayIndex, fields, 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                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
082                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
083                                    }
084    
085                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
086                            }
087    
088                            return (com.liferay.portlet.dynamicdatalists.model.DDLRecord)returnObj;
089                    }
090                    catch (com.liferay.portal.kernel.exception.SystemException se) {
091                            _log.error(se, se);
092    
093                            throw se;
094                    }
095            }
096    
097            public static com.liferay.portlet.dynamicdatalists.model.DDLRecord addRecord(
098                    HttpPrincipal httpPrincipal, long groupId, long recordSetId,
099                    int displayIndex,
100                    java.util.Map<java.lang.String, java.io.Serializable> fieldsMap,
101                    com.liferay.portal.service.ServiceContext serviceContext)
102                    throws com.liferay.portal.kernel.exception.PortalException,
103                            com.liferay.portal.kernel.exception.SystemException {
104                    try {
105                            MethodKey methodKey = new MethodKey(DDLRecordServiceUtil.class.getName(),
106                                            "addRecord", _addRecordParameterTypes1);
107    
108                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
109                                            recordSetId, displayIndex, fieldsMap, serviceContext);
110    
111                            Object returnObj = null;
112    
113                            try {
114                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
115                            }
116                            catch (Exception e) {
117                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
118                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
119                                    }
120    
121                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
122                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
123                                    }
124    
125                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
126                            }
127    
128                            return (com.liferay.portlet.dynamicdatalists.model.DDLRecord)returnObj;
129                    }
130                    catch (com.liferay.portal.kernel.exception.SystemException se) {
131                            _log.error(se, se);
132    
133                            throw se;
134                    }
135            }
136    
137            public static com.liferay.portlet.dynamicdatalists.model.DDLRecord updateRecord(
138                    HttpPrincipal httpPrincipal, long recordId, boolean majorVersion,
139                    int displayIndex,
140                    com.liferay.portlet.dynamicdatamapping.storage.Fields fields,
141                    boolean mergeFields,
142                    com.liferay.portal.service.ServiceContext serviceContext)
143                    throws com.liferay.portal.kernel.exception.PortalException,
144                            com.liferay.portal.kernel.exception.SystemException {
145                    try {
146                            MethodKey methodKey = new MethodKey(DDLRecordServiceUtil.class.getName(),
147                                            "updateRecord", _updateRecordParameterTypes2);
148    
149                            MethodHandler methodHandler = new MethodHandler(methodKey,
150                                            recordId, majorVersion, displayIndex, fields, mergeFields,
151                                            serviceContext);
152    
153                            Object returnObj = null;
154    
155                            try {
156                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
157                            }
158                            catch (Exception e) {
159                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
160                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
161                                    }
162    
163                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
164                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
165                                    }
166    
167                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
168                            }
169    
170                            return (com.liferay.portlet.dynamicdatalists.model.DDLRecord)returnObj;
171                    }
172                    catch (com.liferay.portal.kernel.exception.SystemException se) {
173                            _log.error(se, se);
174    
175                            throw se;
176                    }
177            }
178    
179            public static com.liferay.portlet.dynamicdatalists.model.DDLRecord updateRecord(
180                    HttpPrincipal httpPrincipal, long recordId, int displayIndex,
181                    java.util.Map<java.lang.String, java.io.Serializable> fieldsMap,
182                    boolean mergeFields,
183                    com.liferay.portal.service.ServiceContext serviceContext)
184                    throws com.liferay.portal.kernel.exception.PortalException,
185                            com.liferay.portal.kernel.exception.SystemException {
186                    try {
187                            MethodKey methodKey = new MethodKey(DDLRecordServiceUtil.class.getName(),
188                                            "updateRecord", _updateRecordParameterTypes3);
189    
190                            MethodHandler methodHandler = new MethodHandler(methodKey,
191                                            recordId, displayIndex, fieldsMap, mergeFields,
192                                            serviceContext);
193    
194                            Object returnObj = null;
195    
196                            try {
197                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
198                            }
199                            catch (Exception e) {
200                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
201                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
202                                    }
203    
204                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
205                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
206                                    }
207    
208                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
209                            }
210    
211                            return (com.liferay.portlet.dynamicdatalists.model.DDLRecord)returnObj;
212                    }
213                    catch (com.liferay.portal.kernel.exception.SystemException se) {
214                            _log.error(se, se);
215    
216                            throw se;
217                    }
218            }
219    
220            private static Log _log = LogFactoryUtil.getLog(DDLRecordServiceHttp.class);
221            private static final Class<?>[] _addRecordParameterTypes0 = new Class[] {
222                            long.class, long.class, int.class,
223                            com.liferay.portlet.dynamicdatamapping.storage.Fields.class,
224                            com.liferay.portal.service.ServiceContext.class
225                    };
226            private static final Class<?>[] _addRecordParameterTypes1 = new Class[] {
227                            long.class, long.class, int.class, java.util.Map.class,
228                            com.liferay.portal.service.ServiceContext.class
229                    };
230            private static final Class<?>[] _updateRecordParameterTypes2 = new Class[] {
231                            long.class, boolean.class, int.class,
232                            com.liferay.portlet.dynamicdatamapping.storage.Fields.class,
233                            boolean.class, com.liferay.portal.service.ServiceContext.class
234                    };
235            private static final Class<?>[] _updateRecordParameterTypes3 = new Class[] {
236                            long.class, int.class, java.util.Map.class, boolean.class,
237                            com.liferay.portal.service.ServiceContext.class
238                    };
239    }