1 // Copyright 2011 Google Inc. All Rights Reserved.
2 package com
.google
.appengine
.api
.datastore
;
5 * Internal interface describing the callback operations we support.
8 interface DatastoreCallbacks
{
11 * Runs all PrePut callbacks for the given context.
13 * @param context The callback context
15 void executePrePutCallbacks(PutContext context
);
18 * Runs all PostPut callbacks for the given context.
20 * @param context The callback context
22 void executePostPutCallbacks(PutContext context
);
25 * Runs all PreDelete callbacks for the given context.
27 * @param context The callback context
29 void executePreDeleteCallbacks(DeleteContext context
);
32 * Runs all PostDelete callbacks for the given context.
34 * @param context The callback context
36 void executePostDeleteCallbacks(DeleteContext context
);
39 * Runs all PreGet callbacks for the given context.
41 * @param context The callback context
43 void executePreGetCallbacks(PreGetContext context
);
46 * Runs all PostLoad callbacks for the given context.
48 * @param context The callback context
50 void executePostLoadCallbacks(PostLoadContext context
);
53 * Runs all PreQuery callbacks for the given context.
55 * @param context The callback context
57 void executePreQueryCallbacks(PreQueryContext context
);
60 * Class that provides a no-op implementation of the {@code DatastoreCallbacks} interface.
62 static class NoOpDatastoreCallbacks
implements DatastoreCallbacks
{
63 static final DatastoreCallbacks INSTANCE
= new NoOpDatastoreCallbacks();
66 public void executePrePutCallbacks(PutContext context
) { }
69 public void executePostPutCallbacks(PutContext context
) { }
72 public void executePreDeleteCallbacks(DeleteContext context
) { }
75 public void executePostDeleteCallbacks(DeleteContext context
) { }
78 public void executePreGetCallbacks(PreGetContext context
) { }
81 public void executePostLoadCallbacks(PostLoadContext context
) { }
84 public void executePreQueryCallbacks(PreQueryContext context
) { }