1 package org.simantics.graph.db;
5 import org.simantics.db.exception.DatabaseException;
7 public class MissingDependencyException extends DatabaseException {
9 private static final long serialVersionUID = -1579450497603555931L;
11 private final Set<String> missingExternals;
13 public MissingDependencyException(Set<String> missingExternals) {
14 super(createMessage(missingExternals));
15 this.missingExternals = missingExternals;
18 public MissingDependencyException(TransferableGraphImportProcess process) {
19 this(process.missingExternals);
22 public MissingDependencyException(StreamingTransferableGraphImportProcess process) {
23 this(process.missingExternals);
26 private static String createMessage(Set<String> missingExternals) {
27 StringBuilder b = new StringBuilder();
28 b.append("The following required items were missing from the database:\r\n");
29 for(String missing : missingExternals) {
30 b.append(" -" + missing + "\r\n");
35 public Set<String> getMissingURIs() {
36 return missingExternals;
40 public String getShortExplanation() {
41 return "Missing dependencies";