1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portlet.tags.service.http;
16  
17  import com.liferay.portal.kernel.log.Log;
18  import com.liferay.portal.kernel.log.LogFactoryUtil;
19  import com.liferay.portal.kernel.util.MethodHandler;
20  import com.liferay.portal.kernel.util.MethodKey;
21  import com.liferay.portal.security.auth.HttpPrincipal;
22  import com.liferay.portal.service.http.TunnelUtil;
23  
24  import com.liferay.portlet.tags.service.TagsPropertyServiceUtil;
25  
26  /**
27   * <a href="TagsPropertyServiceHttp.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * <p>
35   * This class provides a HTTP utility for the
36   * {@link com.liferay.portlet.tags.service.TagsPropertyServiceUtil} service utility. The
37   * static methods of this class calls the same methods of the service utility.
38   * However, the signatures are different because it requires an additional
39   * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
40   * </p>
41   *
42   * <p>
43   * The benefits of using the HTTP utility is that it is fast and allows for
44   * tunneling without the cost of serializing to text. The drawback is that it
45   * only works with Java.
46   * </p>
47   *
48   * <p>
49   * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
50   * configure security.
51   * </p>
52   *
53   * <p>
54   * The HTTP utility is only generated for remote services.
55   * </p>
56   *
57   * @author    Brian Wing Shun Chan
58   * @see       TagsPropertyServiceSoap
59   * @see       com.liferay.portal.security.auth.HttpPrincipal
60   * @see       com.liferay.portlet.tags.service.TagsPropertyServiceUtil
61   * @generated
62   */
63  public class TagsPropertyServiceHttp {
64      public static com.liferay.portlet.tags.model.TagsProperty addProperty(
65          HttpPrincipal httpPrincipal, long entryId, java.lang.String key,
66          java.lang.String value)
67          throws com.liferay.portal.PortalException,
68              com.liferay.portal.SystemException {
69          try {
70              MethodKey methodKey = new MethodKey(TagsPropertyServiceUtil.class.getName(),
71                      "addProperty", _addPropertyParameterTypes0);
72  
73              MethodHandler methodHandler = new MethodHandler(methodKey, entryId,
74                      key, value);
75  
76              Object returnObj = null;
77  
78              try {
79                  returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
80              }
81              catch (Exception e) {
82                  if (e instanceof com.liferay.portal.PortalException) {
83                      throw (com.liferay.portal.PortalException)e;
84                  }
85  
86                  if (e instanceof com.liferay.portal.SystemException) {
87                      throw (com.liferay.portal.SystemException)e;
88                  }
89  
90                  throw new com.liferay.portal.SystemException(e);
91              }
92  
93              return (com.liferay.portlet.tags.model.TagsProperty)returnObj;
94          }
95          catch (com.liferay.portal.SystemException se) {
96              _log.error(se, se);
97  
98              throw se;
99          }
100     }
101 
102     public static void deleteProperty(HttpPrincipal httpPrincipal,
103         long propertyId)
104         throws com.liferay.portal.PortalException,
105             com.liferay.portal.SystemException {
106         try {
107             MethodKey methodKey = new MethodKey(TagsPropertyServiceUtil.class.getName(),
108                     "deleteProperty", _deletePropertyParameterTypes1);
109 
110             MethodHandler methodHandler = new MethodHandler(methodKey,
111                     propertyId);
112 
113             try {
114                 TunnelUtil.invoke(httpPrincipal, methodHandler);
115             }
116             catch (Exception e) {
117                 if (e instanceof com.liferay.portal.PortalException) {
118                     throw (com.liferay.portal.PortalException)e;
119                 }
120 
121                 if (e instanceof com.liferay.portal.SystemException) {
122                     throw (com.liferay.portal.SystemException)e;
123                 }
124 
125                 throw new com.liferay.portal.SystemException(e);
126             }
127         }
128         catch (com.liferay.portal.SystemException se) {
129             _log.error(se, se);
130 
131             throw se;
132         }
133     }
134 
135     public static java.util.List<com.liferay.portlet.tags.model.TagsProperty> getProperties(
136         HttpPrincipal httpPrincipal, long entryId)
137         throws com.liferay.portal.SystemException {
138         try {
139             MethodKey methodKey = new MethodKey(TagsPropertyServiceUtil.class.getName(),
140                     "getProperties", _getPropertiesParameterTypes2);
141 
142             MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
143 
144             Object returnObj = null;
145 
146             try {
147                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
148             }
149             catch (Exception e) {
150                 if (e instanceof com.liferay.portal.SystemException) {
151                     throw (com.liferay.portal.SystemException)e;
152                 }
153 
154                 throw new com.liferay.portal.SystemException(e);
155             }
156 
157             return (java.util.List<com.liferay.portlet.tags.model.TagsProperty>)returnObj;
158         }
159         catch (com.liferay.portal.SystemException se) {
160             _log.error(se, se);
161 
162             throw se;
163         }
164     }
165 
166     public static java.util.List<com.liferay.portlet.tags.model.TagsProperty> getPropertyValues(
167         HttpPrincipal httpPrincipal, long companyId, java.lang.String key)
168         throws com.liferay.portal.SystemException {
169         try {
170             MethodKey methodKey = new MethodKey(TagsPropertyServiceUtil.class.getName(),
171                     "getPropertyValues", _getPropertyValuesParameterTypes3);
172 
173             MethodHandler methodHandler = new MethodHandler(methodKey,
174                     companyId, key);
175 
176             Object returnObj = null;
177 
178             try {
179                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
180             }
181             catch (Exception e) {
182                 if (e instanceof com.liferay.portal.SystemException) {
183                     throw (com.liferay.portal.SystemException)e;
184                 }
185 
186                 throw new com.liferay.portal.SystemException(e);
187             }
188 
189             return (java.util.List<com.liferay.portlet.tags.model.TagsProperty>)returnObj;
190         }
191         catch (com.liferay.portal.SystemException se) {
192             _log.error(se, se);
193 
194             throw se;
195         }
196     }
197 
198     public static com.liferay.portlet.tags.model.TagsProperty updateProperty(
199         HttpPrincipal httpPrincipal, long propertyId, java.lang.String key,
200         java.lang.String value)
201         throws com.liferay.portal.PortalException,
202             com.liferay.portal.SystemException {
203         try {
204             MethodKey methodKey = new MethodKey(TagsPropertyServiceUtil.class.getName(),
205                     "updateProperty", _updatePropertyParameterTypes4);
206 
207             MethodHandler methodHandler = new MethodHandler(methodKey,
208                     propertyId, key, value);
209 
210             Object returnObj = null;
211 
212             try {
213                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
214             }
215             catch (Exception e) {
216                 if (e instanceof com.liferay.portal.PortalException) {
217                     throw (com.liferay.portal.PortalException)e;
218                 }
219 
220                 if (e instanceof com.liferay.portal.SystemException) {
221                     throw (com.liferay.portal.SystemException)e;
222                 }
223 
224                 throw new com.liferay.portal.SystemException(e);
225             }
226 
227             return (com.liferay.portlet.tags.model.TagsProperty)returnObj;
228         }
229         catch (com.liferay.portal.SystemException se) {
230             _log.error(se, se);
231 
232             throw se;
233         }
234     }
235 
236     private static Log _log = LogFactoryUtil.getLog(TagsPropertyServiceHttp.class);
237     private static final Class<?>[] _addPropertyParameterTypes0 = new Class[] {
238             long.class, java.lang.String.class, java.lang.String.class
239         };
240     private static final Class<?>[] _deletePropertyParameterTypes1 = new Class[] {
241             long.class
242         };
243     private static final Class<?>[] _getPropertiesParameterTypes2 = new Class[] {
244             long.class
245         };
246     private static final Class<?>[] _getPropertyValuesParameterTypes3 = new Class[] {
247             long.class, java.lang.String.class
248         };
249     private static final Class<?>[] _updatePropertyParameterTypes4 = new Class[] {
250             long.class, java.lang.String.class, java.lang.String.class
251         };
252 }