use of com.pratilipi.common.exception.UnexpectedServerException in project pratilipi by Pratilipi.
the class AuthorListByReadCountApi method get.
@Get
public GetResponse get(GetRequest request) throws UnexpectedServerException {
DataListCursorTuple<AuthorByReadCountData> dataListCursorTuple = AuthorDataUtil.getAuthorListByReadCount(request.getLanguage(), request.getResultCount(), request.getCursor());
if (dataListCursorTuple == null) {
Logger.getLogger(AuthorListByReadCountApi.class.getSimpleName()).log(Level.INFO, "DB returned null cursor tuple");
throw new UnexpectedServerException();
}
Date date = AppPropertyUtil.getTopAuthorLoadDate();
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
Logger.getLogger(AuthorListByReadCountApi.class.getSimpleName()).log(Level.INFO, "Date : " + dateFormat.format(date));
return new GetResponse(dataListCursorTuple.getDataList(), dateFormat.format(date), dataListCursorTuple.getCursor());
}
Aggregations