RetrieverForReddit/src/main/java/com/kdepagter/processor/RedditRequestProcessor.java
/**
	 * Processes web service request, returning successful or error response as necessary
	 * @param listOfSubredditsString - comma delineated String of subreddit names
	 * @return List<SubredditItem> - List of desired attributes from top posting on each subreddit
	 */
Processes web service request, returning successful or error response as necessary
@param listOfSubredditsString - comma delineated String of subreddit names
@return List - List of desired attributes from top posting on each subreddit
Processes web service request returning successful or error response as necessary @param listOfSubredditsString - comma delineated String of subreddit names @return List - List of desired attributes from top posting on each subreddit
public List<SubredditItem> processRedditRequest(String listOfSubredditsString, ExecutorService executor){
		RedditRequestValidator validator = new RedditRequestValidator();
		List<String> subredditNameList = validator.getListOfSubreddits(listOfSubredditsString);
		List<SubredditItem> responseList = new ArrayList<SubredditItem>();
		if(subredditNameList.isEmpty()){
			responseList.add(validator.createErrorItem("At least one subreddit name is required."));
			return responseList;
		}
		long start = System.currentTimeMillis();
		try {
			callSubredditProcessors(subredditNameList, executor);
			responseList = validator.validateSubredditThreadResponses(resultMap, subredditNameList);
			resultMap = null;
		} catch (Exception e) {
			responseList.add(validator.createErrorItem("Error occurred calling Reddit. " + e.getCause() + ":" + e.getMessage()));
		}
		log.info("Process Time for all subreddits: " + (System.currentTimeMillis() - start));
		return responseList;
	}
public List < SubredditItem > processRedditRequest ( String listOfSubredditsString , ExecutorService executor ) { RedditRequestValidator validator = new RedditRequestValidator ( ) ; List < String > subredditNameList = validator . getListOfSubreddits ( listOfSubredditsString ) ; List < SubredditItem > responseList = new ArrayList < SubredditItem > ( ) ; if ( subredditNameList . isEmpty ( ) ) { responseList . add ( validator . createErrorItem ( "At least one subreddit name is required." ) ) ; return responseList ; } long start = System . currentTimeMillis ( ) ; try { callSubredditProcessors ( subredditNameList , executor ) ; responseList = validator . validateSubredditThreadResponses ( resultMap , subredditNameList ) ; resultMap = null ; } catch ( Exception e ) { responseList . add ( validator . createErrorItem ( "Error occurred calling Reddit. " + e . getCause ( ) + ":" + e . getMessage ( ) ) ) ; } log . info ( "Process Time for all subreddits: " + ( System . currentTimeMillis ( ) - start ) ) ; return responseList ; }
Processes web service request, returning successful or error response as necessary
 @param listOfSubredditsString - comma delineated String of subreddit names
 @return List<SubredditItem> - List of desired attributes from top posting on each subreddit
Processes web service request returning successful or error response as necessary @param listOfSubredditsString - comma delineated String of subreddit names @return List<SubredditItem > - List of desired attributes from top posting on each subreddit