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 private static Log _log = LogFactoryUtil.getLog(ClassNameServiceHttp.class);
145 }