Created
July 4, 2021 07:33
-
-
Save sreeni-b/896774e297d3c53ad0f4ca39c820c158 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.aemks.core.jobs; | |
import org.apache.sling.event.jobs.Job; | |
import org.apache.sling.event.jobs.consumer.JobConsumer; | |
import org.osgi.service.component.annotations.Component; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
@Component( | |
service = JobConsumer.class, | |
immediate = true, | |
property = { JobConsumer.PROPERTY_TOPICS + "=com/aemks/core/jobs/handleCopyPasteEvent" }) | |
public class CopyPasteEventHandlerJob implements JobConsumer { | |
private final Logger logger = LoggerFactory.getLogger(getClass()); | |
@Override public JobResult process(Job job) { | |
String eventPath = job.getProperty("eventPath", String.class); | |
logger.info("Handling event for path {}",eventPath); | |
/* | |
* Do all your processing or handling here | |
* (Eg: removing the synced metadata like reference ID or Offer ID) | |
*/ | |
return JobResult.OK; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment