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.SystemException,
76 com.liferay.portal.PortalException {
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.SystemException) {
90 throw (com.liferay.portal.SystemException)e;
91 }
92
93 if (e instanceof com.liferay.portal.PortalException) {
94 throw (com.liferay.portal.PortalException)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 com.liferay.portal.PortalException {
113 try {
114 Object paramObj0 = value;
115
116 if (value == null) {
117 paramObj0 = new NullWrapper("java.lang.String");
118 }
119
120 MethodWrapper methodWrapper = new MethodWrapper(ClassNameServiceUtil.class.getName(),
121 "getClassName", new Object[] { paramObj0 });
122
123 Object returnObj = null;
124
125 try {
126 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
127 }
128 catch (Exception e) {
129 if (e instanceof com.liferay.portal.SystemException) {
130 throw (com.liferay.portal.SystemException)e;
131 }
132
133 if (e instanceof com.liferay.portal.PortalException) {
134 throw (com.liferay.portal.PortalException)e;
135 }
136
137 throw new com.liferay.portal.SystemException(e);
138 }
139
140 return (com.liferay.portal.model.ClassName)returnObj;
141 }
142 catch (com.liferay.portal.SystemException se) {
143 _log.error(se, se);
144
145 throw se;
146 }
147 }
148
149 private static Log _log = LogFactoryUtil.getLog(ClassNameServiceHttp.class);
150 }