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 void
createDestinations(DestinationTargetModel source, DestinationTargetModel target, java.util.List<AbstractDestinationModel> destinations)
Create destinations for the target destination.DestinationTargetModel
createDestinationTarget(DestinationTargetModel source, java.lang.String newId, DestinationChannel destinationChannel)
Create a new destination target from the template destination target with the given idvoid
createEventConfigurations(DestinationTargetModel source, DestinationTargetModel target, java.util.List<EventConfigurationModel> eventConfigurations)
Create event configurations for the target destination.void
deleteDestinationTarget(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 ApiRegistrationService
getApiRegistrationService()
protected DestinationService<AbstractDestinationModel>
getDestinationService()
DestinationTargetModel
getDestinationTargetByCredentialId(java.lang.String credentialId)
Get the destination target for a specific credential idDestinationTargetModel
getDestinationTargetById(java.lang.String id)
Get the destination target for a specific idprotected DestinationTargetCloningStrategy
getDestinationTargetCloningStrategy(DestinationChannel destinationChannel)
protected java.util.Map<DestinationChannel,DestinationTargetCloningStrategy>
getDestinationTargetCloningStrategyMap()
protected DestinationTargetDao
getDestinationTargetDao()
protected DestinationTargetRegistrationStrategy
getDestinationTargetRegistrationStrategy(DestinationChannel destinationChannel)
protected java.util.Map<DestinationChannel,DestinationTargetRegistrationStrategy>
getDestinationTargetRegistrationStrategyMap()
void
registerDestinationTarget(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.void
setApiRegistrationService(ApiRegistrationService apiRegistrationService)
void
setDestinationService(DestinationService<AbstractDestinationModel> destinationService)
void
setDestinationTargetCloningStrategyMap(java.util.Map<DestinationChannel,DestinationTargetCloningStrategy> destinationTargetCloningStrategyMap)
void
setDestinationTargetDao(DestinationTargetDao destinationTargetDao)
void
setDestinationTargetRegistrationStrategyMap(java.util.Map<DestinationChannel,DestinationTargetRegistrationStrategy> destinationTargetRegistrationStrategyMap)
void
syncDestinationTargetWithRemoteSystem(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:DestinationTargetService
Create a new destination target from the template destination target with the given id- Specified by:
createDestinationTarget
in 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:DestinationTargetService
Register a destination target and its assigned destinations and events in the target system- Specified by:
registerDestinationTarget
in 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:DestinationTargetService
Create destinations for the target destination.- Specified by:
createDestinations
in 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:DestinationTargetService
Create event configurations for the target destination.- Specified by:
createEventConfigurations
in 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:DestinationTargetService
Register all exposed destinations of the given destination target.- Specified by:
registerExposedDestinations
in 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:DestinationTargetService
Unregister (if the destination target is not a template) then delete exposed destinations of the given destination target- Specified by:
deregisterAndDeleteDestinationTarget
in 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:DestinationTargetService
Delete destination target and all related objects of it such as destinations, event configurations.- Specified by:
deleteDestinationTarget
in 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:DestinationTargetService
Sync destination target with the remote system.- Specified by:
syncDestinationTargetWithRemoteSystem
in 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:DestinationTargetService
Get the destination target for a specific credential id- Specified by:
getDestinationTargetByCredentialId
in interfaceDestinationTargetService
- Parameters:
credentialId
- id of the credential- Returns:
- a destination target
-
getDestinationTargetById
public DestinationTargetModel getDestinationTargetById(java.lang.String id)
Description copied from interface:DestinationTargetService
Get the destination target for a specific id- Specified by:
getDestinationTargetById
in 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)
-
-