Class B2BCustomerPunchOutCredentialMappingValidateInterceptor
java.lang.Object
de.hybris.platform.b2b.punchout.interceptor.B2BCustomerPunchOutCredentialMappingValidateInterceptor
- All Implemented Interfaces:
Interceptor,ValidateInterceptor
public class B2BCustomerPunchOutCredentialMappingValidateInterceptor
extends Object
implements ValidateInterceptor
Validator for entity
B2BCustomerPunchOutCredentialMapping.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected B2BCustomerService<B2BCustomerModel,B2BUnitModel> protected L10NServiceprotected PunchOutCredentialServiceprotected voidChecks if there are credentials in the mapping.protected voidChecks if the credentials in the mapping are not already set to another mapping.protected voidChecks if the B2B Customer on the mapping exists on the system.protected StringlocalizeForKey(String key) voidonValidate(Object model, InterceptorContext ctx) Called in themodelService.saveAll()method.voidsetCustomerService(B2BCustomerService<B2BCustomerModel, B2BUnitModel> customerService) voidsetL10NService(L10NService l10NService) voidsetPunchOutCredentialService(PunchOutCredentialService punchOutCredentialService)
-
Constructor Details
-
B2BCustomerPunchOutCredentialMappingValidateInterceptor
public B2BCustomerPunchOutCredentialMappingValidateInterceptor()
-
-
Method Details
-
onValidate
Description copied from interface:ValidateInterceptorCalled in themodelService.saveAll()method. Validates the values of the given model.- Specified by:
onValidatein interfaceValidateInterceptor- Parameters:
model- the model which values has to be validatedctx- theInterceptorContext- Throws:
InterceptorException- if any values of the model are not valid.
-
isCustomerExistent
protected void isCustomerExistent(B2BCustomerPunchOutCredentialMappingModel mapping) throws InterceptorException Checks if the B2B Customer on the mapping exists on the system.- Parameters:
mapping- The mapping that contains the customer.- Throws:
InterceptorException- If B2B Customer does not exists.
-
hasCredentials
protected void hasCredentials(B2BCustomerPunchOutCredentialMappingModel mapping) throws InterceptorException Checks if there are credentials in the mapping.- Parameters:
mapping- The mapping that should contain a set of credentials.- Throws:
InterceptorException- If the mapping does not contain any credentials.
-
isCredentialAlreadyExistent
protected void isCredentialAlreadyExistent(B2BCustomerPunchOutCredentialMappingModel mapping) throws InterceptorException Checks if the credentials in the mapping are not already set to another mapping.- Parameters:
mapping- The current mapping to be verified.- Throws:
InterceptorException- If at least one of the credentials on the mapping is already in use by another mapping.
-
localizeForKey
-
getL10NService
-
setL10NService
-
getPunchOutCredentialService
-
setPunchOutCredentialService
-
getCustomerService
-
setCustomerService
-