src/org/ohmage/service/ObserverServices.java
public void verifyUserCanCreateObserver(
			final String username,
			final String observerId)
			throws ServiceException {
		
		try {
			// First, the observer cannot already exist.
			if(observerQueries.doesObserverExist(observerId)) {
				throw new ServiceException(
					ErrorCode.OBSERVER_INSUFFICIENT_PERMISSIONS,
					"An observer with the given ID already exists.");
			}
			
			// Other than that, anyone is allowed to create them.
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
/**
	 * Verifies that a user is allowed to create an observer.
	 * 
	 * @param username The user's username.
	 * 
	 * @param observerId The observer's unique identifier.
	 * 
	 * @throws ServiceException The user is not allowed to create the observer
	 * 							or there was an error.
	 */
Verifies that a user is allowed to create an observer.

@param username The user's username.

@param observerId The observer's unique identifier.

@throws ServiceException The user is not allowed to create the observer
or there was an error.
Verifies that a user is allowed to create an observer . @param username The user ' s username . @param observerId The observer ' s unique identifier . @throws ServiceException The user is not allowed to create the observer or there was an error .
public void verifyUserCanCreateObserver(
			final String username,
			final String observerId)
			throws ServiceException {
		try {
			if(observerQueries.doesObserverExist(observerId)) {
				throw new ServiceException(
					ErrorCode.OBSERVER_INSUFFICIENT_PERMISSIONS,
					"An observer with the given ID already exists.");
			}
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
public void verifyUserCanCreateObserver ( final String username , final String observerId ) throws ServiceException { try { if ( observerQueries . doesObserverExist ( observerId ) ) { throw new ServiceException ( ErrorCode . OBSERVER_INSUFFICIENT_PERMISSIONS , "An observer with the given ID already exists." ) ; } } catch ( DataAccessException e ) { throw new ServiceException ( e ) ; } }
Verifies that a user is allowed to create an observer.
Verifies that a user is allowed to create an observer .
// First, the observer cannot already exist. // Other than that, anyone is allowed to create them.