use of com.liferay.opensocial.NoSuchOAuthConsumerException in project liferay-ide by liferay.
the class OAuthConsumerPersistenceImpl method findByGadgetKey_PrevAndNext.
/**
* Returns the o auth consumers before and after the current o auth consumer in the ordered set where gadgetKey = ?.
*
* @param oAuthConsumerId the primary key of the current o auth consumer
* @param gadgetKey the gadget key
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next o auth consumer
* @throws com.liferay.opensocial.NoSuchOAuthConsumerException if a o auth consumer with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
@Override
public OAuthConsumer[] findByGadgetKey_PrevAndNext(long oAuthConsumerId, String gadgetKey, OrderByComparator orderByComparator) throws NoSuchOAuthConsumerException, SystemException {
OAuthConsumer oAuthConsumer = findByPrimaryKey(oAuthConsumerId);
Session session = null;
try {
session = openSession();
OAuthConsumer[] array = new OAuthConsumerImpl[3];
array[0] = getByGadgetKey_PrevAndNext(session, oAuthConsumer, gadgetKey, orderByComparator, true);
array[1] = oAuthConsumer;
array[2] = getByGadgetKey_PrevAndNext(session, oAuthConsumer, gadgetKey, orderByComparator, false);
return array;
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
}
use of com.liferay.opensocial.NoSuchOAuthConsumerException in project liferay-ide by liferay.
the class OAuthConsumerPersistenceImpl method findByGadgetKey_Last.
/**
* Returns the last o auth consumer in the ordered set where gadgetKey = ?.
*
* @param gadgetKey the gadget key
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the last matching o auth consumer
* @throws com.liferay.opensocial.NoSuchOAuthConsumerException if a matching o auth consumer could not be found
* @throws SystemException if a system exception occurred
*/
@Override
public OAuthConsumer findByGadgetKey_Last(String gadgetKey, OrderByComparator orderByComparator) throws NoSuchOAuthConsumerException, SystemException {
OAuthConsumer oAuthConsumer = fetchByGadgetKey_Last(gadgetKey, orderByComparator);
if (oAuthConsumer != null) {
return oAuthConsumer;
}
StringBundler msg = new StringBundler(4);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("gadgetKey=");
msg.append(gadgetKey);
msg.append(StringPool.CLOSE_CURLY_BRACE);
throw new NoSuchOAuthConsumerException(msg.toString());
}
use of com.liferay.opensocial.NoSuchOAuthConsumerException in project liferay-ide by liferay.
the class OAuthConsumerPersistenceImpl method findByG_S.
/**
* Returns the o auth consumer where gadgetKey = ? and serviceName = ? or throws a {@link com.liferay.opensocial.NoSuchOAuthConsumerException} if it could not be found.
*
* @param gadgetKey the gadget key
* @param serviceName the service name
* @return the matching o auth consumer
* @throws com.liferay.opensocial.NoSuchOAuthConsumerException if a matching o auth consumer could not be found
* @throws SystemException if a system exception occurred
*/
@Override
public OAuthConsumer findByG_S(String gadgetKey, String serviceName) throws NoSuchOAuthConsumerException, SystemException {
OAuthConsumer oAuthConsumer = fetchByG_S(gadgetKey, serviceName);
if (oAuthConsumer == null) {
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);
if (_log.isWarnEnabled()) {
_log.warn(msg.toString());
}
throw new NoSuchOAuthConsumerException(msg.toString());
}
return oAuthConsumer;
}
use of com.liferay.opensocial.NoSuchOAuthConsumerException in project liferay-ide by liferay.
the class OAuthConsumerPersistenceImpl method remove.
/**
* Removes the o auth consumer with the primary key from the database. Also notifies the appropriate model listeners.
*
* @param primaryKey the primary key of the o auth consumer
* @return the o auth consumer that was removed
* @throws com.liferay.opensocial.NoSuchOAuthConsumerException if a o auth consumer with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
@Override
public OAuthConsumer remove(Serializable primaryKey) throws NoSuchOAuthConsumerException, SystemException {
Session session = null;
try {
session = openSession();
OAuthConsumer oAuthConsumer = (OAuthConsumer) session.get(OAuthConsumerImpl.class, primaryKey);
if (oAuthConsumer == null) {
if (_log.isWarnEnabled()) {
_log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
}
throw new NoSuchOAuthConsumerException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
}
return remove(oAuthConsumer);
} catch (NoSuchOAuthConsumerException nsee) {
throw nsee;
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
}
use of com.liferay.opensocial.NoSuchOAuthConsumerException in project liferay-ide by liferay.
the class OAuthConsumerPersistenceImpl method findByGadgetKey_First.
/**
* Returns the first o auth consumer in the ordered set where gadgetKey = ?.
*
* @param gadgetKey the gadget key
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first matching o auth consumer
* @throws com.liferay.opensocial.NoSuchOAuthConsumerException if a matching o auth consumer could not be found
* @throws SystemException if a system exception occurred
*/
@Override
public OAuthConsumer findByGadgetKey_First(String gadgetKey, OrderByComparator orderByComparator) throws NoSuchOAuthConsumerException, SystemException {
OAuthConsumer oAuthConsumer = fetchByGadgetKey_First(gadgetKey, orderByComparator);
if (oAuthConsumer != null) {
return oAuthConsumer;
}
StringBundler msg = new StringBundler(4);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("gadgetKey=");
msg.append(gadgetKey);
msg.append(StringPool.CLOSE_CURLY_BRACE);
throw new NoSuchOAuthConsumerException(msg.toString());
}
Aggregations