private boolean checkForContentType(ODataRequestContext oDataRequestContext, MediaType expected) { MediaType requestContentType = oDataRequestContext.getRequest().getContentType(); return requestContentType != null && requestContentType.matches(expected); }
@Override public String toString() { return request.toString(); } }
private int getNumberOfChangeSetsInResult(List<ProcessorResult> result) { int changeSets = 0; for (ProcessorResult processorResult : result) { if (!processorResult.getRequestContext().getRequest().getMethod().equals(ODataRequest.Method.GET)) { changeSets++; } } return changeSets; }
private Map<String, String> buildDefaultEntityHeaders(ODataRequestContext odataRequestContext, ChangeSetEntity changeSetEntity) { Map<String, String> headers = new HashMap<>(); ODataRequest oDataRequest = odataRequestContext.getRequest(); headers.putAll(oDataRequest.getHeaders()); headers.put("changeSetId", changeSetEntity.getChangeSetId()); return headers; }
public BatchMethodHandler(ODataRequestContext requestContext, DataSourceFactory dataSourceFactory, List<ChangeSetEntity> changeSetEntries) { this.changeSetEntities = changeSetEntries; this.entityDataModel = requestContext.getEntityDataModel(); this.dataSourceFactory = dataSourceFactory; }
@Override public String toString() { return status.toString(); } }
/** * This method specifies requested method is POST or not. * * @param method is ODataRequest.Method * @return true if requested method is POST */ protected boolean isPostMethod(ODataRequest.Method method) { return ODataRequest.Method.POST.equals(method); }
@Override public String toString() { return code + " " + name(); } }
private int getNumberOfChangeSetsInResult(List<ProcessorResult> result) { int changeSets = 0; for (ProcessorResult processorResult : result) { if (!processorResult.getRequestContext().getRequest().getMethod().equals(ODataRequest.Method.GET)) { changeSets++; } } return changeSets; }
private Map<String, String> buildDefaultEntityHeaders(ODataRequestContext odataRequestContext, ChangeSetEntity changeSetEntity) { Map<String, String> headers = new HashMap<>(); ODataRequest oDataRequest = odataRequestContext.getRequest(); headers.putAll(oDataRequest.getHeaders()); headers.put("changeSetId", changeSetEntity.getChangeSetId()); return headers; }
private boolean checkForContentType(ODataRequestContext oDataRequestContext, MediaType expected) { MediaType requestContentType = oDataRequestContext.getRequest().getContentType(); return requestContentType != null && requestContentType.matches(expected); }
@Override public String toString() { return request.toString(); } }
public BatchMethodHandler(ODataRequestContext requestContext, DataSourceFactory dataSourceFactory, List<ChangeSetEntity> changeSetEntries) { this.changeSetEntities = changeSetEntries; this.entityDataModel = requestContext.getEntityDataModel(); this.dataSourceFactory = dataSourceFactory; }
/** * This method specifies requested method is POST or not. * * @param method is ODataRequest.Method * @return true if requested method is POST */ protected boolean isPostMethod(ODataRequest.Method method) { return ODataRequest.Method.POST.equals(method); }
@Override public String toString() { return code + " " + name(); } }
/** * This method specifies requested method is PATCH or not. * * @param method is ODataRequest.Method * @return true if requested method is PATCH */ protected boolean isPatchMethod(ODataRequest.Method method) { return ODataRequest.Method.PATCH.equals(method); }
/** * This method specifies requested method is PUT or not. * * @param method is ODataRequest.Method * @return true if requested method is PUT */ protected boolean isPutMethod(ODataRequest.Method method) { return ODataRequest.Method.PUT.equals(method); }
/** * This method specifies requested method is PUT or not. * * @param method is ODataRequest.Method * @return true if requested method is PUT */ protected boolean isPutMethod(ODataRequest.Method method) { return ODataRequest.Method.PUT.equals(method); }