/**
* returns ResponseBuilder if none of the tags matched
*/
private ResponseBuilder evaluateIfMatch(EntityTag tag, String headerValue) {
logger.trace("evaluateIfMatch({}, {}) called", tag, headerValue); //$NON-NLS-1$
EntityTagMatchHeader ifMatchHeader = null;
try {
ifMatchHeader = ifMatchHeaderDelegate.fromString(headerValue);
logger.trace("ifMatchHeaderDelegate returned {}", ifMatchHeader); //$NON-NLS-1$
} catch (IllegalArgumentException e) {
throw new WebApplicationException(e, Response.Status.BAD_REQUEST);
}
if (!ifMatchHeader.isMatch(tag)) {
// none of the tags matches the etag
ResponseBuilder responseBuilder = delegate.createResponseBuilder();
responseBuilder.status(HttpServletResponse.SC_PRECONDITION_FAILED).tag(tag);
logger.trace("evaluateIfMatch returning built response because there was no match"); //$NON-NLS-1$
return responseBuilder;