- resp.required( "feedId", pub.getFeedId(), "");
- resp.required( "dcaeLocationName", pub.getDcaeLocationName(), "");
+ checker.required( "feedId", pub.getFeedId());
+ } catch ( RequiredFieldException rfe ) {
+ try {
+ checker.required( "feedName", pub.getFeedName());
+ }catch ( RequiredFieldException rfe2 ) {
+ logger.debug( rfe2.getApiError().toString() );
+ return responseBuilder.error(rfe2.getApiError());
+ }
+ // if we found a FeedName instead of a FeedId then try to look it up.
+ List<Feed> nfeeds = feeds.getAllFeeds( pub.getFeedName(), pub.getFeedVersion(), "equals");
+ if ( nfeeds.isEmpty() ) {
+ apiError.setCode(Status.NOT_FOUND.getStatusCode());
+ apiError.setFields("feedName");
+ return responseBuilder.error(apiError);
+ }
+ fnew = nfeeds.get(0);
+ }
+ try {
+ checker.required( "dcaeLocationName", pub.getDcaeLocationName());