Class KymaUpdateConsumedDestinationsJobPerformable
- java.lang.Object
-
- de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable<CronJobModel>
-
- de.hybris.platform.kymaintegrationservices.jobs.KymaUpdateConsumedDestinationsJobPerformable
-
- All Implemented Interfaces:
JobPerformable<CronJobModel>
public class KymaUpdateConsumedDestinationsJobPerformable extends AbstractJobPerformable<CronJobModel>
A job responsible for updating consumed destinations of a destination target and registration of exposed destinations
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CRONJOB_LIFESPAN_PROP_KEY
static int
DEFAULT_CRONJOB_LIFESPAN
-
Fields inherited from class de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable
flexibleSearchService, modelService, sessionService
-
-
Constructor Summary
Constructors Constructor Description KymaUpdateConsumedDestinationsJobPerformable()
-
Method Summary
-
Methods inherited from class de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable
clearAbortRequestedIfNeeded, isPerformable, setFlexibleSearchService, setModelService, setSessionService
-
-
-
-
Field Detail
-
CRONJOB_LIFESPAN_PROP_KEY
public static final java.lang.String CRONJOB_LIFESPAN_PROP_KEY
- See Also:
- Constant Field Values
-
DEFAULT_CRONJOB_LIFESPAN
public static final int DEFAULT_CRONJOB_LIFESPAN
- See Also:
- Constant Field Values
-
-
Method Detail
-
perform
public PerformResult perform(CronJobModel cronJob)
Description copied from interface:JobPerformable
The execution body for aServicelayerJob
. Implement here your execution logic. It can be called synchronous or asynchronous. So be aware of thread-safety. Method will return a result object saying if the execution has reached end and if it was successful.- Specified by:
perform
in interfaceJobPerformable<CronJobModel>
- Specified by:
perform
in classAbstractJobPerformable<CronJobModel>
- Parameters:
cronJob
- the related CronJob in whose context the execution will be performed.- Returns:
- a
PerformResult
that indicates whether theexecution
was successfully executed or not and has finished or not.
-
isAbortable
public boolean isAbortable()
Description copied from interface:JobPerformable
Checks whether the execution is implemented abortable.- Specified by:
isAbortable
in interfaceJobPerformable<CronJobModel>
- Overrides:
isAbortable
in classAbstractJobPerformable<CronJobModel>
- Returns:
- true if the execution can be aborted
-
validateInfoData
protected boolean validateInfoData(KymaInfoData infoData)
-
validateInfoUrls
protected boolean validateInfoUrls(KymaServicesUrls urls)
-
updateDestinationTargetRegistrationStatus
protected void updateDestinationTargetRegistrationStatus(DestinationTargetModel destinationTarget, RegistrationStatus status)
-
updateConsumedDestinations
protected void updateConsumedDestinations(DestinationTargetModel destinationTarget, KymaServicesUrls urls) throws ApiRegistrationException
- Throws:
ApiRegistrationException
-
registerExposedDestinations
protected void registerExposedDestinations(DestinationTargetModel destinationTarget) throws ApiRegistrationException
- Throws:
ApiRegistrationException
-
validateConsumedDestinations
protected void validateConsumedDestinations(KymaServicesUrls urls, DestinationTargetModel destinationTarget) throws ApiRegistrationException
- Throws:
ApiRegistrationException
-
getConsumedDestination
protected ConsumedDestinationModel getConsumedDestination(DestinationTargetModel destinationTarget, java.lang.String serviceId)
-
needUpdateConsumedDestinations
protected boolean needUpdateConsumedDestinations(KymaServicesUrls urls, DestinationTargetModel destinationTarget)
-
updateConsumedDestination
protected void updateConsumedDestination(ConsumedDestinationModel consumedDestination, java.lang.String destinationUrl)
-
getDestinationTargetService
protected DestinationTargetService getDestinationTargetService()
-
setDestinationTargetService
public void setDestinationTargetService(DestinationTargetService destinationTargetService)
-
getDestinationService
protected DestinationService<AbstractDestinationModel> getDestinationService()
-
setDestinationService
public void setDestinationService(DestinationService<AbstractDestinationModel> destinationService)
-
getModelService
protected ModelService getModelService()
-
getRestTemplate
protected RestTemplateWrapper getRestTemplate()
-
setRestTemplate
public void setRestTemplate(RestTemplateWrapper restTemplate)
-
-