@@ -0,0 +1,1171 @@
+package com.codingbrothers.futurimages.service.impl;%0D%0A%0D%0Aimport javax.inject.Inject;%0D%0Aimport javax.inject.Named;%0D%0A%0D%0Aimport com.codingbrothers.futurimages.domain.Image;%0D%0Aimport com.codingbrothers.futurimages.util.Utils;%0D%0Aimport com.google.appengine.api.taskqueue.DeferredTask;%0D%0Aimport com.google.appengine.api.taskqueue.Queue;%0D%0Aimport com.google.appengine.api.taskqueue.TaskOptions;%0D%0Aimport com.googlecode.objectify.Key;%0D%0Aimport com.googlecode.objectify.ObjectifyService;%0D%0A%0D%0Apublic class DeferredImageDataUploader implements ImageDataUploader %7B%0D%0A%0D%0A%09private final Queue queue;%0D%0A%0D%0A%09@Inject%0D%0A%09DeferredImageDataUploader(@Named(%22ImageDataUploader%22) Queue queue) %7B%0D%0A%09%09this.queue = queue;%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public void uploadData(Image image, com.google.appengine.api.images.Image imageData) %7B%0D%0A%09%09queue.add(ObjectifyService.ofy().getTransaction(),%0D%0A%09%09%09%09TaskOptions.Builder.withPayload(createUploadTask(image, imageData)));%0D%0A%09%7D%0D%0A%0D%0A%09protected DeferredTask createUploadTask(Image image, com.google.appengine.api.images.Image imageData) %7B%0D%0A%09%09return new ImageDataUploaderTask(Key.create(image), Utils.getImageMediaType(imageData.getFormat()),%0D%0A%09%09%09%09imageData.getImageData());%0D%0A%09%7D%0D%0A%7D%0D%0A

Create deferred image data uploading strategy