Class IntegrationObjectRemoveInterceptor
- java.lang.Object
-
- de.hybris.platform.integrationservices.interceptor.IntegrationObjectRemoveInterceptor
-
- All Implemented Interfaces:
Interceptor,RemoveInterceptor<IntegrationObjectModel>
public class IntegrationObjectRemoveInterceptor extends java.lang.Object implements RemoveInterceptor<IntegrationObjectModel>
Interceptor that preventsIntegrationObjectModelfrom being deleted if items of a certain type reference the Integration Object. If a user wants to prevent an Integration Object from being deleted when it is referenced by a certain type, implement theBeforeRemoveIntegrationObjectCheckerfor that type. Then add the implementation to the list in the spring configuration. For example<bean depends-on="beforeRemoveIntegrationObjectCheckers" parent="listMergeDirective"> <property name="add" ref = "noOutboundChannelConfigBeforeRemoveIOChecker"/> </bean>This interceptor calls
BeforeRemoveIntegrationObjectChecker.checkIfIntegrationObjectInUse(de.hybris.platform.integrationservices.model.IntegrationObjectModel)of the checkers in the list. It will fail fast, meaning, it will stop at the first checker that throws theInterceptorException.
-
-
Constructor Summary
Constructors Constructor Description IntegrationObjectRemoveInterceptor(@NotNull java.util.List<BeforeRemoveIntegrationObjectChecker> beforeRemoveIntegrationObjectCheckers)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonRemove(IntegrationObjectModel integrationObject, InterceptorContext ctx)Called in themodelService.removeAll()method.
-
-
-
Constructor Detail
-
IntegrationObjectRemoveInterceptor
public IntegrationObjectRemoveInterceptor(@NotNull @NotNull java.util.List<BeforeRemoveIntegrationObjectChecker> beforeRemoveIntegrationObjectCheckers)Constructor- Parameters:
beforeRemoveIntegrationObjectCheckers- a list of typed checkers which check if there are any items of that type (eg. InboundChannelConfiguration , OutboundChannelConfiguration, WebhookConfiguration) that reference an Integration Object before removal.
-
-
Method Detail
-
onRemove
public void onRemove(IntegrationObjectModel integrationObject, InterceptorContext ctx) throws InterceptorException
Description copied from interface:RemoveInterceptorCalled in themodelService.removeAll()method.- Specified by:
onRemovein interfaceRemoveInterceptor<IntegrationObjectModel>- Parameters:
integrationObject- the model which should be removedctx- theInterceptorContext- Throws:
InterceptorException- if the remove reports an error
-
-