Class DefaultDestinationTargetService
- java.lang.Object
-
- de.hybris.platform.apiregistryservices.services.impl.DefaultDestinationTargetService
-
- All Implemented Interfaces:
DestinationTargetService
public class DefaultDestinationTargetService extends java.lang.Object implements DestinationTargetService
Default implementation ofDestinationTargetService
-
-
Constructor Summary
Constructors Constructor Description DefaultDestinationTargetService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateDestinations(DestinationTargetModel source, DestinationTargetModel target, java.util.List<AbstractDestinationModel> destinations)Create destinations for the target destination.DestinationTargetModelcreateDestinationTarget(DestinationTargetModel source, java.lang.String newId, DestinationChannel destinationChannel)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.java.util.Collection<ServiceWarning<DestinationTargetModel>>deregisterAndDeleteDestinationTarget(DestinationTargetModel destinationTarget)Unregister (if the destination target is not a template) then delete exposed destinations of the given destination targetprotected ApiRegistrationServicegetApiRegistrationService()protected DestinationService<AbstractDestinationModel>getDestinationService()DestinationTargetModelgetDestinationTargetByCredentialId(java.lang.String credentialId)Get the destination target for a specific credential idDestinationTargetModelgetDestinationTargetById(java.lang.String id)Get the destination target for a specific idprotected DestinationTargetCloningStrategygetDestinationTargetCloningStrategy(DestinationChannel destinationChannel)protected java.util.Map<DestinationChannel,DestinationTargetCloningStrategy>getDestinationTargetCloningStrategyMap()protected DestinationTargetDaogetDestinationTargetDao()protected DestinationTargetRegistrationStrategygetDestinationTargetRegistrationStrategy(DestinationChannel destinationChannel)protected java.util.Map<DestinationChannel,DestinationTargetRegistrationStrategy>getDestinationTargetRegistrationStrategyMap()voidregisterDestinationTarget(DestinationTargetModel destinationTarget, java.util.Map<java.lang.String,java.lang.String> params)Register a destination target and its assigned destinations and events in the target systemjava.util.Map<java.lang.String,java.lang.String>registerExposedDestinations(DestinationTargetModel destinationTarget)Register all exposed destinations of the given destination target.voidsetApiRegistrationService(ApiRegistrationService apiRegistrationService)voidsetDestinationService(DestinationService<AbstractDestinationModel> destinationService)voidsetDestinationTargetCloningStrategyMap(java.util.Map<DestinationChannel,DestinationTargetCloningStrategy> destinationTargetCloningStrategyMap)voidsetDestinationTargetDao(DestinationTargetDao destinationTargetDao)voidsetDestinationTargetRegistrationStrategyMap(java.util.Map<DestinationChannel,DestinationTargetRegistrationStrategy> destinationTargetRegistrationStrategyMap)voidsyncDestinationTargetWithRemoteSystem(DestinationTargetModel destinationTarget)Sync destination target with the remote system.
-
-
-
Method Detail
-
createDestinationTarget
public DestinationTargetModel createDestinationTarget(DestinationTargetModel source, java.lang.String newId, DestinationChannel destinationChannel) throws ApiRegistrationException
Description copied from interface:DestinationTargetServiceCreate a new destination target from the template destination target with the given id- Specified by:
createDestinationTargetin interfaceDestinationTargetService- Parameters:
source- the destination target which is used as a templatenewId- the id of the new destination targetdestinationChannel- channel of the new destination target- Returns:
- the new destination target
- Throws:
ApiRegistrationException- in case the DestinationTargetCloningStrategy doesn't exist for the given destination target
-
registerDestinationTarget
public void registerDestinationTarget(DestinationTargetModel destinationTarget, java.util.Map<java.lang.String,java.lang.String> params) throws ApiRegistrationException
Description copied from interface:DestinationTargetServiceRegister a destination target and its assigned destinations and events in the target system- Specified by:
registerDestinationTargetin interfaceDestinationTargetService- Parameters:
destinationTarget- the destination targetparams- the parameters map which is used for passing additional parameters- Throws:
ApiRegistrationException- in case the registration fails
-
createDestinations
public void createDestinations(DestinationTargetModel source, DestinationTargetModel target, java.util.List<AbstractDestinationModel> destinations) throws ApiRegistrationException
Description copied from interface:DestinationTargetServiceCreate destinations for the target destination.- Specified by:
createDestinationsin interfaceDestinationTargetService- Parameters:
source- the destination target which is used to create destinationstarget- the destination target which owns the new destinationsdestinations- the list of destinations- Throws:
ApiRegistrationException- in case the DestinationTargetCloningStrategy doesn't exist for the given destination target
-
createEventConfigurations
public void createEventConfigurations(DestinationTargetModel source, DestinationTargetModel target, java.util.List<EventConfigurationModel> eventConfigurations) throws ApiRegistrationException
Description copied from interface:DestinationTargetServiceCreate event configurations for the target destination.- Specified by:
createEventConfigurationsin interfaceDestinationTargetService- 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- Throws:
ApiRegistrationException- in case the DestinationTargetCloningStrategy doesn't exist for the given destination target
-
registerExposedDestinations
public java.util.Map<java.lang.String,java.lang.String> registerExposedDestinations(DestinationTargetModel destinationTarget)
Description copied from interface:DestinationTargetServiceRegister all exposed destinations of the given destination target.- Specified by:
registerExposedDestinationsin interfaceDestinationTargetService- Parameters:
destinationTarget- the destination target of exposed destinations- Returns:
- the map of failed exposed destinations and error messages
-
deregisterAndDeleteDestinationTarget
public java.util.Collection<ServiceWarning<DestinationTargetModel>> deregisterAndDeleteDestinationTarget(DestinationTargetModel destinationTarget) throws ApiRegistrationException
Description copied from interface:DestinationTargetServiceUnregister (if the destination target is not a template) then delete exposed destinations of the given destination target- Specified by:
deregisterAndDeleteDestinationTargetin interfaceDestinationTargetService- Parameters:
destinationTarget- the destination target- Returns:
- the collection of service warnings if any
- Throws:
ApiRegistrationException- in case the deletion fails
-
deleteDestinationTarget
public void deleteDestinationTarget(DestinationTargetModel destinationTarget) throws ApiRegistrationException
Description copied from interface:DestinationTargetServiceDelete destination target and all related objects of it such as destinations, event configurations.- Specified by:
deleteDestinationTargetin interfaceDestinationTargetService- Parameters:
destinationTarget- the destinations target- Throws:
ApiRegistrationException- in case the DestinationTargetCloningStrategy doesn't exist for the given destination target
-
syncDestinationTargetWithRemoteSystem
public void syncDestinationTargetWithRemoteSystem(DestinationTargetModel destinationTarget) throws ApiRegistrationException
Description copied from interface:DestinationTargetServiceSync destination target with the remote system.- Specified by:
syncDestinationTargetWithRemoteSystemin interfaceDestinationTargetService- Parameters:
destinationTarget- the destination target- Throws:
ApiRegistrationException- in case the synchronization fails
-
getDestinationTargetRegistrationStrategy
protected DestinationTargetRegistrationStrategy getDestinationTargetRegistrationStrategy(DestinationChannel destinationChannel)
-
getDestinationTargetCloningStrategy
protected DestinationTargetCloningStrategy getDestinationTargetCloningStrategy(DestinationChannel destinationChannel)
-
getDestinationTargetByCredentialId
public DestinationTargetModel getDestinationTargetByCredentialId(java.lang.String credentialId)
Description copied from interface:DestinationTargetServiceGet the destination target for a specific credential id- Specified by:
getDestinationTargetByCredentialIdin interfaceDestinationTargetService- Parameters:
credentialId- id of the credential- Returns:
- a destination target
-
getDestinationTargetById
public DestinationTargetModel getDestinationTargetById(java.lang.String id)
Description copied from interface:DestinationTargetServiceGet the destination target for a specific id- Specified by:
getDestinationTargetByIdin interfaceDestinationTargetService- Parameters:
id- id of the destination target- Returns:
- a destination target
-
getDestinationTargetCloningStrategyMap
protected java.util.Map<DestinationChannel,DestinationTargetCloningStrategy> getDestinationTargetCloningStrategyMap()
-
setDestinationTargetCloningStrategyMap
public void setDestinationTargetCloningStrategyMap(java.util.Map<DestinationChannel,DestinationTargetCloningStrategy> destinationTargetCloningStrategyMap)
-
getDestinationTargetRegistrationStrategyMap
protected java.util.Map<DestinationChannel,DestinationTargetRegistrationStrategy> getDestinationTargetRegistrationStrategyMap()
-
setDestinationTargetRegistrationStrategyMap
public void setDestinationTargetRegistrationStrategyMap(java.util.Map<DestinationChannel,DestinationTargetRegistrationStrategy> destinationTargetRegistrationStrategyMap)
-
getApiRegistrationService
protected ApiRegistrationService getApiRegistrationService()
-
setApiRegistrationService
public void setApiRegistrationService(ApiRegistrationService apiRegistrationService)
-
getDestinationService
protected DestinationService<AbstractDestinationModel> getDestinationService()
-
setDestinationService
public void setDestinationService(DestinationService<AbstractDestinationModel> destinationService)
-
getDestinationTargetDao
protected DestinationTargetDao getDestinationTargetDao()
-
setDestinationTargetDao
public void setDestinationTargetDao(DestinationTargetDao destinationTargetDao)
-
-