1
14
15 package com.liferay.portlet.softwarecatalog.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.softwarecatalog.service.SCLicenseServiceUtil;
25
26
63 public class SCLicenseServiceHttp {
64 public static com.liferay.portlet.softwarecatalog.model.SCLicense addLicense(
65 HttpPrincipal httpPrincipal, java.lang.String name,
66 java.lang.String url, boolean openSource, boolean active,
67 boolean recommended)
68 throws com.liferay.portal.PortalException,
69 com.liferay.portal.SystemException {
70 try {
71 MethodKey methodKey = new MethodKey(SCLicenseServiceUtil.class.getName(),
72 "addLicense", _addLicenseParameterTypes0);
73
74 MethodHandler methodHandler = new MethodHandler(methodKey, name,
75 url, openSource, active, recommended);
76
77 Object returnObj = null;
78
79 try {
80 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
81 }
82 catch (Exception e) {
83 if (e instanceof com.liferay.portal.PortalException) {
84 throw (com.liferay.portal.PortalException)e;
85 }
86
87 if (e instanceof com.liferay.portal.SystemException) {
88 throw (com.liferay.portal.SystemException)e;
89 }
90
91 throw new com.liferay.portal.SystemException(e);
92 }
93
94 return (com.liferay.portlet.softwarecatalog.model.SCLicense)returnObj;
95 }
96 catch (com.liferay.portal.SystemException se) {
97 _log.error(se, se);
98
99 throw se;
100 }
101 }
102
103 public static void deleteLicense(HttpPrincipal httpPrincipal, long licenseId)
104 throws com.liferay.portal.PortalException,
105 com.liferay.portal.SystemException {
106 try {
107 MethodKey methodKey = new MethodKey(SCLicenseServiceUtil.class.getName(),
108 "deleteLicense", _deleteLicenseParameterTypes1);
109
110 MethodHandler methodHandler = new MethodHandler(methodKey, licenseId);
111
112 try {
113 TunnelUtil.invoke(httpPrincipal, methodHandler);
114 }
115 catch (Exception e) {
116 if (e instanceof com.liferay.portal.PortalException) {
117 throw (com.liferay.portal.PortalException)e;
118 }
119
120 if (e instanceof com.liferay.portal.SystemException) {
121 throw (com.liferay.portal.SystemException)e;
122 }
123
124 throw new com.liferay.portal.SystemException(e);
125 }
126 }
127 catch (com.liferay.portal.SystemException se) {
128 _log.error(se, se);
129
130 throw se;
131 }
132 }
133
134 public static com.liferay.portlet.softwarecatalog.model.SCLicense getLicense(
135 HttpPrincipal httpPrincipal, long licenseId)
136 throws com.liferay.portal.PortalException,
137 com.liferay.portal.SystemException {
138 try {
139 MethodKey methodKey = new MethodKey(SCLicenseServiceUtil.class.getName(),
140 "getLicense", _getLicenseParameterTypes2);
141
142 MethodHandler methodHandler = new MethodHandler(methodKey, licenseId);
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.PortalException) {
151 throw (com.liferay.portal.PortalException)e;
152 }
153
154 if (e instanceof com.liferay.portal.SystemException) {
155 throw (com.liferay.portal.SystemException)e;
156 }
157
158 throw new com.liferay.portal.SystemException(e);
159 }
160
161 return (com.liferay.portlet.softwarecatalog.model.SCLicense)returnObj;
162 }
163 catch (com.liferay.portal.SystemException se) {
164 _log.error(se, se);
165
166 throw se;
167 }
168 }
169
170 public static com.liferay.portlet.softwarecatalog.model.SCLicense updateLicense(
171 HttpPrincipal httpPrincipal, long licenseId, java.lang.String name,
172 java.lang.String url, boolean openSource, boolean active,
173 boolean recommended)
174 throws com.liferay.portal.PortalException,
175 com.liferay.portal.SystemException {
176 try {
177 MethodKey methodKey = new MethodKey(SCLicenseServiceUtil.class.getName(),
178 "updateLicense", _updateLicenseParameterTypes3);
179
180 MethodHandler methodHandler = new MethodHandler(methodKey,
181 licenseId, name, url, openSource, active, recommended);
182
183 Object returnObj = null;
184
185 try {
186 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
187 }
188 catch (Exception e) {
189 if (e instanceof com.liferay.portal.PortalException) {
190 throw (com.liferay.portal.PortalException)e;
191 }
192
193 if (e instanceof com.liferay.portal.SystemException) {
194 throw (com.liferay.portal.SystemException)e;
195 }
196
197 throw new com.liferay.portal.SystemException(e);
198 }
199
200 return (com.liferay.portlet.softwarecatalog.model.SCLicense)returnObj;
201 }
202 catch (com.liferay.portal.SystemException se) {
203 _log.error(se, se);
204
205 throw se;
206 }
207 }
208
209 private static Log _log = LogFactoryUtil.getLog(SCLicenseServiceHttp.class);
210 private static final Class<?>[] _addLicenseParameterTypes0 = new Class[] {
211 java.lang.String.class, java.lang.String.class, boolean.class,
212 boolean.class, boolean.class
213 };
214 private static final Class<?>[] _deleteLicenseParameterTypes1 = new Class[] {
215 long.class
216 };
217 private static final Class<?>[] _getLicenseParameterTypes2 = new Class[] {
218 long.class
219 };
220 private static final Class<?>[] _updateLicenseParameterTypes3 = new Class[] {
221 long.class, java.lang.String.class, java.lang.String.class,
222 boolean.class, boolean.class, boolean.class
223 };
224 }