com.liferay.oauth2.provider.service.http.OAuth2AuthorizationServiceHttp Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.oauth2.provider.service
Show all versions of com.liferay.oauth2.provider.service
Liferay OAuth2 Provider Service
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/
package com.liferay.oauth2.provider.service.http;
import com.liferay.oauth2.provider.service.OAuth2AuthorizationServiceUtil;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.security.auth.HttpPrincipal;
import com.liferay.portal.kernel.service.http.TunnelUtil;
import com.liferay.portal.kernel.util.MethodHandler;
import com.liferay.portal.kernel.util.MethodKey;
/**
* Provides the HTTP utility for the
* OAuth2AuthorizationServiceUtil
service
* utility. The
* static methods of this class calls the same methods of the service utility.
* However, the signatures are different because it requires an additional
* HttpPrincipal
parameter.
*
*
* The benefits of using the HTTP utility is that it is fast and allows for
* tunneling without the cost of serializing to text. The drawback is that it
* only works with Java.
*
*
*
* Set the property tunnel.servlet.hosts.allowed in portal.properties to
* configure security.
*
*
*
* The HTTP utility is only generated for remote services.
*
*
* @author Brian Wing Shun Chan
* @generated
*/
public class OAuth2AuthorizationServiceHttp {
public static java.util.List
getApplicationOAuth2Authorizations(
HttpPrincipal httpPrincipal, long oAuth2ApplicationId,
int start, int end,
com.liferay.portal.kernel.util.OrderByComparator
orderByComparator)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(
OAuth2AuthorizationServiceUtil.class,
"getApplicationOAuth2Authorizations",
_getApplicationOAuth2AuthorizationsParameterTypes0);
MethodHandler methodHandler = new MethodHandler(
methodKey, oAuth2ApplicationId, start, end, orderByComparator);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception exception) {
if (exception instanceof
com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)
exception;
}
throw new com.liferay.portal.kernel.exception.SystemException(
exception);
}
return (java.util.List
)
returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException
systemException) {
_log.error(systemException, systemException);
throw systemException;
}
}
public static int getApplicationOAuth2AuthorizationsCount(
HttpPrincipal httpPrincipal, long oAuth2ApplicationId)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(
OAuth2AuthorizationServiceUtil.class,
"getApplicationOAuth2AuthorizationsCount",
_getApplicationOAuth2AuthorizationsCountParameterTypes1);
MethodHandler methodHandler = new MethodHandler(
methodKey, oAuth2ApplicationId);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception exception) {
if (exception instanceof
com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)
exception;
}
throw new com.liferay.portal.kernel.exception.SystemException(
exception);
}
return ((Integer)returnObj).intValue();
}
catch (com.liferay.portal.kernel.exception.SystemException
systemException) {
_log.error(systemException, systemException);
throw systemException;
}
}
public static java.util.List
getUserOAuth2Authorizations(
HttpPrincipal httpPrincipal, int start, int end,
com.liferay.portal.kernel.util.OrderByComparator
orderByComparator)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(
OAuth2AuthorizationServiceUtil.class,
"getUserOAuth2Authorizations",
_getUserOAuth2AuthorizationsParameterTypes2);
MethodHandler methodHandler = new MethodHandler(
methodKey, start, end, orderByComparator);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception exception) {
if (exception instanceof
com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)
exception;
}
throw new com.liferay.portal.kernel.exception.SystemException(
exception);
}
return (java.util.List
)
returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException
systemException) {
_log.error(systemException, systemException);
throw systemException;
}
}
public static int getUserOAuth2AuthorizationsCount(
HttpPrincipal httpPrincipal)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(
OAuth2AuthorizationServiceUtil.class,
"getUserOAuth2AuthorizationsCount",
_getUserOAuth2AuthorizationsCountParameterTypes3);
MethodHandler methodHandler = new MethodHandler(methodKey);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception exception) {
if (exception instanceof
com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)
exception;
}
throw new com.liferay.portal.kernel.exception.SystemException(
exception);
}
return ((Integer)returnObj).intValue();
}
catch (com.liferay.portal.kernel.exception.SystemException
systemException) {
_log.error(systemException, systemException);
throw systemException;
}
}
public static void revokeAllOAuth2Authorizations(
HttpPrincipal httpPrincipal, long oAuth2ApplicationId)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(
OAuth2AuthorizationServiceUtil.class,
"revokeAllOAuth2Authorizations",
_revokeAllOAuth2AuthorizationsParameterTypes4);
MethodHandler methodHandler = new MethodHandler(
methodKey, oAuth2ApplicationId);
try {
TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception exception) {
if (exception instanceof
com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)
exception;
}
throw new com.liferay.portal.kernel.exception.SystemException(
exception);
}
}
catch (com.liferay.portal.kernel.exception.SystemException
systemException) {
_log.error(systemException, systemException);
throw systemException;
}
}
public static void revokeOAuth2Authorization(
HttpPrincipal httpPrincipal, long oAuth2AuthorizationId)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(
OAuth2AuthorizationServiceUtil.class,
"revokeOAuth2Authorization",
_revokeOAuth2AuthorizationParameterTypes5);
MethodHandler methodHandler = new MethodHandler(
methodKey, oAuth2AuthorizationId);
try {
TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception exception) {
if (exception instanceof
com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)
exception;
}
throw new com.liferay.portal.kernel.exception.SystemException(
exception);
}
}
catch (com.liferay.portal.kernel.exception.SystemException
systemException) {
_log.error(systemException, systemException);
throw systemException;
}
}
private static Log _log = LogFactoryUtil.getLog(
OAuth2AuthorizationServiceHttp.class);
private static final Class>[]
_getApplicationOAuth2AuthorizationsParameterTypes0 = new Class[] {
long.class, int.class, int.class,
com.liferay.portal.kernel.util.OrderByComparator.class
};
private static final Class>[]
_getApplicationOAuth2AuthorizationsCountParameterTypes1 = new Class[] {
long.class
};
private static final Class>[]
_getUserOAuth2AuthorizationsParameterTypes2 = new Class[] {
int.class, int.class,
com.liferay.portal.kernel.util.OrderByComparator.class
};
private static final Class>[]
_getUserOAuth2AuthorizationsCountParameterTypes3 = new Class[] {};
private static final Class>[]
_revokeAllOAuth2AuthorizationsParameterTypes4 = new Class[] {
long.class
};
private static final Class>[] _revokeOAuth2AuthorizationParameterTypes5 =
new Class[] {long.class};
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy