File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
crud/src/main/java/com/redhat/lightblue/hooks Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,23 @@ public void clear() {
130
130
queuedHooks .clear ();
131
131
}
132
132
133
+ /**
134
+ * Returns true if there are any hooks for this operation
135
+ */
136
+ public boolean hasHooks (CRUDOperationContext ctx ,CRUDOperation op ) {
137
+ EntityMetadata md = ctx .getEntityMetadata (ctx .getEntityName ());
138
+ List <Hook > mdHooks = md .getHooks ().getHooks ();
139
+ for (Hook h : mdHooks ) {
140
+ switch (op ) {
141
+ case INSERT : if (h .isInsert ()) return true ;
142
+ case UPDATE : if (h .isUpdate ()) return true ;
143
+ case DELETE : if (h .isDelete ()) return true ;
144
+ case FIND : if (h .isFind ()) return true ;
145
+ }
146
+ }
147
+ return false ;
148
+ }
149
+
133
150
/**
134
151
* Queues hooks for the operation represented by the operation context.
135
152
*
You can’t perform that action at this time.
0 commit comments