case URI50B: if (method != ODataHttpMethod.GET) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); case URI7B: if (method != ODataHttpMethod.GET && method != ODataHttpMethod.POST) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); if (method != ODataHttpMethod.GET && method != ODataHttpMethod.PUT && method != ODataHttpMethod.DELETE && method != ODataHttpMethod.PATCH && method != ODataHttpMethod.MERGE) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); if (method != ODataHttpMethod.GET && method != ODataHttpMethod.PUT && method != ODataHttpMethod.PATCH && method != ODataHttpMethod.MERGE) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); if (method != ODataHttpMethod.GET && method != ODataHttpMethod.PUT && method != ODataHttpMethod.DELETE && method != ODataHttpMethod.PATCH && method != ODataHttpMethod.MERGE) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); } else if (method == ODataHttpMethod.DELETE && !uriInfo.isValue()) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); } else { if (uriInfo.getFormat() != null) {
case URI50B: if (method != ODataHttpMethod.GET) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); case URI7B: if (method != ODataHttpMethod.GET && method != ODataHttpMethod.POST) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); if (method != ODataHttpMethod.GET && method != ODataHttpMethod.PUT && method != ODataHttpMethod.DELETE && method != ODataHttpMethod.PATCH && method != ODataHttpMethod.MERGE) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); if (method != ODataHttpMethod.GET && method != ODataHttpMethod.PUT && method != ODataHttpMethod.PATCH && method != ODataHttpMethod.MERGE) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); if (method != ODataHttpMethod.GET && method != ODataHttpMethod.PUT && method != ODataHttpMethod.DELETE && method != ODataHttpMethod.PATCH && method != ODataHttpMethod.MERGE) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); } else if (method == ODataHttpMethod.DELETE && !uriInfo.isValue()) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); } else { if (uriInfo.getFormat() != null) {
case URI50B: if (method != ODataHttpMethod.GET) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); case URI7B: if (method != ODataHttpMethod.GET && method != ODataHttpMethod.POST) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); if (method != ODataHttpMethod.GET && method != ODataHttpMethod.PUT && method != ODataHttpMethod.DELETE && method != ODataHttpMethod.PATCH && method != ODataHttpMethod.MERGE) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); if (method != ODataHttpMethod.GET && method != ODataHttpMethod.PUT && method != ODataHttpMethod.PATCH && method != ODataHttpMethod.MERGE) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); if (method != ODataHttpMethod.GET && method != ODataHttpMethod.PUT && method != ODataHttpMethod.DELETE && method != ODataHttpMethod.PATCH && method != ODataHttpMethod.MERGE) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); } else if (method == ODataHttpMethod.DELETE && !uriInfo.isValue()) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); } else { if (uriInfo.getFormat() != null) {
private void createMethodNotAllowedResponse(final HttpServletRequest req, final MessageReference messageReference, final HttpServletResponse resp, ODataServiceFactory serviceFactory) throws IOException { ODataExceptionWrapper exceptionWrapper = new ODataExceptionWrapper(req, serviceFactory); ODataResponse response = exceptionWrapper.wrapInExceptionResponse(new ODataMethodNotAllowedException(messageReference)); createResponse(resp, response); }
private void createMethodNotAllowedResponse(final HttpServletRequest req, final MessageReference messageReference, final HttpServletResponse resp, ODataServiceFactory serviceFactory) throws IOException { ODataExceptionWrapper exceptionWrapper = new ODataExceptionWrapper(req, serviceFactory); ODataResponse response = exceptionWrapper.wrapInExceptionResponse(new ODataMethodNotAllowedException(messageReference)); createResponse(resp, response); }
private static void checkFunctionImport(final ODataHttpMethod method, final UriInfoImpl uriInfo) throws ODataException { if (uriInfo.getFunctionImport() != null && uriInfo.getFunctionImport().getHttpMethod() != null && !uriInfo.getFunctionImport().getHttpMethod().equals(method.toString())) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); } }
private static void checkFunctionImport(final ODataHttpMethod method, final UriInfoImpl uriInfo) throws ODataException { if (uriInfo.getFunctionImport() != null && uriInfo.getFunctionImport().getHttpMethod() != null && !uriInfo.getFunctionImport().getHttpMethod().equals(method.toString())) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); } }
private static void checkFunctionImport(final ODataHttpMethod method, final UriInfoImpl uriInfo) throws ODataException { if (uriInfo.getFunctionImport() != null && uriInfo.getFunctionImport().getHttpMethod() != null && !uriInfo.getFunctionImport().getHttpMethod().equals(method.toString())) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); } }
private static void checkProperty(final ODataHttpMethod method, final UriInfoImpl uriInfo) throws ODataException { if ((uriInfo.getUriType() == UriType.URI4 || uriInfo.getUriType() == UriType.URI5) && (isPropertyKey(uriInfo) || method == ODataHttpMethod.DELETE && !isPropertyNullable(getProperty(uriInfo)))) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); } }
private static void checkProperty(final ODataHttpMethod method, final UriInfoImpl uriInfo) throws ODataException { if ((uriInfo.getUriType() == UriType.URI4 || uriInfo.getUriType() == UriType.URI5) && (isPropertyKey(uriInfo) || method == ODataHttpMethod.DELETE && !isPropertyNullable(getProperty(uriInfo)))) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); } }
private static void checkProperty(final ODataHttpMethod method, final UriInfoImpl uriInfo) throws ODataException { if ((uriInfo.getUriType() == UriType.URI4 || uriInfo.getUriType() == UriType.URI5) && (isPropertyKey(uriInfo) || method == ODataHttpMethod.DELETE && !isPropertyNullable(getProperty(uriInfo)))) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); } }
|| uriInfo.getOrderBy() != null || uriInfo.getSkipToken() != null || uriInfo.getSkip() != null || uriInfo.getTop() != null || !uriInfo.getExpand().isEmpty() || !uriInfo.getSelect().isEmpty()) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); if (method == ODataHttpMethod.PUT || method == ODataHttpMethod.PATCH || method == ODataHttpMethod.MERGE) { if (!uriInfo.isValue() && uriInfo.getFormat() != null) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); || uriInfo.getOrderBy() != null || uriInfo.getSkipToken() != null || uriInfo.getSkip() != null || uriInfo.getTop() != null) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH);
|| uriInfo.getOrderBy() != null || uriInfo.getSkipToken() != null || uriInfo.getSkip() != null || uriInfo.getTop() != null || !uriInfo.getExpand().isEmpty() || !uriInfo.getSelect().isEmpty()) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); if (method == ODataHttpMethod.PUT || method == ODataHttpMethod.PATCH || method == ODataHttpMethod.MERGE) { if (!uriInfo.isValue() && uriInfo.getFormat() != null) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); || uriInfo.getOrderBy() != null || uriInfo.getSkipToken() != null || uriInfo.getSkip() != null || uriInfo.getTop() != null) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH);
|| uriInfo.getOrderBy() != null || uriInfo.getSkipToken() != null || uriInfo.getSkip() != null || uriInfo.getTop() != null || !uriInfo.getExpand().isEmpty() || !uriInfo.getSelect().isEmpty()) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); if (method == ODataHttpMethod.PUT || method == ODataHttpMethod.PATCH || method == ODataHttpMethod.MERGE) { if (!uriInfo.isValue() && uriInfo.getFormat() != null) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); || uriInfo.getOrderBy() != null || uriInfo.getSkipToken() != null || uriInfo.getSkip() != null || uriInfo.getTop() != null) { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH);
return service.getServiceDocumentProcessor().readServiceDocument(uriInfo, contentType); } else { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); return service.getEntitySetProcessor().createEntity(uriInfo, content, requestContentType, contentType); default: throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); return service.getEntityProcessor().deleteEntity(uriInfo, contentType); default: throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); requestContentType, true, contentType); default: throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); return service.getEntitySimplePropertyValueProcessor().deleteEntitySimplePropertyValue(uriInfo, contentType); } else { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataBadRequestException(ODataBadRequestException.NOTSUPPORTED); default: throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); return service.getEntityLinkProcessor().deleteEntityLink(uriInfo, contentType); default: throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH);
return service.getServiceDocumentProcessor().readServiceDocument(uriInfo, contentType); } else { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); return service.getEntitySetProcessor().createEntity(uriInfo, content, requestContentType, contentType); default: throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); return service.getEntityProcessor().deleteEntity(uriInfo, contentType); default: throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); requestContentType, true, contentType); default: throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); return service.getEntitySimplePropertyValueProcessor().deleteEntitySimplePropertyValue(uriInfo, contentType); } else { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataBadRequestException(ODataBadRequestException.NOTSUPPORTED); default: throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); return service.getEntityLinkProcessor().deleteEntityLink(uriInfo, contentType); default: throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH);
return service.getServiceDocumentProcessor().readServiceDocument(uriInfo, contentType); } else { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); return service.getEntitySetProcessor().createEntity(uriInfo, content, requestContentType, contentType); default: throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); return service.getEntityProcessor().deleteEntity(uriInfo, contentType); default: throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); requestContentType, true, contentType); default: throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); return service.getEntitySimplePropertyValueProcessor().deleteEntitySimplePropertyValue(uriInfo, contentType); } else { throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); throw new ODataBadRequestException(ODataBadRequestException.NOTSUPPORTED); default: throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH); return service.getEntityLinkProcessor().deleteEntityLink(uriInfo, contentType); default: throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH);