Adobe-Consulting-Services / acs-aem-samples

AEM Code Samples repository
http://adobe-consulting-services.github.io/acs-aem-samples/
Apache License 2.0
207 stars 196 forks source link

Flush Agent #21

Open davidjgonzalez opened 9 years ago

davidjgonzalez commented 9 years ago

@andrewmkhoury any chance you have a sample sitting around?

davidjgonzalez commented 9 years ago

@sham linked out to this .. https://github.com/cqsupport/webinar-dispatchercache/blob/master/src/refetching-flush-agent/jcr_root/apps/replication/src/com.day.cq.replication.dispatcher/src/main/java/com/day/cq/replication/dispatcher/DispatcherFlushContentBuilder.java

andrewmkhoury commented 9 years ago

@davidjgonzalez what exactly are you looking for? You want to implement some custom dispatcher flush functionality or a custom CDN flush agent?

davidjgonzalez commented 9 years ago

@andrewmkhoury samples are more generic "code skeletons" that have a commenting narrative describing what different to method responsibilities are and why/how their used.

Samples don't typically "do" anything -- we could have a specific sample where for an agent that describes calling out to some external service.

andrewmkhoury commented 9 years ago

Ok, I get it now, sorry I don't have a sample of a custom flush agent then. The code that @sham linked to is a example of how to implement a flush ContentBuilder for the re-fetching flush feature of dispatcher. It just adds a request body with POST parameters to the flush request. It is only the "Serialization Type" part of a custom flush implementation. If you want a generic flush agent sample (as a starting point for a custom flush agent that can flush CDN, Dispatcher, Varnish or any other cache technology) you would also need to implement the "skeleton" of a TransportHandler.

davidjgonzalez commented 9 years ago

@andrewmkhoury gotcha! Yeh - i made this item before @Sham sent the link in the CQ Gems; I can take a stab at this; Maybe ill ping you for a quick review to ensure im not explaining anything incorrectly.

Also - thanks for heads up on the Transport Handler!

It sounds like it might make sense to start w a slightly more pointed sample; Ex. CDN Flush Agent; and leave out the CDN specific API calls. (ex. // Call CDN API flush method here)