Class B2BCustomerPunchOutCredentialMappingValidateInterceptor
- java.lang.Object
-
- de.hybris.platform.b2b.punchout.interceptor.B2BCustomerPunchOutCredentialMappingValidateInterceptor
-
- All Implemented Interfaces:
Interceptor,ValidateInterceptor
public class B2BCustomerPunchOutCredentialMappingValidateInterceptor extends java.lang.Object implements ValidateInterceptor
Validator for entityB2BCustomerPunchOutCredentialMapping.
-
-
Constructor Summary
Constructors Constructor Description B2BCustomerPunchOutCredentialMappingValidateInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description B2BCustomerService<B2BCustomerModel,B2BUnitModel>getCustomerService()protected L10NServicegetL10NService()PunchOutCredentialServicegetPunchOutCredentialService()protected voidhasCredentials(B2BCustomerPunchOutCredentialMappingModel mapping)Checks if there are credentials in the mapping.protected voidisCredentialAlreadyExistent(B2BCustomerPunchOutCredentialMappingModel mapping)Checks if the credentials in the mapping are not already set to another mapping.protected voidisCustomerExistent(B2BCustomerPunchOutCredentialMappingModel mapping)Checks if the B2B Customer on the mapping exists on the system.protected java.lang.StringlocalizeForKey(java.lang.String key)voidonValidate(java.lang.Object model, InterceptorContext ctx)Called in themodelService.saveAll()method.voidsetCustomerService(B2BCustomerService<B2BCustomerModel,B2BUnitModel> customerService)voidsetL10NService(L10NService l10NService)voidsetPunchOutCredentialService(PunchOutCredentialService punchOutCredentialService)
-
-
-
Method Detail
-
onValidate
public void onValidate(java.lang.Object model, InterceptorContext ctx) throws InterceptorExceptionDescription 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
protected java.lang.String localizeForKey(java.lang.String key)
-
getL10NService
protected L10NService getL10NService()
-
setL10NService
public void setL10NService(L10NService l10NService)
-
getPunchOutCredentialService
public PunchOutCredentialService getPunchOutCredentialService()
-
setPunchOutCredentialService
public void setPunchOutCredentialService(PunchOutCredentialService punchOutCredentialService)
-
getCustomerService
public B2BCustomerService<B2BCustomerModel,B2BUnitModel> getCustomerService()
-
setCustomerService
public void setCustomerService(B2BCustomerService<B2BCustomerModel,B2BUnitModel> customerService)
-
-