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