App Engine Python SDK version 1.7.4 (2)
[gae.git] / java / src / main / com / google / appengine / api / taskqueue / DatastoreDeleteDeferredTask.java
blob14f9d812dfa9350283b70f7526c22a3a97761310
1 // Copyright 2012 Google Inc. All Rights Reserved.
2 package com.google.appengine.api.taskqueue;
4 import com.google.appengine.api.datastore.DatastoreServiceFactory;
5 import com.google.appengine.api.datastore.Key;
7 /**
8 * A {@link DeferredTask} implementation that deletes the entities uniquely
9 * identified by the provided {@link Key Keys} when it runs.
12 class DatastoreDeleteDeferredTask implements DeferredTask {
13 private final Key deleteMe;
15 public DatastoreDeleteDeferredTask(Key deleteMe) {
16 if (deleteMe == null) {
17 throw new NullPointerException("deleteMe cannot be null");
19 this.deleteMe = deleteMe;
22 @Override
23 public void run() {
24 DatastoreServiceFactory.getDatastoreService().delete(deleteMe);