01: /*
02: * Copyright 2004-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.compass.gps.device.hibernate.lifecycle;
18:
19: import org.hibernate.event.PostDeleteEvent;
20: import org.hibernate.event.PostInsertEvent;
21: import org.hibernate.event.PostUpdateEvent;
22:
23: /**
24: * Allows to hook filtering of object during the mirroring process.
25: *
26: * @author kimchy
27: */
28: public interface HibernateMirrorFilter {
29:
30: /**
31: * Should the post insert hibernate event be filtered or not
32: *
33: * @param postInsertEvent The Hibernate post insert event
34: * @return <code>true</code> if the event should be filtered, <code>false</code> otherwise
35: */
36: boolean shouldFilterInsert(PostInsertEvent postInsertEvent);
37:
38: /**
39: * Should the post update hibernate event be filtered or not
40: *
41: * @param postUpdateEvent The Hibernate post update event
42: * @return <code>true</code> if the event should be filtered, <code>false</code> otherwise
43: */
44: boolean shouldFilterUpdate(PostUpdateEvent postUpdateEvent);
45:
46: /**
47: * Should the post delete hibernate event be filtered or not
48: *
49: * @param postDeleteEvent The Hibernate post delete event
50: * @return <code>true</code> if the event should be filtered, <code>false</code> otherwise
51: */
52: boolean shouldFilterDelete(PostDeleteEvent postDeleteEvent);
53: }
|