use of com.liferay.portal.NoSuchUserException in project liferay-ide by liferay.
the class UserLocalServiceImpl method getUserByUuidAndCompanyId.
/**
* Returns the user with the UUID.
*
* @param uuid the user's UUID
* @param companyId the primary key of the user's company
* @return the user with the UUID
* @throws PortalException if a user with the UUID could not be found
* @throws SystemException if a system exception occurred
*/
@Override
public User getUserByUuidAndCompanyId(String uuid, long companyId) throws PortalException, SystemException {
List<User> users = userPersistence.findByUuid_C(uuid, companyId);
if (users.isEmpty()) {
StringBundler sb = new StringBundler(5);
sb.append("{uuid=");
sb.append(uuid);
sb.append(", companyId=");
sb.append(companyId);
sb.append("}");
throw new NoSuchUserException(sb.toString());
} else {
return users.get(0);
}
}
Aggregations