01: //$Id: ReplicateEvent.java 6929 2005-05-27 03:54:08Z oneovthafew $
02: package org.hibernate.event;
03:
04: import org.hibernate.ReplicationMode;
05:
06: /**
07: * Defines an event class for the replication of an entity.
08: *
09: * @author Steve Ebersole
10: */
11: public class ReplicateEvent extends AbstractEvent {
12:
13: private Object object;
14: private ReplicationMode replicationMode;
15: private String entityName;
16:
17: public ReplicateEvent(Object object,
18: ReplicationMode replicationMode, EventSource source) {
19: this (null, object, replicationMode, source);
20: }
21:
22: public ReplicateEvent(String entityName, Object object,
23: ReplicationMode replicationMode, EventSource source) {
24: super (source);
25: this .entityName = entityName;
26:
27: if (object == null) {
28: throw new IllegalArgumentException(
29: "attempt to create replication strategy with null entity");
30: }
31: if (replicationMode == null) {
32: throw new IllegalArgumentException(
33: "attempt to create replication strategy with null replication mode");
34: }
35:
36: this .object = object;
37: this .replicationMode = replicationMode;
38: }
39:
40: public Object getObject() {
41: return object;
42: }
43:
44: public void setObject(Object object) {
45: this .object = object;
46: }
47:
48: public ReplicationMode getReplicationMode() {
49: return replicationMode;
50: }
51:
52: public void setReplicationMode(ReplicationMode replicationMode) {
53: this .replicationMode = replicationMode;
54: }
55:
56: public String getEntityName() {
57: return entityName;
58: }
59:
60: public void setEntityName(String entityName) {
61: this.entityName = entityName;
62: }
63: }
|