src/org/ohmage/service/CampaignServices.java
public void checkCampaignExistence(final String campaignId, 
			final boolean shouldExist) throws ServiceException {
		
		try {
			if(campaignQueries.getCampaignExists(campaignId)) {
				if(! shouldExist) {
					throw new ServiceException(
							ErrorCode.CAMPAIGN_INVALID_XML, 
							"The campaign already exists.");
				}
			}
			else {
				if(shouldExist) {
					throw new ServiceException(
							ErrorCode.CAMPAIGN_INVALID_ID, 
							"The campaign does not exist.");
				}
			}
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
/**
	 * Checks if a campaign already exists or not based on the 'shouldExist'
	 * flag.
	 * 
	 * @param campaignId The unique identifier of a campaign whose existence is
	 * 					 being checked.
	 * 
	 * @param shouldExist Whether or not the campaign should already exist.
	 * 
	 * @throws ServiceException Thrown if there is an error, if the campaign
	 * 							exists and it shouldn't, or if the campaign
	 * 							doesn't exist and it should.
	 */
Checks if a campaign already exists or not based on the 'shouldExist'
flag.

@param campaignId The unique identifier of a campaign whose existence is
being checked.

@param shouldExist Whether or not the campaign should already exist.

@throws ServiceException Thrown if there is an error, if the campaign
exists and it shouldn't, or if the campaign
doesn't exist and it should.
Checks if a campaign already exists or not based on the ' shouldExist ' flag . @param campaignId The unique identifier of a campaign whose existence is being checked . @param shouldExist Whether or not the campaign should already exist . @throws ServiceException Thrown if there is an error if the campaign exists and it shouldn ' t or if the campaign doesn ' t exist and it should .
public void checkCampaignExistence(final String campaignId, 
			final boolean shouldExist) throws ServiceException {
		try {
			if(campaignQueries.getCampaignExists(campaignId)) {
				if(! shouldExist) {
					throw new ServiceException(
							ErrorCode.CAMPAIGN_INVALID_XML, 
							"The campaign already exists.");
				}
			}
			else {
				if(shouldExist) {
					throw new ServiceException(
							ErrorCode.CAMPAIGN_INVALID_ID, 
							"The campaign does not exist.");
				}
			}
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
public void checkCampaignExistence ( final String campaignId , final boolean shouldExist ) throws ServiceException { try { if ( campaignQueries . getCampaignExists ( campaignId ) ) { if ( ! shouldExist ) { throw new ServiceException ( ErrorCode . CAMPAIGN_INVALID_XML , "The campaign already exists." ) ; } } else { if ( shouldExist ) { throw new ServiceException ( ErrorCode . CAMPAIGN_INVALID_ID , "The campaign does not exist." ) ; } } } catch ( DataAccessException e ) { throw new ServiceException ( e ) ; } }
Checks if a campaign already exists or not based on the 'shouldExist'
 flag.
Checks if a campaign already exists or not based on the ' shouldExist ' flag .