1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.db;
\r
14 import java.util.Collection;
\r
16 import org.simantics.db.event.ChangeEvent;
\r
17 import org.simantics.db.event.ChangeListener;
\r
18 import org.simantics.db.request.Write;
\r
19 import org.simantics.db.request.WriteOnly;
\r
20 import org.simantics.db.service.GraphChangeListenerSupport;
\r
23 * A representation of a set of changes that have been performed into the graph
\r
24 * database using a write request ({@link Write}, {@link WriteOnly}).
\r
27 * The change information is allowed to be inexact in the sense that these
\r
28 * changes may represent what is attempted to commit into the database but some
\r
29 * of the changes may turn out to be null operations in the end: a claimed
\r
30 * statement may have already existed or a denied statement may not exist in the
\r
31 * first place. Hence, a ChangeSet tells what statement changes have possibly
\r
32 * been performed and what resource-bound values have possibly changed.
\r
34 * @author Tuukka Lehtonen
\r
36 * @see GraphChangeListenerSupport
\r
37 * @see ChangeListener
\r
40 public interface ChangeSet {
\r
42 public interface StatementChange extends Statement {
\r
44 * @return <code>true</code> if the statement was claimed,
\r
45 * <code>false</code> if denied.
\r
51 * TODO: specify whether the collection is considered a set or a list
\r
52 * (duplicate statements allowed or not)
\r
54 * The returned collection may be shared internal state of the
\r
55 * implementation and must not be modified by the client.
\r
57 * @return the set of changed statements, each either claimed or denied
\r
59 Collection<StatementChange> changedStatements();
\r
62 * TODO: specify whether the collection is considered a set or a list
\r
63 * (duplicate statements allowed or not)
\r
65 * The returned collection may be shared internal state of the
\r
66 * implementation and must not be modified by the client.
\r
68 * @return the set of changed values, either claimed or denied
\r
70 Collection<Resource> changedValues();
\r
72 Collection<Resource> changedResources();
\r
75 * @return <code>true</code> if this change set contains 0 operations,
\r
76 * <code>false</code> otherwise
\r