Search in sources :

Example 16 with OAuthToken

use of com.liferay.opensocial.model.OAuthToken in project liferay-ide by liferay.

the class LiferayOAuthStore method getOAuthToken.

protected OAuthToken getOAuthToken(SecurityToken securityToken, String serviceName, String tokenName) throws GadgetException {
    long userId = GetterUtil.getLong(securityToken.getViewerId());
    OAuthToken oAuthToken = null;
    try {
        oAuthToken = OAuthTokenLocalServiceUtil.fetchOAuthToken(userId, securityToken.getAppId(), serviceName, securityToken.getModuleId(), tokenName);
    } catch (SystemException se) {
        throw new GadgetException(GadgetException.Code.INTERNAL_SERVER_ERROR, se);
    }
    return oAuthToken;
}
Also used : OAuthToken(com.liferay.opensocial.model.OAuthToken) SystemException(com.liferay.portal.kernel.exception.SystemException) GadgetException(org.apache.shindig.gadgets.GadgetException)

Aggregations

OAuthToken (com.liferay.opensocial.model.OAuthToken)16 NoSuchOAuthTokenException (com.liferay.opensocial.NoSuchOAuthTokenException)9 SystemException (com.liferay.portal.kernel.exception.SystemException)7 StringBundler (com.liferay.portal.kernel.util.StringBundler)7 Session (com.liferay.portal.kernel.dao.orm.Session)6 OAuthTokenImpl (com.liferay.opensocial.model.impl.OAuthTokenImpl)4 Query (com.liferay.portal.kernel.dao.orm.Query)4 QueryPos (com.liferay.portal.kernel.dao.orm.QueryPos)3 UnmodifiableList (com.liferay.portal.kernel.util.UnmodifiableList)3 ArrayList (java.util.ArrayList)3 List (java.util.List)3 FinderPath (com.liferay.portal.kernel.dao.orm.FinderPath)2 User (com.liferay.portal.model.User)1 Date (java.util.Date)1 GadgetException (org.apache.shindig.gadgets.GadgetException)1