src/org/ohmage/service/UserClassServices.java
public void classExistsAndUserBelongs(final String classId, 
			final String username) throws ServiceException {
		
		ClassServices.instance().checkClassExistence(classId, true);
		
		try {
			if(! userClassQueries.userBelongsToClass(classId, username)) {
				throw new ServiceException(
						ErrorCode.USER_INVALID_USERNAME, 
						"The user does not belong to the class: " + classId);
			}
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
/**
	 * Ensures that the class exists and that the user belongs to the class in
	 * some capacity.
	 * 
	 * @param classId The unique identifier for the class.
	 * 
	 * @param username The username of the user that must belong to the class.
	 * 
	 * @throws ServiceException Thrown if there is an error, if the class  
	 * 							doesn't exist, or if the class does exist but
	 * 							the user doesn't belong to the class.
	 */
Ensures that the class exists and that the user belongs to the class in
some capacity.

@param classId The unique identifier for the class.

@param username The username of the user that must belong to the class.

@throws ServiceException Thrown if there is an error, if the class
doesn't exist, or if the class does exist but
the user doesn't belong to the class.
Ensures that the class exists and that the user belongs to the class in some capacity . @param classId The unique identifier for the class . @param username The username of the user that must belong to the class . @throws ServiceException Thrown if there is an error if the class doesn ' t exist or if the class does exist but the user doesn ' t belong to the class .
public void classExistsAndUserBelongs(final String classId, 
			final String username) throws ServiceException {
		ClassServices.instance().checkClassExistence(classId, true);
		try {
			if(! userClassQueries.userBelongsToClass(classId, username)) {
				throw new ServiceException(
						ErrorCode.USER_INVALID_USERNAME, 
						"The user does not belong to the class: " + classId);
			}
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
public void classExistsAndUserBelongs ( final String classId , final String username ) throws ServiceException { ClassServices . instance ( ) . checkClassExistence ( classId , true ) ; try { if ( ! userClassQueries . userBelongsToClass ( classId , username ) ) { throw new ServiceException ( ErrorCode . USER_INVALID_USERNAME , "The user does not belong to the class: " + classId ) ; } } catch ( DataAccessException e ) { throw new ServiceException ( e ) ; } }
Ensures that the class exists and that the user belongs to the class in
 some capacity.
Ensures that the class exists and that the user belongs to the class in some capacity .