src/org/ohmage/service/CampaignClassServices.java
public void verifyNotDisassocitingAllClassesFromCampaign(
			final String campaignId, final Collection<String> classIdsToRemove,
			final Collection<String> classIdsToAdd) 
			throws ServiceException {
		
		try {
			Set<String> currClassIds = new HashSet<String>(campaignClassQueries.getClassesAssociatedWithCampaign(campaignId));
			if(classIdsToAdd != null) {
				currClassIds.addAll(classIdsToAdd);
			}
			currClassIds.removeAll(classIdsToRemove);
			
			if(currClassIds.size() == 0) {
				throw new ServiceException(
						ErrorCode.CAMPAIGN_INSUFFICIENT_PERMISSIONS, 
						"The user is not allowed to disassociate all classes from the campaign.");
			}
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
/**
	 * Verifies that the list of classes doesn't cover all of the classes
	 * associated with the campaign.
	 * 
	 * @param campaignId The campaign's unique identifier.
	 * 
	 * @param classIds The collection of class IDs.
	 * 
	 * @throws ServiceException Thrown if the collection of classes contains 
	 * 							all of the classes to which the campaign is
	 * 							associated or if there is an error.
	 */
Verifies that the list of classes doesn't cover all of the classes
associated with the campaign.

@param campaignId The campaign's unique identifier.

@param classIds The collection of class IDs.

@throws ServiceException Thrown if the collection of classes contains
all of the classes to which the campaign is
associated or if there is an error.
Verifies that the list of classes doesn ' t cover all of the classes associated with the campaign . @param campaignId The campaign ' s unique identifier . @param classIds The collection of class IDs . @throws ServiceException Thrown if the collection of classes contains all of the classes to which the campaign is associated or if there is an error .
public void verifyNotDisassocitingAllClassesFromCampaign(
			final String campaignId, final Collection<String> classIdsToRemove,
			final Collection<String> classIdsToAdd) 
			throws ServiceException {
		try {
			Set<String> currClassIds = new HashSet<String>(campaignClassQueries.getClassesAssociatedWithCampaign(campaignId));
			if(classIdsToAdd != null) {
				currClassIds.addAll(classIdsToAdd);
			}
			currClassIds.removeAll(classIdsToRemove);
			if(currClassIds.size() == 0) {
				throw new ServiceException(
						ErrorCode.CAMPAIGN_INSUFFICIENT_PERMISSIONS, 
						"The user is not allowed to disassociate all classes from the campaign.");
			}
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
public void verifyNotDisassocitingAllClassesFromCampaign ( final String campaignId , final Collection < String > classIdsToRemove , final Collection < String > classIdsToAdd ) throws ServiceException { try { Set < String > currClassIds = new HashSet < String > ( campaignClassQueries . getClassesAssociatedWithCampaign ( campaignId ) ) ; if ( classIdsToAdd != null ) { currClassIds . addAll ( classIdsToAdd ) ; } currClassIds . removeAll ( classIdsToRemove ) ; if ( currClassIds . size ( ) == 0 ) { throw new ServiceException ( ErrorCode . CAMPAIGN_INSUFFICIENT_PERMISSIONS , "The user is not allowed to disassociate all classes from the campaign." ) ; } } catch ( DataAccessException e ) { throw new ServiceException ( e ) ; } }
Verifies that the list of classes doesn't cover all of the classes
 associated with the campaign.
Verifies that the list of classes doesn ' t cover all of the classes associated with the campaign .