001
014
015 package com.liferay.portal.service.http;
016
017 import aQute.bnd.annotation.ProviderType;
018
019 import com.liferay.portal.kernel.log.Log;
020 import com.liferay.portal.kernel.log.LogFactoryUtil;
021 import com.liferay.portal.kernel.security.auth.HttpPrincipal;
022 import com.liferay.portal.kernel.service.ContactServiceUtil;
023 import com.liferay.portal.kernel.service.http.TunnelUtil;
024 import com.liferay.portal.kernel.util.MethodHandler;
025 import com.liferay.portal.kernel.util.MethodKey;
026
027
055 @ProviderType
056 public class ContactServiceHttp {
057 public static com.liferay.portal.kernel.model.Contact getContact(
058 HttpPrincipal httpPrincipal, long contactId)
059 throws com.liferay.portal.kernel.exception.PortalException {
060 try {
061 MethodKey methodKey = new MethodKey(ContactServiceUtil.class,
062 "getContact", _getContactParameterTypes0);
063
064 MethodHandler methodHandler = new MethodHandler(methodKey, contactId);
065
066 Object returnObj = null;
067
068 try {
069 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
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 throw new com.liferay.portal.kernel.exception.SystemException(e);
077 }
078
079 return (com.liferay.portal.kernel.model.Contact)returnObj;
080 }
081 catch (com.liferay.portal.kernel.exception.SystemException se) {
082 _log.error(se, se);
083
084 throw se;
085 }
086 }
087
088 public static java.util.List<com.liferay.portal.kernel.model.Contact> getContacts(
089 HttpPrincipal httpPrincipal, long classNameId, long classPK, int start,
090 int end,
091 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Contact> orderByComparator)
092 throws com.liferay.portal.kernel.exception.PortalException {
093 try {
094 MethodKey methodKey = new MethodKey(ContactServiceUtil.class,
095 "getContacts", _getContactsParameterTypes1);
096
097 MethodHandler methodHandler = new MethodHandler(methodKey,
098 classNameId, classPK, start, end, orderByComparator);
099
100 Object returnObj = null;
101
102 try {
103 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
104 }
105 catch (Exception e) {
106 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
107 throw (com.liferay.portal.kernel.exception.PortalException)e;
108 }
109
110 throw new com.liferay.portal.kernel.exception.SystemException(e);
111 }
112
113 return (java.util.List<com.liferay.portal.kernel.model.Contact>)returnObj;
114 }
115 catch (com.liferay.portal.kernel.exception.SystemException se) {
116 _log.error(se, se);
117
118 throw se;
119 }
120 }
121
122 public static int getContactsCount(HttpPrincipal httpPrincipal,
123 long classNameId, long classPK)
124 throws com.liferay.portal.kernel.exception.PortalException {
125 try {
126 MethodKey methodKey = new MethodKey(ContactServiceUtil.class,
127 "getContactsCount", _getContactsCountParameterTypes2);
128
129 MethodHandler methodHandler = new MethodHandler(methodKey,
130 classNameId, classPK);
131
132 Object returnObj = null;
133
134 try {
135 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
136 }
137 catch (Exception e) {
138 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
139 throw (com.liferay.portal.kernel.exception.PortalException)e;
140 }
141
142 throw new com.liferay.portal.kernel.exception.SystemException(e);
143 }
144
145 return ((Integer)returnObj).intValue();
146 }
147 catch (com.liferay.portal.kernel.exception.SystemException se) {
148 _log.error(se, se);
149
150 throw se;
151 }
152 }
153
154 private static Log _log = LogFactoryUtil.getLog(ContactServiceHttp.class);
155 private static final Class<?>[] _getContactParameterTypes0 = new Class[] {
156 long.class
157 };
158 private static final Class<?>[] _getContactsParameterTypes1 = new Class[] {
159 long.class, long.class, int.class, int.class,
160 com.liferay.portal.kernel.util.OrderByComparator.class
161 };
162 private static final Class<?>[] _getContactsCountParameterTypes2 = new Class[] {
163 long.class, long.class
164 };
165 }