@Override public boolean incomingServerRequestMatchesMethod(RequestDetails theRequest) { Set<RequestTypeEnum> allowableRequestTypes = provideAllowableRequestTypes(); RequestTypeEnum requestType = theRequest.getRequestType(); if (!allowableRequestTypes.contains(requestType)) { return false; } if (!getResourceName().equals(theRequest.getResourceName())) { return false; } if (getMatchingOperation() == null && StringUtils.isNotBlank(theRequest.getOperation())) { return false; } if (getMatchingOperation() != null && !getMatchingOperation().equals(theRequest.getOperation())) { return false; } /* * Note: Technically this will match an update (PUT) method even if * there is no ID in the URL - We allow this here because there is no * better match for that, and this allows the update/PUT method to give * a helpful error if the client has forgotten to include the * ID in the URL. * * It's also needed for conditional update.. */ return true; }
responseId = responseId.withResourceType(getResourceName());
@Override public boolean incomingServerRequestMatchesMethod(RequestDetails theRequest) { Set<RequestTypeEnum> allowableRequestTypes = provideAllowableRequestTypes(); RequestTypeEnum requestType = theRequest.getRequestType(); if (!allowableRequestTypes.contains(requestType)) { return false; } if (!getResourceName().equals(theRequest.getResourceName())) { return false; } if (getMatchingOperation() == null && StringUtils.isNotBlank(theRequest.getOperation())) { return false; } if (getMatchingOperation() != null && !getMatchingOperation().equals(theRequest.getOperation())) { return false; } /* * Note: Technically this will match an update (PUT) method even if * there is no ID in the URL - We allow this here because there is no * better match for that, and this allows the update/PUT method to give * a helpful error if the client has forgotten to include the * ID in the URL. * * It's also needed for conditional update.. */ return true; }
responseId = responseId.withResourceType(getResourceName());