001
014
015 package com.liferay.portlet.softwarecatalog.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.softwarecatalog.service.SCLicenseServiceUtil;
025
026
056 public class SCLicenseServiceHttp {
057 public static com.liferay.portlet.softwarecatalog.model.SCLicense addLicense(
058 HttpPrincipal httpPrincipal, java.lang.String name,
059 java.lang.String url, boolean openSource, boolean active,
060 boolean recommended)
061 throws com.liferay.portal.kernel.exception.PortalException,
062 com.liferay.portal.kernel.exception.SystemException {
063 try {
064 MethodKey methodKey = new MethodKey(SCLicenseServiceUtil.class.getName(),
065 "addLicense", _addLicenseParameterTypes0);
066
067 MethodHandler methodHandler = new MethodHandler(methodKey, name,
068 url, openSource, active, recommended);
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.portlet.softwarecatalog.model.SCLicense)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 deleteLicense(HttpPrincipal httpPrincipal, long licenseId)
097 throws com.liferay.portal.kernel.exception.PortalException,
098 com.liferay.portal.kernel.exception.SystemException {
099 try {
100 MethodKey methodKey = new MethodKey(SCLicenseServiceUtil.class.getName(),
101 "deleteLicense", _deleteLicenseParameterTypes1);
102
103 MethodHandler methodHandler = new MethodHandler(methodKey, licenseId);
104
105 try {
106 TunnelUtil.invoke(httpPrincipal, methodHandler);
107 }
108 catch (Exception e) {
109 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
110 throw (com.liferay.portal.kernel.exception.PortalException)e;
111 }
112
113 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
114 throw (com.liferay.portal.kernel.exception.SystemException)e;
115 }
116
117 throw new com.liferay.portal.kernel.exception.SystemException(e);
118 }
119 }
120 catch (com.liferay.portal.kernel.exception.SystemException se) {
121 _log.error(se, se);
122
123 throw se;
124 }
125 }
126
127 public static com.liferay.portlet.softwarecatalog.model.SCLicense getLicense(
128 HttpPrincipal httpPrincipal, long licenseId)
129 throws com.liferay.portal.kernel.exception.PortalException,
130 com.liferay.portal.kernel.exception.SystemException {
131 try {
132 MethodKey methodKey = new MethodKey(SCLicenseServiceUtil.class.getName(),
133 "getLicense", _getLicenseParameterTypes2);
134
135 MethodHandler methodHandler = new MethodHandler(methodKey, licenseId);
136
137 Object returnObj = null;
138
139 try {
140 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
141 }
142 catch (Exception e) {
143 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
144 throw (com.liferay.portal.kernel.exception.PortalException)e;
145 }
146
147 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
148 throw (com.liferay.portal.kernel.exception.SystemException)e;
149 }
150
151 throw new com.liferay.portal.kernel.exception.SystemException(e);
152 }
153
154 return (com.liferay.portlet.softwarecatalog.model.SCLicense)returnObj;
155 }
156 catch (com.liferay.portal.kernel.exception.SystemException se) {
157 _log.error(se, se);
158
159 throw se;
160 }
161 }
162
163 public static com.liferay.portlet.softwarecatalog.model.SCLicense updateLicense(
164 HttpPrincipal httpPrincipal, long licenseId, java.lang.String name,
165 java.lang.String url, boolean openSource, boolean active,
166 boolean recommended)
167 throws com.liferay.portal.kernel.exception.PortalException,
168 com.liferay.portal.kernel.exception.SystemException {
169 try {
170 MethodKey methodKey = new MethodKey(SCLicenseServiceUtil.class.getName(),
171 "updateLicense", _updateLicenseParameterTypes3);
172
173 MethodHandler methodHandler = new MethodHandler(methodKey,
174 licenseId, name, url, openSource, active, recommended);
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.kernel.exception.PortalException) {
183 throw (com.liferay.portal.kernel.exception.PortalException)e;
184 }
185
186 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
187 throw (com.liferay.portal.kernel.exception.SystemException)e;
188 }
189
190 throw new com.liferay.portal.kernel.exception.SystemException(e);
191 }
192
193 return (com.liferay.portlet.softwarecatalog.model.SCLicense)returnObj;
194 }
195 catch (com.liferay.portal.kernel.exception.SystemException se) {
196 _log.error(se, se);
197
198 throw se;
199 }
200 }
201
202 private static Log _log = LogFactoryUtil.getLog(SCLicenseServiceHttp.class);
203 private static final Class<?>[] _addLicenseParameterTypes0 = new Class[] {
204 java.lang.String.class, java.lang.String.class, boolean.class,
205 boolean.class, boolean.class
206 };
207 private static final Class<?>[] _deleteLicenseParameterTypes1 = new Class[] {
208 long.class
209 };
210 private static final Class<?>[] _getLicenseParameterTypes2 = new Class[] {
211 long.class
212 };
213 private static final Class<?>[] _updateLicenseParameterTypes3 = new Class[] {
214 long.class, java.lang.String.class, java.lang.String.class,
215 boolean.class, boolean.class, boolean.class
216 };
217 }