<commit_before>package org.ohmage.request.auth;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.ohmage.cache.UserBin;
import org.ohmage.request.UserRequest;

public class AuthTokenLogoutRequest extends UserRequest {
	private static final Logger LOGGER = Logger.getLogger(AuthTokenLogoutRequest.class);
	
	public AuthTokenLogoutRequest(HttpServletRequest httpRequest) {
		super(httpRequest, TokenLocation.EITHER);
		
		LOGGER.info("Creating a logout request.");
	}

	@Override
	public void service() {
		LOGGER.info("Servicing the logout request.");

		if(! authenticate(AllowNewAccount.NEW_ACCOUNT_DISALLOWED)) {
			return;
		}
		
		UserBin.expireUser(getUser().getToken());
	}

	@Override
	public void respond(HttpServletRequest httpRequest, HttpServletResponse httpResponse) {
		LOGGER.info("Responding to the logout request.");
		
		respond(httpRequest, httpResponse, null);
	}
}<commit_msg>Added comments to the logout request.<commit_after>package org.ohmage.request.auth;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.ohmage.cache.UserBin;
import org.ohmage.request.UserRequest;

/**
 * <p>Removes the user's authentication token from the bin.</p>
 * 
 * <table border="1">
 *   <tr>
 *     <td>Parameter Name</td>
 *     <td>Description</td>
 *     <td>Required</td>
 *   </tr>
 *   <tr>
 *     <td>{@value org.ohmage.request.InputKeys#CLIENT}</td>
 *     <td>A string describing the client that is making this request.</td>
 *     <td>true</td>
 *   </tr>
 * </table>
 * 
 * @author <NAME>
 */
public class AuthTokenLogoutRequest extends UserRequest {
	private static final Logger LOGGER = Logger.getLogger(AuthTokenLogoutRequest.class);
	
	/**
	 * Creates a request for deleting the user's authentication token from the
	 * bin.
	 * 
	 * @param httpRequest The HTTP request containing the parameters.
	 */
	public AuthTokenLogoutRequest(HttpServletRequest httpRequest) {
		super(httpRequest, TokenLocation.EITHER);
		
		LOGGER.info("Creating a logout request.");
	}

	/*
	 * (non-Javadoc)
	 * @see org.ohmage.request.Request#service()
	 */
	@Override
	public void service() {
		LOGGER.info("Servicing the logout request.");

		if(! authenticate(AllowNewAccount.NEW_ACCOUNT_DISALLOWED)) {
			return;
		}
		
		UserBin.expireUser(getUser().getToken());
	}

	/*
	 * (non-Javadoc)
	 * @see org.ohmage.request.Request#respond(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
	 */
	@Override
	public void respond(HttpServletRequest httpRequest, HttpServletResponse httpResponse) {
		LOGGER.info("Responding to the logout request.");
		
		respond(httpRequest, httpResponse, null);
	}
}
{'fraction_non_alphanumeric': 0.12080057183702644, 'fraction_numerical': 0.001072194424588992, 'mean_word_length': 4.553571428571429, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1787787', 'n_tokens_mistral': 922, 'n_tokens_neox': 859, 'n_words': 184}