use of com.liferay.opensocial.model.OAuthToken in project liferay-ide by liferay.
the class OAuthTokenPersistenceImpl method findByG_S_First.
/**
* Returns the first o auth token in the ordered set where gadgetKey = ? and serviceName = ?.
*
* @param gadgetKey the gadget key
* @param serviceName the service name
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first matching o auth token
* @throws com.liferay.opensocial.NoSuchOAuthTokenException if a matching o auth token could not be found
* @throws SystemException if a system exception occurred
*/
@Override
public OAuthToken findByG_S_First(String gadgetKey, String serviceName, OrderByComparator orderByComparator) throws NoSuchOAuthTokenException, SystemException {
OAuthToken oAuthToken = fetchByG_S_First(gadgetKey, serviceName, orderByComparator);
if (oAuthToken != null) {
return oAuthToken;
}
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("gadgetKey=");
msg.append(gadgetKey);
msg.append(", serviceName=");
msg.append(serviceName);
msg.append(StringPool.CLOSE_CURLY_BRACE);
throw new NoSuchOAuthTokenException(msg.toString());
}
use of com.liferay.opensocial.model.OAuthToken in project liferay-ide by liferay.
the class OAuthTokenPersistenceImpl method findByU_G_S_M_T.
/**
* Returns the o auth token where userId = ? and gadgetKey = ? and serviceName = ? and moduleId = ? and tokenName = ? or throws a {@link com.liferay.opensocial.NoSuchOAuthTokenException} if it could not be found.
*
* @param userId the user ID
* @param gadgetKey the gadget key
* @param serviceName the service name
* @param moduleId the module ID
* @param tokenName the token name
* @return the matching o auth token
* @throws com.liferay.opensocial.NoSuchOAuthTokenException if a matching o auth token could not be found
* @throws SystemException if a system exception occurred
*/
@Override
public OAuthToken findByU_G_S_M_T(long userId, String gadgetKey, String serviceName, long moduleId, String tokenName) throws NoSuchOAuthTokenException, SystemException {
OAuthToken oAuthToken = fetchByU_G_S_M_T(userId, gadgetKey, serviceName, moduleId, tokenName);
if (oAuthToken == null) {
StringBundler msg = new StringBundler(12);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("userId=");
msg.append(userId);
msg.append(", gadgetKey=");
msg.append(gadgetKey);
msg.append(", serviceName=");
msg.append(serviceName);
msg.append(", moduleId=");
msg.append(moduleId);
msg.append(", tokenName=");
msg.append(tokenName);
msg.append(StringPool.CLOSE_CURLY_BRACE);
if (_log.isWarnEnabled()) {
_log.warn(msg.toString());
}
throw new NoSuchOAuthTokenException(msg.toString());
}
return oAuthToken;
}
use of com.liferay.opensocial.model.OAuthToken in project liferay-ide by liferay.
the class OAuthTokenPersistenceImpl method findByG_S_Last.
/**
* Returns the last o auth token in the ordered set where gadgetKey = ? and serviceName = ?.
*
* @param gadgetKey the gadget key
* @param serviceName the service name
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the last matching o auth token
* @throws com.liferay.opensocial.NoSuchOAuthTokenException if a matching o auth token could not be found
* @throws SystemException if a system exception occurred
*/
@Override
public OAuthToken findByG_S_Last(String gadgetKey, String serviceName, OrderByComparator orderByComparator) throws NoSuchOAuthTokenException, SystemException {
OAuthToken oAuthToken = fetchByG_S_Last(gadgetKey, serviceName, orderByComparator);
if (oAuthToken != null) {
return oAuthToken;
}
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("gadgetKey=");
msg.append(gadgetKey);
msg.append(", serviceName=");
msg.append(serviceName);
msg.append(StringPool.CLOSE_CURLY_BRACE);
throw new NoSuchOAuthTokenException(msg.toString());
}
use of com.liferay.opensocial.model.OAuthToken in project liferay-ide by liferay.
the class OAuthTokenPersistenceImpl method clearCache.
@Override
public void clearCache(List<OAuthToken> oAuthTokens) {
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
for (OAuthToken oAuthToken : oAuthTokens) {
EntityCacheUtil.removeResult(OAuthTokenModelImpl.ENTITY_CACHE_ENABLED, OAuthTokenImpl.class, oAuthToken.getPrimaryKey());
clearUniqueFindersCache(oAuthToken);
}
}
use of com.liferay.opensocial.model.OAuthToken in project liferay-ide by liferay.
the class LiferayOAuthStore method getTokenInfo.
public TokenInfo getTokenInfo(SecurityToken securityToken, ConsumerInfo consumerInfo, String serviceName, String tokenName) throws GadgetException {
OAuthToken oAuthToken = getOAuthToken(securityToken, serviceName, tokenName);
if (oAuthToken == null) {
return null;
}
TokenInfo tokenInfo = new TokenInfo(oAuthToken.getAccessToken(), oAuthToken.getTokenSecret(), oAuthToken.getSessionHandle(), oAuthToken.getExpiration());
return tokenInfo;
}
Aggregations