--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.db.layer0.adapter.impl;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.adapter.Remover;\r
+\r
+/**\r
+ * A {@link Remover} implementation that never allows removal. It uses the\r
+ * provided String as a reason for not allowing removal in\r
+ * {@link #canRemove(ReadGraph, java.util.Map)}\r
+ * \r
+ * @author Tuukka Lehtonen\r
+ */\r
+public class FailingRemover implements Remover {\r
+\r
+ String reason;\r
+\r
+ public FailingRemover(String reason) throws DatabaseException {\r
+ this.reason = reason;\r
+ }\r
+\r
+ public String canRemove(ReadGraph graph, java.util.Map<Object,Object> aux) {\r
+ return reason;\r
+ };\r
+\r
+ @Override\r
+ public void remove(WriteGraph graph) throws DatabaseException {\r
+ }\r
+\r
+}\r