001
014
015 package com.liferay.portal.service.http;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.kernel.util.LongWrapper;
020 import com.liferay.portal.kernel.util.MethodWrapper;
021 import com.liferay.portal.kernel.util.NullWrapper;
022 import com.liferay.portal.security.auth.HttpPrincipal;
023 import com.liferay.portal.service.ClassNameServiceUtil;
024
025
055 public class ClassNameServiceHttp {
056 public static com.liferay.portal.model.ClassName getClassName(
057 HttpPrincipal httpPrincipal, long classNameId)
058 throws com.liferay.portal.kernel.exception.PortalException,
059 com.liferay.portal.kernel.exception.SystemException {
060 try {
061 Object paramObj0 = new LongWrapper(classNameId);
062
063 MethodWrapper methodWrapper = new MethodWrapper(ClassNameServiceUtil.class.getName(),
064 "getClassName", new Object[] { paramObj0 });
065
066 Object returnObj = null;
067
068 try {
069 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
070 }
071 catch (Exception e) {
072 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
073 throw (com.liferay.portal.kernel.exception.PortalException)e;
074 }
075
076 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
077 throw (com.liferay.portal.kernel.exception.SystemException)e;
078 }
079
080 throw new com.liferay.portal.kernel.exception.SystemException(e);
081 }
082
083 return (com.liferay.portal.model.ClassName)returnObj;
084 }
085 catch (com.liferay.portal.kernel.exception.SystemException se) {
086 _log.error(se, se);
087
088 throw se;
089 }
090 }
091
092 public static com.liferay.portal.model.ClassName getClassName(
093 HttpPrincipal httpPrincipal, java.lang.String value)
094 throws com.liferay.portal.kernel.exception.SystemException {
095 try {
096 Object paramObj0 = value;
097
098 if (value == null) {
099 paramObj0 = new NullWrapper("java.lang.String");
100 }
101
102 MethodWrapper methodWrapper = new MethodWrapper(ClassNameServiceUtil.class.getName(),
103 "getClassName", new Object[] { paramObj0 });
104
105 Object returnObj = null;
106
107 try {
108 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
109 }
110 catch (Exception e) {
111 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
112 throw (com.liferay.portal.kernel.exception.SystemException)e;
113 }
114
115 throw new com.liferay.portal.kernel.exception.SystemException(e);
116 }
117
118 return (com.liferay.portal.model.ClassName)returnObj;
119 }
120 catch (com.liferay.portal.kernel.exception.SystemException se) {
121 _log.error(se, se);
122
123 throw se;
124 }
125 }
126
127 public static long getClassNameId(HttpPrincipal httpPrincipal,
128 java.lang.Class<?> classObj)
129 throws com.liferay.portal.kernel.exception.SystemException {
130 try {
131 Object paramObj0 = classObj;
132
133 if (classObj == null) {
134 paramObj0 = new NullWrapper("java.lang.Class");
135 }
136
137 MethodWrapper methodWrapper = new MethodWrapper(ClassNameServiceUtil.class.getName(),
138 "getClassNameId", new Object[] { paramObj0 });
139
140 Object returnObj = null;
141
142 try {
143 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
144 }
145 catch (Exception e) {
146 throw new com.liferay.portal.kernel.exception.SystemException(e);
147 }
148
149 return ((Long)returnObj).longValue();
150 }
151 catch (com.liferay.portal.kernel.exception.SystemException se) {
152 _log.error(se, se);
153
154 throw se;
155 }
156 }
157
158 public static long getClassNameId(HttpPrincipal httpPrincipal,
159 java.lang.String value)
160 throws com.liferay.portal.kernel.exception.SystemException {
161 try {
162 Object paramObj0 = value;
163
164 if (value == null) {
165 paramObj0 = new NullWrapper("java.lang.String");
166 }
167
168 MethodWrapper methodWrapper = new MethodWrapper(ClassNameServiceUtil.class.getName(),
169 "getClassNameId", new Object[] { paramObj0 });
170
171 Object returnObj = null;
172
173 try {
174 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
175 }
176 catch (Exception e) {
177 throw new com.liferay.portal.kernel.exception.SystemException(e);
178 }
179
180 return ((Long)returnObj).longValue();
181 }
182 catch (com.liferay.portal.kernel.exception.SystemException se) {
183 _log.error(se, se);
184
185 throw se;
186 }
187 }
188
189 private static Log _log = LogFactoryUtil.getLog(ClassNameServiceHttp.class);
190 }