private void setState(Request request, Response response, String status) {
		for (String s : request.getValidStates()) {
			if (status.equals(s)) {
				response.setMatchOk(true);
				break;
			}
		}

		if (!response.isMatchOk() && request.getErrorStates() != null) {
			for (String s : request.getErrorStates()) {
				if (status.equals(s)) {
					response.setMatchError(true);
					break;
				}
			}
		}

		if (!response.isMatchOk() && !response.isMatchError()) {
			throw new BeanstalkException(status);
		}
	}