Class KymaDestinationTargetCloningStrategy
- java.lang.Object
-
- de.hybris.platform.kymaintegrationservices.strategies.impl.KymaDestinationTargetCloningStrategy
-
- All Implemented Interfaces:
DestinationTargetCloningStrategy
public class KymaDestinationTargetCloningStrategy extends java.lang.Object implements DestinationTargetCloningStrategy
Kyma specific implementation ofDestinationTargetCloningStrategy
-
-
Constructor Summary
Constructors Constructor Description KymaDestinationTargetCloningStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ExposedOAuthCredentialModelcreateCredential(java.lang.String clientId)voidcreateDestinations(DestinationTargetModel source, DestinationTargetModel target, java.util.List<AbstractDestinationModel> destinations)Create destinations for the target destination.DestinationTargetModelcreateDestinationTarget(DestinationTargetModel source, java.lang.String newId)Create a new destination target from the template destination target with the given idvoidcreateEventConfigurations(DestinationTargetModel source, DestinationTargetModel target, java.util.List<EventConfigurationModel> eventConfigurations)Create event configurations for the target destination.voiddeleteDestinationTarget(DestinationTargetModel destinationTarget)Delete destination target and all related objects of it such as destinations, event configurations.protected java.lang.StringgenerateRandomCode()protected java.util.Set<java.lang.String>getAuthorities()protected java.util.Set<java.lang.String>getAuthorizationGrantTypes()protected CronJobServicegetCronJobService()protected DestinationService<AbstractDestinationModel>getDestinationService()protected java.util.List<DestinationTargetCloningValidationCheckStrategy>getDestinationTargetCloningValidationChecker()protected EventConfigurationDaogetEventConfigurationDao()protected ModelServicegetModelService()protected java.util.Set<java.lang.String>getScopes()protected booleanisCredentialUsedByDifferentExposedDestination(AbstractDestinationModel destination, AbstractCredentialModel credential)Verify if credential is used by different exposed destinationprotected booleanisResetExposedDestinationKymaCredentialAllowed(AbstractDestinationModel destination)Verify if the cloned exposed destination should be assigned a new credentailprotected voidremoveGetInfoCronJob(DestinationTargetModel destinationTarget)voidsetCronJobService(CronJobService cronJobService)voidsetDestinationService(DestinationService<AbstractDestinationModel> destinationService)voidsetDestinationTargetCloningValidationChecker(java.util.List<DestinationTargetCloningValidationCheckStrategy> destinationTargetCloningValidationChecker)voidsetEventConfigurationDao(EventConfigurationDao eventConfigurationDao)voidsetModelService(ModelService modelService)protected voidsetPasswordForCredentials(OAuthClientDetailsModel oAuthClientDetails, ExposedOAuthCredentialModel exposedOAuthCredential)
-
-
-
Method Detail
-
createDestinationTarget
public DestinationTargetModel createDestinationTarget(DestinationTargetModel source, java.lang.String newId)
Description copied from interface:DestinationTargetCloningStrategyCreate a new destination target from the template destination target with the given id- Specified by:
createDestinationTargetin interfaceDestinationTargetCloningStrategy- Parameters:
source- the destination target which is used as a templatenewId- the id of the new destination target- Returns:
- a destination target
-
createDestinations
public void createDestinations(DestinationTargetModel source, DestinationTargetModel target, java.util.List<AbstractDestinationModel> destinations)
Description copied from interface:DestinationTargetCloningStrategyCreate destinations for the target destination. Use destinations list to create new destinations unless it is empty, otherwise, use destination of the source destination target as a template for creating new destinations- Specified by:
createDestinationsin interfaceDestinationTargetCloningStrategy- Parameters:
source- the destination target which is used to create destinationstarget- the destination target which owns the new destinationsdestinations- the list of destinations
-
createEventConfigurations
public void createEventConfigurations(DestinationTargetModel source, DestinationTargetModel target, java.util.List<EventConfigurationModel> eventConfigurations)
Description copied from interface:DestinationTargetCloningStrategyCreate event configurations for the target destination. Use eventConfigurations list to create new event configurations unless it is empty, otherwise, use event configurations of the source destination target as a template for creating new event configurations.- Specified by:
createEventConfigurationsin interfaceDestinationTargetCloningStrategy- Parameters:
source- the destination target which is used to create event configurationstarget- the destination target which owns the new event configurationseventConfigurations- the list of event configurations
-
deleteDestinationTarget
public void deleteDestinationTarget(DestinationTargetModel destinationTarget)
Description copied from interface:DestinationTargetCloningStrategyDelete destination target and all related objects of it such as destinations, event configurations.- Specified by:
deleteDestinationTargetin interfaceDestinationTargetCloningStrategy- Parameters:
destinationTarget- the destinations target
-
removeGetInfoCronJob
protected void removeGetInfoCronJob(DestinationTargetModel destinationTarget)
-
createCredential
protected ExposedOAuthCredentialModel createCredential(java.lang.String clientId)
-
isResetExposedDestinationKymaCredentialAllowed
protected boolean isResetExposedDestinationKymaCredentialAllowed(AbstractDestinationModel destination)
Verify if the cloned exposed destination should be assigned a new credentail- Parameters:
destination-- Returns:
- true if Exposed destination was not assigned ICC
-
isCredentialUsedByDifferentExposedDestination
protected boolean isCredentialUsedByDifferentExposedDestination(AbstractDestinationModel destination, AbstractCredentialModel credential)
Verify if credential is used by different exposed destination- Parameters:
destination-credential-- Returns:
- true if is used by different exposed destination and assigned ICC
-
setPasswordForCredentials
protected void setPasswordForCredentials(OAuthClientDetailsModel oAuthClientDetails, ExposedOAuthCredentialModel exposedOAuthCredential)
-
generateRandomCode
protected java.lang.String generateRandomCode()
-
getScopes
protected java.util.Set<java.lang.String> getScopes()
-
getAuthorizationGrantTypes
protected java.util.Set<java.lang.String> getAuthorizationGrantTypes()
-
getAuthorities
protected java.util.Set<java.lang.String> getAuthorities()
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getDestinationService
protected DestinationService<AbstractDestinationModel> getDestinationService()
-
setDestinationService
public void setDestinationService(DestinationService<AbstractDestinationModel> destinationService)
-
getEventConfigurationDao
protected EventConfigurationDao getEventConfigurationDao()
-
setEventConfigurationDao
public void setEventConfigurationDao(EventConfigurationDao eventConfigurationDao)
-
getCronJobService
protected CronJobService getCronJobService()
-
setCronJobService
public void setCronJobService(CronJobService cronJobService)
-
getDestinationTargetCloningValidationChecker
protected java.util.List<DestinationTargetCloningValidationCheckStrategy> getDestinationTargetCloningValidationChecker()
-
setDestinationTargetCloningValidationChecker
public void setDestinationTargetCloningValidationChecker(java.util.List<DestinationTargetCloningValidationCheckStrategy> destinationTargetCloningValidationChecker)
-
-