1 /*******************************************************************************
2 * Copyright (c) 2017 Association for Decentralized Information Management in
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
10 * Semantum Oy - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.db.layer0.migration;
14 import java.util.Collection;
16 import org.simantics.db.Resource;
17 import org.simantics.db.exception.AssumptionException;
18 import org.simantics.db.exception.DatabaseException;
19 import org.simantics.graph.db.ImportResult;
22 * @author Tuukka Lehtonen
25 public class MigratedImportResult {
28 * The root resources created by the import process.
30 public final Collection<Resource> roots;
32 public final ImportResult tgResult;
34 public MigratedImportResult(Collection<Resource> roots, ImportResult tgResult) {
36 this.tgResult = tgResult;
39 public Resource singleRoot() throws DatabaseException {
42 throw new AssumptionException("No single imported root found, roots are: " + roots);
43 return roots.iterator().next();
46 public boolean hasMissingExternals() {
47 return tgResult != null ? tgResult.hasMissingExternals() : false;