001
014
015 package com.liferay.portal.kernel.oauth;
016
017 import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018
019
022 public class OAuthFactoryUtil {
023
024 public static OAuthManager createOAuthManager(
025 String key, String secret, String accessURL, String requestURL,
026 String callbackURL, String scope)
027 throws OAuthException {
028
029 return getOAuthFactory().createOAuthManager(
030 key, secret, accessURL, requestURL, callbackURL, scope);
031 }
032
033 public static OAuthRequest createOAuthRequest(Verb verb, String url)
034 throws OAuthException {
035
036 return getOAuthFactory().createOAuthRequest(verb, url);
037 }
038
039 public static Token createToken(String token, String secret)
040 throws OAuthException {
041
042 return getOAuthFactory().createToken(token, secret);
043 }
044
045 public static Verifier createVerifier(String verifier)
046 throws OAuthException {
047
048 return getOAuthFactory().createVerifier(verifier);
049 }
050
051 public static OAuthFactory getOAuthFactory() {
052 PortalRuntimePermission.checkGetBeanProperty(OAuthFactoryUtil.class);
053
054 return _oAuthFactory;
055 }
056
057 public void setOAuthFactory(OAuthFactory oAuthFactory) {
058 PortalRuntimePermission.checkSetBeanProperty(getClass());
059
060 _oAuthFactory = oAuthFactory;
061 }
062
063 private static OAuthFactory _oAuthFactory;
064
065 }