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