Class ODataRequestRead
java.lang.Object
com.sap.cloud.sdk.datamodel.odata.client.request.ODataRequestGeneric
com.sap.cloud.sdk.datamodel.odata.client.request.ODataRequestRead
- All Implemented Interfaces:
ODataRequestExecutable
- Direct Known Subclasses:
ODataRequestCount
The result type of the OData Read request.
-
Field Summary
Fields inherited from class com.sap.cloud.sdk.datamodel.odata.client.request.ODataRequestGeneric
csrfTokenRetriever, resourcePath, servicePath -
Constructor Summary
ConstructorsConstructorDescriptionODataRequestRead(String servicePath, ODataResourcePath entityPath, StructuredQuery query) Constructor with StructuredQuery for OData read requests on entity collections directly.ODataRequestRead(String servicePath, ODataResourcePath entityPath, String encodedQuery, ODataProtocol protocol) Default constructor for OData Read request.ODataRequestRead(String servicePath, String entityName, String encodedQuery, ODataProtocol protocol) Convenience constructor for OData read requests on entity collections directly. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanexecute(org.apache.http.client.HttpClient httpClient) Execute the OData request with the provided HttpClient reference.getRelativeUri(UriEncodingStrategy strategy) Get the static request URI of the OData resource.Use all OData query information to construct a HTTP request query String.inthashCode()Disable pre-buffering of http response entity.Methods inherited from class com.sap.cloud.sdk.datamodel.odata.client.request.ODataRequestGeneric
addHeader, addHeaderIfAbsent, addListener, addQueryParameter, getHeaders, getListeners, getProtocol, getQueryParameters, getRelativeUri, getResourcePath, getServicePath, setCsrfTokenRetriever, setHeader, setHeader, tryExecute, tryExecuteWithCsrfToken
-
Constructor Details
-
ODataRequestRead
public ODataRequestRead(@Nonnull String servicePath, @Nonnull String entityName, @Nullable String encodedQuery, @Nonnull ODataProtocol protocol) Convenience constructor for OData read requests on entity collections directly. For operations on nested entity collections useODataRequestRead(String, ODataResourcePath, String, ODataProtocol).- Parameters:
servicePath- The OData service path.entityName- The OData entity name.encodedQuery- Optional: The encoded HTTP query, if any.protocol- The OData protocol to use.
-
ODataRequestRead
public ODataRequestRead(@Nonnull String servicePath, @Nonnull ODataResourcePath entityPath, @Nullable String encodedQuery, @Nonnull ODataProtocol protocol) Default constructor for OData Read request.Note: The query string
queryStringmust not contain characters that are forbidden in URLs, like spaces. If forbidden characters are present, anIllegalArgumentExceptionis thrown.Build an instance of
StructuredQueryand pass the value ofStructuredQuery.getEncodedQueryString()asqueryStringto this method.Alternatively, use
UrlEscapers.urlFragmentEscaper()from the Guava library to escape the query string before passing it here.- Parameters:
servicePath- The OData service path.entityPath- TheODataResourcePaththat identifies the collection of entities or properties to read.encodedQuery- Optional: The encoded HTTP query, if any.protocol- The OData protocol to use.
-
ODataRequestRead
public ODataRequestRead(@Nonnull String servicePath, @Nonnull ODataResourcePath entityPath, @Nonnull StructuredQuery query) Constructor with StructuredQuery for OData read requests on entity collections directly. For operations on nested entity collections useODataRequestRead(String, ODataResourcePath, String, ODataProtocol).- Parameters:
servicePath- The OData service path.entityPath- TheODataResourcePaththat identifies the collection of entities or properties to read.query- The structured query.
-
-
Method Details
-
getRelativeUri
Description copied from class:ODataRequestGenericGet the static request URI of the OData resource.- Specified by:
getRelativeUriin classODataRequestGeneric- Parameters:
strategy- URI encoding strategy.- Returns:
- The String representation of the request URI.
-
getRequestQuery
Description copied from class:ODataRequestGenericUse all OData query information to construct a HTTP request query String.- Overrides:
getRequestQueryin classODataRequestGeneric- Returns:
- The request query.
-
execute
@Nonnull public ODataRequestResultGeneric execute(@Nonnull org.apache.http.client.HttpClient httpClient) Description copied from interface:ODataRequestExecutableExecute the OData request with the provided HttpClient reference.- Parameters:
httpClient- The HttpClient.- Returns:
- An OData request result.
-
withoutResponseBuffering
Disable pre-buffering of http response entity. -
getQueryString
-
equals
- Overrides:
equalsin classODataRequestGeneric
-
canEqual
- Overrides:
canEqualin classODataRequestGeneric
-
hashCode
public int hashCode()- Overrides:
hashCodein classODataRequestGeneric
-