/** * A modifying request that targets an entity with enabled concurrency control * must contain at least one concurrency-control HTTP request header field. */ private static void checkConditions(final ODataHttpMethod method, final UriInfoImpl uriInfo, final String ifMatch, final String ifNoneMatch, final String ifModifiedSince, final String ifUnmodifiedSince) throws ODataException { if ((method == ODataHttpMethod.PUT || method == ODataHttpMethod.PATCH || method == ODataHttpMethod.MERGE || method == ODataHttpMethod.DELETE) && ifMatch == null && ifNoneMatch == null && ifModifiedSince == null && ifUnmodifiedSince == null && Arrays.asList(UriType.URI2, UriType.URI6A, UriType.URI3, UriType.URI4, UriType.URI5, UriType.URI17) .contains(uriInfo.getUriType()) && hasConcurrencyControl(uriInfo.getTargetEntitySet().getEntityType())) { throw new ODataPreconditionRequiredException(ODataPreconditionRequiredException.COMMON); } }
EdmEntitySet fromEntitySet = uriResult.getTargetEntitySet();
/** * A modifying request that targets an entity with enabled concurrency control * must contain at least one concurrency-control HTTP request header field. */ private static void checkConditions(final ODataHttpMethod method, final UriInfoImpl uriInfo, final String ifMatch, final String ifNoneMatch, final String ifModifiedSince, final String ifUnmodifiedSince) throws ODataException { if ((method == ODataHttpMethod.PUT || method == ODataHttpMethod.PATCH || method == ODataHttpMethod.MERGE || method == ODataHttpMethod.DELETE) && ifMatch == null && ifNoneMatch == null && ifModifiedSince == null && ifUnmodifiedSince == null && checkUriType(uriInfo.getUriType()) && hasConcurrencyControl(uriInfo.getTargetEntitySet().getEntityType())) { throw new ODataPreconditionRequiredException(ODataPreconditionRequiredException.COMMON); } }
/** * A modifying request that targets an entity with enabled concurrency control * must contain at least one concurrency-control HTTP request header field. */ private static void checkConditions(final ODataHttpMethod method, final UriInfoImpl uriInfo, final String ifMatch, final String ifNoneMatch, final String ifModifiedSince, final String ifUnmodifiedSince) throws ODataException { if ((method == ODataHttpMethod.PUT || method == ODataHttpMethod.PATCH || method == ODataHttpMethod.MERGE || method == ODataHttpMethod.DELETE) && ifMatch == null && ifNoneMatch == null && ifModifiedSince == null && ifUnmodifiedSince == null && checkUriType(uriInfo.getUriType()) && hasConcurrencyControl(uriInfo.getTargetEntitySet().getEntityType())) { throw new ODataPreconditionRequiredException(ODataPreconditionRequiredException.COMMON); } }
EdmEntitySet fromEntitySet = uriResult.getTargetEntitySet();
EdmEntitySet fromEntitySet = uriResult.getTargetEntitySet();
private void handleNavigationPathOptions() throws UriSyntaxException, UriNotMatchingException, EdmException { currentPathSegment = pathSegments.remove(0); final String decodedPath = percentDecode(currentPathSegment); checkCount(); if (uriResult.isCount()) { uriResult.setUriType(UriType.URI16); // Count of multiple entities is handled elsewhere } else if ("$value".equals(decodedPath)) { if (uriResult.getTargetEntitySet().getEntityType().hasStream()) { ensureLastSegment(); uriResult.setUriType(UriType.URI17); uriResult.setValue(true); } else { throw new UriSyntaxException(UriSyntaxException.NOMEDIARESOURCE); } } else if ("$links".equals(decodedPath)) { uriResult.setLinks(true); if (pathSegments.isEmpty()) { throw new UriSyntaxException(UriSyntaxException.MUSTNOTBELASTSEGMENT.addContent(currentPathSegment)); } currentPathSegment = pathSegments.remove(0); handleNavigationProperties(); } else { handleNavigationProperties(); } }
private void handleNavigationPathOptions() throws UriSyntaxException, UriNotMatchingException, EdmException { currentPathSegment = pathSegments.remove(0); checkCount(); if (uriResult.isCount()) { uriResult.setUriType(UriType.URI16); // Count of multiple entities is handled elsewhere } else if ("$value".equals(currentPathSegment)) { if (uriResult.getTargetEntitySet().getEntityType().hasStream()) { ensureLastSegment(); uriResult.setUriType(UriType.URI17); uriResult.setValue(true); } else { throw new UriSyntaxException(UriSyntaxException.NOMEDIARESOURCE); } } else if ("$links".equals(currentPathSegment)) { uriResult.setLinks(true); if (pathSegments.isEmpty()) { throw new UriSyntaxException(UriSyntaxException.MUSTNOTBELASTSEGMENT.addContent(currentPathSegment)); } currentPathSegment = pathSegments.remove(0); handleNavigationProperties(); } else { handleNavigationProperties(); } }
private void handleNavigationPathOptions() throws UriSyntaxException, UriNotMatchingException, EdmException { currentPathSegment = pathSegments.remove(0); final String decodedPath = percentDecode(currentPathSegment); checkCount(); if (uriResult.isCount()) { uriResult.setUriType(UriType.URI16); // Count of multiple entities is handled elsewhere } else if ("$value".equals(decodedPath)) { if (uriResult.getTargetEntitySet().getEntityType().hasStream()) { ensureLastSegment(); uriResult.setUriType(UriType.URI17); uriResult.setValue(true); } else { throw new UriSyntaxException(UriSyntaxException.NOMEDIARESOURCE); } } else if ("$links".equals(decodedPath)) { uriResult.setLinks(true); if (pathSegments.isEmpty()) { throw new UriSyntaxException(UriSyntaxException.MUSTNOTBELASTSEGMENT.addContent(currentPathSegment)); } currentPathSegment = pathSegments.remove(0); handleNavigationProperties(); } else { handleNavigationProperties(); } }
EdmEntitySet fromEntitySet = uriResult.getTargetEntitySet();
EdmEntitySet fromEntitySet = uriResult.getTargetEntitySet();
EdmEntitySet fromEntitySet = uriResult.getTargetEntitySet();
private void addNavigationSegment(final String keyPredicateName, final EdmNavigationProperty navigationProperty) throws UriSyntaxException, EdmException { final EdmEntitySet targetEntitySet = uriResult.getTargetEntitySet().getRelatedEntitySet(navigationProperty); final EdmEntityType targetEntityType = targetEntitySet.getEntityType(); uriResult.setTargetEntitySet(targetEntitySet); uriResult.setTargetType(targetEntityType); NavigationSegmentImpl navigationSegment = new NavigationSegmentImpl(); navigationSegment.setEntitySet(targetEntitySet); navigationSegment.setNavigationProperty(navigationProperty); if (keyPredicateName != null) { navigationSegment.setKeyPredicates(parseKey(keyPredicateName, targetEntityType)); } uriResult.addNavigationSegment(navigationSegment); }
private void addNavigationSegment(final String keyPredicateName, final EdmNavigationProperty navigationProperty) throws UriSyntaxException, EdmException { final EdmEntitySet targetEntitySet = uriResult.getTargetEntitySet().getRelatedEntitySet(navigationProperty); final EdmEntityType targetEntityType = targetEntitySet.getEntityType(); uriResult.setTargetEntitySet(targetEntitySet); uriResult.setTargetType(targetEntityType); NavigationSegmentImpl navigationSegment = new NavigationSegmentImpl(); navigationSegment.setEntitySet(targetEntitySet); navigationSegment.setNavigationProperty(navigationProperty); if (keyPredicateName != null) { navigationSegment.setKeyPredicates(parseKey(keyPredicateName, targetEntityType)); } uriResult.addNavigationSegment(navigationSegment); }
private void addNavigationSegment(final String keyPredicateName, final EdmNavigationProperty navigationProperty) throws UriSyntaxException, EdmException { final EdmEntitySet targetEntitySet = uriResult.getTargetEntitySet().getRelatedEntitySet(navigationProperty); final EdmEntityType targetEntityType = targetEntitySet.getEntityType(); uriResult.setTargetEntitySet(targetEntitySet); uriResult.setTargetType(targetEntityType); NavigationSegmentImpl navigationSegment = new NavigationSegmentImpl(); navigationSegment.setEntitySet(targetEntitySet); navigationSegment.setNavigationProperty(navigationProperty); if (keyPredicateName != null) { navigationSegment.setKeyPredicates(parseKey(keyPredicateName, targetEntityType)); } uriResult.addNavigationSegment(navigationSegment); }
final String emptyParentheses = matcher.group(3); final EdmTyped property = uriResult.getTargetEntitySet().getEntityType().getProperty(navigationPropertyName); if (property == null) { throw new UriNotMatchingException(UriNotMatchingException.PROPERTYNOTFOUND.addContent(navigationPropertyName));
final String emptyParentheses = matcher.group(3); final EdmTyped property = uriResult.getTargetEntitySet().getEntityType().getProperty(navigationPropertyName); if (property == null) { throw new UriNotMatchingException(UriNotMatchingException.PROPERTYNOTFOUND.addContent(navigationPropertyName));
processorFeature = uriInfo.getTargetEntitySet().getEntityType().hasStream() ? EntityMediaProcessor.class : EntityProcessor.class; // The request must contain a single entity! } else if (processorFeature == EntityLinksProcessor.class) {
processorFeature = uriInfo.getTargetEntitySet().getEntityType().hasStream() ? EntityMediaProcessor.class : EntityProcessor.class; // The request must contain a single entity! } else if (processorFeature == EntityLinksProcessor.class) {
processorFeature = uriInfo.getTargetEntitySet().getEntityType().hasStream() ? EntityMediaProcessor.class : EntityProcessor.class; // The request must contain a single entity! } else if (processorFeature == EntityLinksProcessor.class) {