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.MethodHandler;
020 import com.liferay.portal.kernel.util.MethodKey;
021 import com.liferay.portal.security.auth.HttpPrincipal;
022 import com.liferay.portal.service.ContactServiceUtil;
023
024
054 public class ContactServiceHttp {
055 public static com.liferay.portal.model.Contact getContact(
056 HttpPrincipal httpPrincipal, long contactId)
057 throws com.liferay.portal.kernel.exception.PortalException,
058 com.liferay.portal.kernel.exception.SystemException {
059 try {
060 MethodKey methodKey = new MethodKey(ContactServiceUtil.class.getName(),
061 "getContact", _getContactParameterTypes0);
062
063 MethodHandler methodHandler = new MethodHandler(methodKey, contactId);
064
065 Object returnObj = null;
066
067 try {
068 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
069 }
070 catch (Exception e) {
071 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
072 throw (com.liferay.portal.kernel.exception.PortalException)e;
073 }
074
075 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
076 throw (com.liferay.portal.kernel.exception.SystemException)e;
077 }
078
079 throw new com.liferay.portal.kernel.exception.SystemException(e);
080 }
081
082 return (com.liferay.portal.model.Contact)returnObj;
083 }
084 catch (com.liferay.portal.kernel.exception.SystemException se) {
085 _log.error(se, se);
086
087 throw se;
088 }
089 }
090
091 private static Log _log = LogFactoryUtil.getLog(ContactServiceHttp.class);
092 private static final Class<?>[] _getContactParameterTypes0 = new Class[] {
093 long.class
094 };
095 }