public abstract class WriteMethodHandler extends Object
| Constructor and Description |
|---|
WriteMethodHandler(ODataRequestContext requestContext,
DataSourceFactory dataSourceFactory) |
| Modifier and Type | Method and Description |
|---|---|
protected DataSource |
getDataSource(String entityType) |
DataSourceFactory |
getDataSourceFactory() |
EntityDataModel |
getEntityDataModel() |
ODataRequestContext |
getODataRequestContext() |
ODataUri |
getoDataUri() |
ODataRequest |
getRequest() |
protected Map<String,String> |
getResponseHeaders(Object entity)
Get the response headers when the response is to include an entity in its body.
|
protected TargetType |
getTargetType() |
abstract ProcessorResult |
handleWrite(Object entity) |
protected boolean |
isMinimalReturnPreferred()
Check whether the return-minimal is preferred by the HTTP client by inspecting the 'HTTP-Prefer' header.
|
protected void |
validateKeys(Object entity,
EntityType type)
Performs the validation of keys.
|
protected void |
validateProperties(Object entity,
EntityDataModel edm)
Checks if all non-nullable properties of an entity are non-empty.
|
protected void |
validateTargetType(Object entity)
Validates the target type.
|
public WriteMethodHandler(ODataRequestContext requestContext, DataSourceFactory dataSourceFactory)
public abstract ProcessorResult handleWrite(Object entity) throws ODataException
ODataExceptionprotected TargetType getTargetType() throws ODataTargetTypeException
ODataTargetTypeExceptionprotected DataSource getDataSource(String entityType) throws ODataDataSourceException
ODataDataSourceExceptionprotected boolean isMinimalReturnPreferred()
true if the return-minimal is preferred.protected Map<String,String> getResponseHeaders(Object entity) throws ODataEdmException
entity - The entity that will be included in the body of the response.ODataEdmException - In case it is not possible to build the headers.protected void validateKeys(Object entity, EntityType type) throws ODataClientException, ODataProcessorException
entity - The passed entity.type - The entity type of the passed entity.ODataClientExceptionODataProcessorExceptionprotected void validateTargetType(Object entity) throws ODataProcessorException, ODataTargetTypeException
entity - an entityODataProcessorExceptionODataTargetTypeExceptionprotected void validateProperties(Object entity, EntityDataModel edm) throws ODataException
entity - The entity to check.ODataBadRequestException - If any of the non-nullable properties of the entity are empty.ODataExceptionpublic ODataRequest getRequest()
public EntityDataModel getEntityDataModel()
public ODataRequestContext getODataRequestContext()
public ODataUri getoDataUri()
public DataSourceFactory getDataSourceFactory()
Copyright © 2014–2023 RWS Group for and on behalf of its affiliates and subsidiaries. All rights reserved.