]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db/src/org/simantics/db/event/ChangeEvent.java
39e3abbaa80de48dd0e95a2519c27df5e78b330b
[simantics/platform.git] / bundles / org.simantics.db / src / org / simantics / db / event / ChangeEvent.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.db.event;
13
14 import org.simantics.db.ChangeSet;
15 import org.simantics.db.MetadataI;
16 import org.simantics.db.ReadGraph;
17 import org.simantics.db.Session;
18 import org.simantics.db.WriteGraph;
19 import org.simantics.db.service.TeamSupport;
20
21 /**
22  * An event structure for {@link ChangeListener}.
23  * 
24  * Informs of incoming changes in a Session, i.e. a completed transaction or an
25  * update external to this Session caused by a synchronize operation using
26  * {@link TeamSupport}.
27  * 
28  * @author Tuukka Lehtonen
29  * @see ChangeListener
30  * @see Session
31  */
32 public class ChangeEvent {
33
34     private final Session   session;
35
36     private final ReadGraph graph;
37     
38     private final WriteGraph metadataGraph;
39
40     private final ChangeSet changes;
41
42     public ChangeEvent(Session session, ReadGraph graph, WriteGraph metadataGraph, ChangeSet changeSet) {
43         this.session = session;
44         this.graph = graph;
45         this.metadataGraph = metadataGraph;
46         this.changes = changeSet;
47     }
48
49     public Session getSession() {
50         return session;
51     }
52
53     public ReadGraph getGraph() {
54         return graph;
55     }
56
57     public ChangeSet getChanges() {
58         return changes;
59     }
60     
61     public MetadataI getMetadataI() {
62         return metadataGraph;
63     }
64     
65
66 }