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.kernel.exception.PortalException,
66 com.liferay.portal.kernel.exception.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.kernel.exception.PortalException) {
80 throw (com.liferay.portal.kernel.exception.PortalException)e;
81 }
82
83 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
84 throw (com.liferay.portal.kernel.exception.SystemException)e;
85 }
86
87 throw new com.liferay.portal.kernel.exception.SystemException(e);
88 }
89
90 return (com.liferay.portal.model.ClassName)returnObj;
91 }
92 catch (com.liferay.portal.kernel.exception.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.kernel.exception.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.kernel.exception.SystemException) {
119 throw (com.liferay.portal.kernel.exception.SystemException)e;
120 }
121
122 throw new com.liferay.portal.kernel.exception.SystemException(e);
123 }
124
125 return (com.liferay.portal.model.ClassName)returnObj;
126 }
127 catch (com.liferay.portal.kernel.exception.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)
136 throws com.liferay.portal.kernel.exception.SystemException {
137 try {
138 Object paramObj0 = classObj;
139
140 if (classObj == null) {
141 paramObj0 = new NullWrapper("java.lang.Class");
142 }
143
144 MethodWrapper methodWrapper = new MethodWrapper(ClassNameServiceUtil.class.getName(),
145 "getClassNameId", new Object[] { paramObj0 });
146
147 Object returnObj = null;
148
149 try {
150 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
151 }
152 catch (Exception e) {
153 throw new com.liferay.portal.kernel.exception.SystemException(e);
154 }
155
156 return ((Long)returnObj).longValue();
157 }
158 catch (com.liferay.portal.kernel.exception.SystemException se) {
159 _log.error(se, se);
160
161 throw se;
162 }
163 }
164
165 public static long getClassNameId(HttpPrincipal httpPrincipal,
166 java.lang.String value)
167 throws com.liferay.portal.kernel.exception.SystemException {
168 try {
169 Object paramObj0 = value;
170
171 if (value == null) {
172 paramObj0 = new NullWrapper("java.lang.String");
173 }
174
175 MethodWrapper methodWrapper = new MethodWrapper(ClassNameServiceUtil.class.getName(),
176 "getClassNameId", new Object[] { paramObj0 });
177
178 Object returnObj = null;
179
180 try {
181 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
182 }
183 catch (Exception e) {
184 throw new com.liferay.portal.kernel.exception.SystemException(e);
185 }
186
187 return ((Long)returnObj).longValue();
188 }
189 catch (com.liferay.portal.kernel.exception.SystemException se) {
190 _log.error(se, se);
191
192 throw se;
193 }
194 }
195
196 private static Log _log = LogFactoryUtil.getLog(ClassNameServiceHttp.class);
197 }