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