src/org/ohmage/service/SurveyResponseReadServices.java
public void verifySurveyIdsBelongToConfiguration(
			final Collection<String> surveyIdList, 
			final Campaign configuration)
		throws ServiceException {
		
		// check for logical errors
		if(surveyIdList == null || configuration == null) {
			throw new IllegalArgumentException("A non-null request, surveyIdList, and configuration are required");
		}
		
		for(String surveyId : surveyIdList) {
			try {
				if(! configuration.surveyIdExists(surveyId)) {
					StringBuilder sb = new StringBuilder();
					sb.append("The configuration for campaign ");
					sb.append(configuration.getId());
					sb.append(" did not contain the survey id ");
					sb.append(surveyId);
					String msg = sb.toString();
					throw new ServiceException(ErrorCode.SURVEY_INVALID_SURVEY_ID, msg);
				}
			} 
			catch(DomainException e) {
				throw new ServiceException("The surveyId was null.", e);
			}
		}
	}
/**
	 * Verifies that the surveyIdList contains surveys that are present in the
	 * configuration.
	 * 
	 * @param surveyIdList  The survey ids to validate.
	 * 
	 * @param configuration  The configuration to use for survey id lookup
	 * 
	 * @throws ServiceException if an invalid survey id is detected.
	 * 
	 * @throws IllegalArgumentException if request, surveyIdList, or
	 * configuration are null.
	 */
Verifies that the surveyIdList contains surveys that are present in the
configuration.

@param surveyIdList  The survey ids to validate.

@param configuration  The configuration to use for survey id lookup

@throws ServiceException if an invalid survey id is detected.

@throws IllegalArgumentException if request, surveyIdList, or
configuration are null.
Verifies that the surveyIdList contains surveys that are present in the configuration . @param surveyIdList The survey ids to validate . @param configuration The configuration to use for survey id lookup @throws ServiceException if an invalid survey id is detected . @throws IllegalArgumentException if request surveyIdList or configuration are null .
public void verifySurveyIdsBelongToConfiguration(
			final Collection<String> surveyIdList, 
			final Campaign configuration)
		throws ServiceException {
		if(surveyIdList == null || configuration == null) {
			throw new IllegalArgumentException("A non-null request, surveyIdList, and configuration are required");
		}
		for(String surveyId : surveyIdList) {
			try {
				if(! configuration.surveyIdExists(surveyId)) {
					StringBuilder sb = new StringBuilder();
					sb.append("The configuration for campaign ");
					sb.append(configuration.getId());
					sb.append(" did not contain the survey id ");
					sb.append(surveyId);
					String msg = sb.toString();
					throw new ServiceException(ErrorCode.SURVEY_INVALID_SURVEY_ID, msg);
				}
			} 
			catch(DomainException e) {
				throw new ServiceException("The surveyId was null.", e);
			}
		}
	}
public void verifySurveyIdsBelongToConfiguration ( final Collection < String > surveyIdList , final Campaign configuration ) throws ServiceException { if ( surveyIdList == null || configuration == null ) { throw new IllegalArgumentException ( "A non-null request, surveyIdList, and configuration are required" ) ; } for ( String surveyId : surveyIdList ) { try { if ( ! configuration . surveyIdExists ( surveyId ) ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( "The configuration for campaign " ) ; sb . append ( configuration . getId ( ) ) ; sb . append ( " did not contain the survey id " ) ; sb . append ( surveyId ) ; String msg = sb . toString ( ) ; throw new ServiceException ( ErrorCode . SURVEY_INVALID_SURVEY_ID , msg ) ; } } catch ( DomainException e ) { throw new ServiceException ( "The surveyId was null." , e ) ; } } }
Verifies that the surveyIdList contains surveys that are present in the
 configuration.
Verifies that the surveyIdList contains surveys that are present in the configuration .
// check for logical errors