1
19
20 package com.liferay.portal.service.http;
21
22 import com.liferay.portal.kernel.log.Log;
23 import com.liferay.portal.kernel.log.LogFactoryUtil;
24 import com.liferay.portal.kernel.util.LongWrapper;
25 import com.liferay.portal.kernel.util.MethodWrapper;
26 import com.liferay.portal.kernel.util.NullWrapper;
27 import com.liferay.portal.security.auth.HttpPrincipal;
28 import com.liferay.portal.service.ClassNameServiceUtil;
29
30
69 public class ClassNameServiceHttp {
70 public static com.liferay.portal.model.ClassName getClassName(
71 HttpPrincipal httpPrincipal, long classNameId)
72 throws com.liferay.portal.PortalException,
73 com.liferay.portal.SystemException {
74 try {
75 Object paramObj0 = new LongWrapper(classNameId);
76
77 MethodWrapper methodWrapper = new MethodWrapper(ClassNameServiceUtil.class.getName(),
78 "getClassName", new Object[] { paramObj0 });
79
80 Object returnObj = null;
81
82 try {
83 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
84 }
85 catch (Exception e) {
86 if (e instanceof com.liferay.portal.PortalException) {
87 throw (com.liferay.portal.PortalException)e;
88 }
89
90 if (e instanceof com.liferay.portal.SystemException) {
91 throw (com.liferay.portal.SystemException)e;
92 }
93
94 throw new com.liferay.portal.SystemException(e);
95 }
96
97 return (com.liferay.portal.model.ClassName)returnObj;
98 }
99 catch (com.liferay.portal.SystemException se) {
100 _log.error(se, se);
101
102 throw se;
103 }
104 }
105
106 public static com.liferay.portal.model.ClassName getClassName(
107 HttpPrincipal httpPrincipal, java.lang.String value)
108 throws com.liferay.portal.SystemException {
109 try {
110 Object paramObj0 = value;
111
112 if (value == null) {
113 paramObj0 = new NullWrapper("java.lang.String");
114 }
115
116 MethodWrapper methodWrapper = new MethodWrapper(ClassNameServiceUtil.class.getName(),
117 "getClassName", new Object[] { paramObj0 });
118
119 Object returnObj = null;
120
121 try {
122 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
123 }
124 catch (Exception e) {
125 if (e instanceof com.liferay.portal.SystemException) {
126 throw (com.liferay.portal.SystemException)e;
127 }
128
129 throw new com.liferay.portal.SystemException(e);
130 }
131
132 return (com.liferay.portal.model.ClassName)returnObj;
133 }
134 catch (com.liferay.portal.SystemException se) {
135 _log.error(se, se);
136
137 throw se;
138 }
139 }
140
141 public static long getClassNameId(HttpPrincipal httpPrincipal,
142 java.lang.Class<?> classObj) throws com.liferay.portal.SystemException {
143 try {
144 Object paramObj0 = classObj;
145
146 if (classObj == null) {
147 paramObj0 = new NullWrapper("java.lang.Class");
148 }
149
150 MethodWrapper methodWrapper = new MethodWrapper(ClassNameServiceUtil.class.getName(),
151 "getClassNameId", new Object[] { paramObj0 });
152
153 Object returnObj = null;
154
155 try {
156 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
157 }
158 catch (Exception e) {
159 throw new com.liferay.portal.SystemException(e);
160 }
161
162 return ((Long)returnObj).longValue();
163 }
164 catch (com.liferay.portal.SystemException se) {
165 _log.error(se, se);
166
167 throw se;
168 }
169 }
170
171 public static long getClassNameId(HttpPrincipal httpPrincipal,
172 java.lang.String value) throws com.liferay.portal.SystemException {
173 try {
174 Object paramObj0 = value;
175
176 if (value == null) {
177 paramObj0 = new NullWrapper("java.lang.String");
178 }
179
180 MethodWrapper methodWrapper = new MethodWrapper(ClassNameServiceUtil.class.getName(),
181 "getClassNameId", new Object[] { paramObj0 });
182
183 Object returnObj = null;
184
185 try {
186 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
187 }
188 catch (Exception e) {
189 throw new com.liferay.portal.SystemException(e);
190 }
191
192 return ((Long)returnObj).longValue();
193 }
194 catch (com.liferay.portal.SystemException se) {
195 _log.error(se, se);
196
197 throw se;
198 }
199 }
200
201 private static Log _log = LogFactoryUtil.getLog(ClassNameServiceHttp.class);
202 }