Class StorageRequest
- java.lang.Object
-
- de.hybris.platform.odata2services.odata.persistence.AbstractRequest
-
- de.hybris.platform.odata2services.odata.persistence.CrudRequest
-
- de.hybris.platform.odata2services.odata.persistence.StorageRequest
-
- All Implemented Interfaces:
PersistenceContext
public class StorageRequest extends CrudRequest implements PersistenceContext
Request which contains an item for persistence.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStorageRequest.StorageRequestBuilder-
Nested classes/interfaces inherited from class de.hybris.platform.odata2services.odata.persistence.CrudRequest
CrudRequest.DataRequestBuilder<T extends CrudRequest.DataRequestBuilder,R extends CrudRequest>
-
Nested classes/interfaces inherited from class de.hybris.platform.odata2services.odata.persistence.AbstractRequest
AbstractRequest.AbstractRequestBuilder<T extends AbstractRequest.AbstractRequestBuilder,R extends AbstractRequest>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.LocalegetContentLocale()Indicates the language, in which localized attributes content is provided.java.util.Optional<ItemModel>getContextItem()java.lang.StringgetPostPersistHook()java.lang.StringgetPrePersistHook()PersistenceContextgetReferencedContext(TypeAttributeDescriptor attribute)Retrieves the persistence context for an item referenced by the specified attributejava.util.Collection<PersistenceContext>getReferencedContexts(TypeAttributeDescriptor attribute)Retrieves the persistence contexts for the items referenced by the specified attributePersistenceContextgetRootContext()Retrieves the top most persistence contextjava.util.Optional<PersistenceContext>getSourceContext()Retrieves the persistence context that the referenced context was gotten frombooleanisItemCanBeCreated()Determines whether a new item model can be created for the context payload.booleanisReplaceAttributes()Indicates the persistence is to replace the item attributes with what's provided in theIntegrationItem.voidputItem(ItemModel item)protected voidsetContentLocale(java.util.Locale contentLocale)protected voidsetPostPersistHook(java.lang.String postPersistHook)protected voidsetPrePersistHook(java.lang.String prePersistHook)static StorageRequest.StorageRequestBuilderstorageRequestBuilder()ItemLookupRequesttoLookupRequest()Creates anItemLookupRequestfrom thisStorageRequest-
Methods inherited from class de.hybris.platform.odata2services.odata.persistence.CrudRequest
getContentType, getIntegrationItem, getIntegrationKey, getODataEntry, getRequestUri, getServiceRoot, setContentType, setIntegrationItem, setIntegrationKey, setODataEntry, setRequestUri, setServiceRoot
-
Methods inherited from class de.hybris.platform.odata2services.odata.persistence.AbstractRequest
getAcceptLocale, getEntitySet, getEntitySetReferencedByProperty, getEntityType, getIntegrationObjectCode, getPropertyTypeName, setAcceptLocale, setEntitySet, setEntityType, setIntegrationObjectCode
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.inboundservices.persistence.PersistenceContext
getIntegrationItem
-
-
-
-
Method Detail
-
storageRequestBuilder
public static StorageRequest.StorageRequestBuilder storageRequestBuilder()
-
getPrePersistHook
public java.lang.String getPrePersistHook()
-
getPostPersistHook
public java.lang.String getPostPersistHook()
-
setPostPersistHook
protected void setPostPersistHook(java.lang.String postPersistHook)
-
setPrePersistHook
protected void setPrePersistHook(java.lang.String prePersistHook)
-
toLookupRequest
public ItemLookupRequest toLookupRequest() throws org.apache.olingo.odata2.api.edm.EdmException
Creates anItemLookupRequestfrom thisStorageRequest- Returns:
- the newly constructed ItemLookupRequest
- Throws:
org.apache.olingo.odata2.api.edm.EdmException- if encounters an OData problem
-
getContentLocale
public java.util.Locale getContentLocale()
Description copied from interface:PersistenceContextIndicates the language, in which localized attributes content is provided.- Specified by:
getContentLocalein interfacePersistenceContext- Returns:
Localeornull
-
setContentLocale
protected void setContentLocale(java.util.Locale contentLocale)
-
getContextItem
public java.util.Optional<ItemModel> getContextItem() throws org.apache.olingo.odata2.api.edm.EdmException
- Throws:
org.apache.olingo.odata2.api.edm.EdmException
-
putItem
public void putItem(ItemModel item) throws org.apache.olingo.odata2.api.edm.EdmException
- Throws:
org.apache.olingo.odata2.api.edm.EdmException
-
getReferencedContext
public PersistenceContext getReferencedContext(TypeAttributeDescriptor attribute)
Description copied from interface:PersistenceContextRetrieves the persistence context for an item referenced by the specified attribute- Specified by:
getReferencedContextin interfacePersistenceContext- Parameters:
attribute- specifies referenced item- Returns:
- the context containing information about the referenced item
-
getReferencedContexts
public java.util.Collection<PersistenceContext> getReferencedContexts(TypeAttributeDescriptor attribute)
Description copied from interface:PersistenceContextRetrieves the persistence contexts for the items referenced by the specified attribute- Specified by:
getReferencedContextsin interfacePersistenceContext- Parameters:
attribute- specifies referenced items- Returns:
- the context containing information about the referenced items
-
isReplaceAttributes
public boolean isReplaceAttributes()
Description copied from interface:PersistenceContextIndicates the persistence is to replace the item attributes with what's provided in theIntegrationItem. This is primarily applicable to collections. The default behavior is to append to the collection. With this method being true, the item's collection attribute will be replaced instead of appended.- Specified by:
isReplaceAttributesin interfacePersistenceContext- Returns:
- true means to replace attributes, otherwise false.
-
isItemCanBeCreated
public boolean isItemCanBeCreated()
Description copied from interface:PersistenceContextDetermines whether a new item model can be created for the context payload.- Specified by:
isItemCanBeCreatedin interfacePersistenceContext- Returns:
true, when new item can be create, if an item matching the context was not found in the persistent storage;false, if the context implies update only and therefore the item should not be created, if it does not exist yet.
-
getSourceContext
public java.util.Optional<PersistenceContext> getSourceContext()
Description copied from interface:PersistenceContextRetrieves the persistence context that the referenced context was gotten from- Specified by:
getSourceContextin interfacePersistenceContext- Returns:
- the source context. If the context is already the source, Optional.empty is returned
-
getRootContext
public PersistenceContext getRootContext()
Description copied from interface:PersistenceContextRetrieves the top most persistence context- Specified by:
getRootContextin interfacePersistenceContext- Returns:
- the root context
-
-