Class DefaultModelServiceInterceptorContext
java.lang.Object
de.hybris.platform.servicelayer.internal.model.impl.DefaultModelServiceInterceptorContext
- All Implemented Interfaces:
InterceptorContext
Default implementation of the
InterceptorContext.-
Nested Class Summary
Nested classes/interfaces inherited from interface de.hybris.platform.servicelayer.interceptor.InterceptorContext
InterceptorContext.TransientStorage -
Constructor Summary
ConstructorsConstructorDescriptionDefaultModelServiceInterceptorContext(DefaultModelService parent, PersistenceOperation defaultPersistenceOperation, Collection<? extends Object> initialElements, ModelWrapperContext wrapperContext) DefaultModelServiceInterceptorContext(DefaultModelService parent, Collection<Object> initialElements, ModelWrapperContext wrapperContext) -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated, for removal: This API element is subject to removal in a future version.since agesbooleancontains(Object model, PersistenceOperation operation) Checks is the given model is already registered in this InterceptorContext with the given operation.elementsRegisteredFor(PersistenceOperation operation) booleangetAttribute(String key) getDirtyAttributes(Object model) Returns a map with all modified attribute qualifiers for the given model.getElementsRegisteredFor(PersistenceOperation operation) Deprecated, for removal: This API element is subject to removal in a future version.since agesReturns theInterceptorContext.TransientStoragewhich can be used to share attributes among all interceptors involved in theModelServiceoperation.booleanisAlreadyNotified(Object model) booleanisModified(Object model) booleanisModified(Object model, String attribute) booleanTells if the model has been created and has not been saved yet.booleanvoidmarkAsNotified(Object model) voidregisterElement(Object model) Register the givenmodelto this InterceptorContext using the InterceptorContext's default operation.voidregisterElement(Object model, Object source) Register the givenmodelto this InterceptorContext using the InterceptorContext's default operation.voidregisterElementFor(Object model, PersistenceOperation operation) Register the givenmodelto this InterceptorContext using the given operation.voidregisterWrappedElementsFor(Collection<ModelWrapper> wrappers, PersistenceOperation operation) voidschedule(ModelWrapper wrapper) voidsetAttribute(String key, Object value) wrap(Collection<? extends Object> models, PersistenceOperation operation)
-
Constructor Details
-
DefaultModelServiceInterceptorContext
public DefaultModelServiceInterceptorContext(DefaultModelService parent, PersistenceOperation defaultPersistenceOperation, Collection<? extends Object> initialElements, ModelWrapperContext wrapperContext) -
DefaultModelServiceInterceptorContext
public DefaultModelServiceInterceptorContext(DefaultModelService parent, Collection<Object> initialElements, ModelWrapperContext wrapperContext)
-
-
Method Details
-
registerElement
Description copied from interface:InterceptorContextRegister the givenmodelto this InterceptorContext using the InterceptorContext's default operation.- Specified by:
registerElementin interfaceInterceptorContext- Parameters:
model- the model to be registered.source- the source of the model (optional)
-
registerElement
Description copied from interface:InterceptorContextRegister the givenmodelto this InterceptorContext using the InterceptorContext's default operation.- Specified by:
registerElementin interfaceInterceptorContext- Parameters:
model- the model to be registered.
-
registerElementFor
Description copied from interface:InterceptorContextRegister the givenmodelto this InterceptorContext using the given operation.- Specified by:
registerElementForin interfaceInterceptorContext- Parameters:
model- the model to be registered.operation- the operation to be performed with the given model
-
elementsRegisteredFor
-
getAllRegisteredElements
- Specified by:
getAllRegisteredElementsin interfaceInterceptorContext- Returns:
- unmodifiable set of models registered using the default operation
-
getElementsRegisteredFor
- Specified by:
getElementsRegisteredForin interfaceInterceptorContext- Returns:
- unmodifiable set of models registered for the given operation
-
contains
Deprecated, for removal: This API element is subject to removal in a future version.since agesDescription copied from interface:InterceptorContextChecks is the given model is already registered in this InterceptorContext with the default operation.- Specified by:
containsin interfaceInterceptorContext- Parameters:
model- model instance to be searched for- Returns:
- true if context interceptor contains model
-
contains
Description copied from interface:InterceptorContextChecks is the given model is already registered in this InterceptorContext with the given operation.- Specified by:
containsin interfaceInterceptorContext- Parameters:
model- model instance to be searched foroperation- the operation to be searched for- Returns:
- true if context interceptor contains model
-
getSource
Deprecated, for removal: This API element is subject to removal in a future version.since ages- Specified by:
getSourcein interfaceInterceptorContext- Parameters:
model- passed in- Returns:
- source for model 'cached' into context instance, see also
DefaultModelService.get(Object)
-
isNew
Description copied from interface:InterceptorContextTells if the model has been created and has not been saved yet.- Specified by:
isNewin interfaceInterceptorContext- Parameters:
model- model instance to be searched for- Returns:
- result of the
ModelConverter.isNew(Object)for registered model converter for passed model
-
exists
- Specified by:
existsin interfaceInterceptorContext- Parameters:
model- model instance to be searched for- Returns:
- result of the
ModelConverter.exists(Object)for registered model converter for passed model
-
isModified
- Specified by:
isModifiedin interfaceInterceptorContext- Parameters:
model- model instance to be searched for- Returns:
- result of the
ModelConverter.isModified(Object)for registered model converter for passed model
-
isModified
- Specified by:
isModifiedin interfaceInterceptorContext- Parameters:
model- model instance to be searched forattribute- attribute name to be searched for- Returns:
- result of the
ModelConverter.isModified(Object, String)for registered model converter for passed model , attribute
-
isRemoved
- Specified by:
isRemovedin interfaceInterceptorContext- Parameters:
model- model instance to be searched for- Returns:
- result of the
ModelConverter.isRemoved(Object)for registered model converter for passed model
-
getModelService
- Specified by:
getModelServicein interfaceInterceptorContext- Returns:
- model service instance for context instance
-
getAttribute
- Specified by:
getAttributein interfaceInterceptorContext- Parameters:
key- attribute name- Returns:
- attribute for key
-
setAttribute
- Specified by:
setAttributein interfaceInterceptorContext- Parameters:
key- attribute namevalue- attribute passed into context
-
getDirtyAttributes
Description copied from interface:InterceptorContextReturns a map with all modified attribute qualifiers for the given model. The keys are all localized and non-localized attribute qualifier which were modified. If the map value isnullthe key is a non-localized attribute qualifier else the map value contains the locale in which language the localized attribute was modified.- Specified by:
getDirtyAttributesin interfaceInterceptorContext- Parameters:
model- the new (not saved) model- Returns:
- a map with all modified attribute qualifier.
-
getTransientStorage
Description copied from interface:InterceptorContextReturns theInterceptorContext.TransientStoragewhich can be used to share attributes among all interceptors involved in theModelServiceoperation.- Specified by:
getTransientStoragein interfaceInterceptorContext- Returns:
- a storage attached to this
InterceptorContext
-
registerWrappedElementsFor
public void registerWrappedElementsFor(Collection<ModelWrapper> wrappers, PersistenceOperation operation) -
createSnapshot
-
getInitialElements
-
markAsNotified
-
isAlreadyNotified
-
getInitialWrappers
-
schedule
-
getSchedule
-
wrap
public Collection<ModelWrapper> wrap(Collection<? extends Object> models, PersistenceOperation operation) -
getWrapperRegistry
-