Revision created by MOE tool push_codebase.
[gae.git] / java / src / main / com / google / appengine / api / datastore / DatastoreCallbacks.java
blobd10d3c480d552e8956d54e395aa79ac711b93fe7
1 // Copyright 2011 Google Inc. All Rights Reserved.
2 package com.google.appengine.api.datastore;
4 /**
5 * Internal interface describing the callback operations we support.
7 */
8 interface DatastoreCallbacks {
10 /**
11 * Runs all PrePut callbacks for the given context.
13 * @param context The callback context
15 void executePrePutCallbacks(PutContext context);
17 /**
18 * Runs all PostPut callbacks for the given context.
20 * @param context The callback context
22 void executePostPutCallbacks(PutContext context);
24 /**
25 * Runs all PreDelete callbacks for the given context.
27 * @param context The callback context
29 void executePreDeleteCallbacks(DeleteContext context);
31 /**
32 * Runs all PostDelete callbacks for the given context.
34 * @param context The callback context
36 void executePostDeleteCallbacks(DeleteContext context);
38 /**
39 * Runs all PreGet callbacks for the given context.
41 * @param context The callback context
43 void executePreGetCallbacks(PreGetContext context);
45 /**
46 * Runs all PostLoad callbacks for the given context.
48 * @param context The callback context
50 void executePostLoadCallbacks(PostLoadContext context);
52 /**
53 * Runs all PreQuery callbacks for the given context.
55 * @param context The callback context
57 void executePreQueryCallbacks(PreQueryContext context);
59 /**
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();
65 @Override
66 public void executePrePutCallbacks(PutContext context) { }
68 @Override
69 public void executePostPutCallbacks(PutContext context) { }
71 @Override
72 public void executePreDeleteCallbacks(DeleteContext context) { }
74 @Override
75 public void executePostDeleteCallbacks(DeleteContext context) { }
77 @Override
78 public void executePreGetCallbacks(PreGetContext context) { }
80 @Override
81 public void executePostLoadCallbacks(PostLoadContext context) { }
83 @Override
84 public void executePreQueryCallbacks(PreQueryContext context) { }