src/org/ohmage/service/SurveyResponseReadServices.java
public void verifyPromptIdsBelongToConfiguration(
			final Collection<String> promptIdList, 
			final Campaign configuration)
		throws ServiceException {
		
		// check for logical errors
		if(promptIdList == null || configuration == null) {
			throw new IllegalArgumentException("A non-null request, promptIdList, and configuration are required");
		}
		
		for(String promptId : promptIdList) {
			try {
				configuration.getSurveyIdForPromptId(promptId);
			}
			catch(DomainException e) {
				StringBuilder sb = new StringBuilder();
				sb.append("The configuration for campaign ");
				sb.append(configuration.getId());
				sb.append(" did not contain the prompt id ");
				sb.append(promptId);
				String msg = sb.toString();
				throw new ServiceException(ErrorCode.SURVEY_INVALID_PROMPT_ID, msg);
			}
		}
	}
/**
	 * Verifies that the promptIdList contains prompts that are present in the
	 * configuration.
	 * 
	 * @param request  The request to fail should the promptIdList be invalid.
	 * 
	 * @param promptIdList  The prompt IDs to validate.
	 * 
	 * @param configuration  The configuration to use for prompt id lookup.
	 * 
	 * @throws ServiceException if an invalid prompt id is detected.
	 * 
	 * @throws IllegalArgumentException if request, promptIdList, or
	 * configuration are null.
	 */
Verifies that the promptIdList contains prompts that are present in the
configuration.

@param request  The request to fail should the promptIdList be invalid.

@param promptIdList  The prompt IDs to validate.

@param configuration  The configuration to use for prompt id lookup.

@throws ServiceException if an invalid prompt id is detected.

@throws IllegalArgumentException if request, promptIdList, or
configuration are null.
Verifies that the promptIdList contains prompts that are present in the configuration . @param request The request to fail should the promptIdList be invalid . @param promptIdList The prompt IDs to validate . @param configuration The configuration to use for prompt id lookup . @throws ServiceException if an invalid prompt id is detected . @throws IllegalArgumentException if request promptIdList or configuration are null .
public void verifyPromptIdsBelongToConfiguration(
			final Collection<String> promptIdList, 
			final Campaign configuration)
		throws ServiceException {
		if(promptIdList == null || configuration == null) {
			throw new IllegalArgumentException("A non-null request, promptIdList, and configuration are required");
		}
		for(String promptId : promptIdList) {
			try {
				configuration.getSurveyIdForPromptId(promptId);
			}
			catch(DomainException e) {
				StringBuilder sb = new StringBuilder();
				sb.append("The configuration for campaign ");
				sb.append(configuration.getId());
				sb.append(" did not contain the prompt id ");
				sb.append(promptId);
				String msg = sb.toString();
				throw new ServiceException(ErrorCode.SURVEY_INVALID_PROMPT_ID, msg);
			}
		}
	}
public void verifyPromptIdsBelongToConfiguration ( final Collection < String > promptIdList , final Campaign configuration ) throws ServiceException { if ( promptIdList == null || configuration == null ) { throw new IllegalArgumentException ( "A non-null request, promptIdList, and configuration are required" ) ; } for ( String promptId : promptIdList ) { try { configuration . getSurveyIdForPromptId ( promptId ) ; } catch ( DomainException e ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( "The configuration for campaign " ) ; sb . append ( configuration . getId ( ) ) ; sb . append ( " did not contain the prompt id " ) ; sb . append ( promptId ) ; String msg = sb . toString ( ) ; throw new ServiceException ( ErrorCode . SURVEY_INVALID_PROMPT_ID , msg ) ; } } }
Verifies that the promptIdList contains prompts that are present in the
 configuration.
Verifies that the promptIdList contains prompts that are present in the configuration .
// check for logical errors