summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/entity/imports/ImportItem.java
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2014-10-03 23:18:47 +0200
committerAndrew Branson <andrew.branson@cern.ch>2014-10-03 23:18:47 +0200
commitb68ea0f2b12c4c5189c5fc7c182a1b242dc63579 (patch)
tree85b1cc4713ba978c044bfa0656f9115c9f9bf9e3 /src/main/java/com/c2kernel/entity/imports/ImportItem.java
parent275d0bbf555c8917be82ce4cc21eb4cabb00f4c5 (diff)
Rolled back the renaming of existing exceptions.
Diffstat (limited to 'src/main/java/com/c2kernel/entity/imports/ImportItem.java')
-rw-r--r--src/main/java/com/c2kernel/entity/imports/ImportItem.java28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/main/java/com/c2kernel/entity/imports/ImportItem.java b/src/main/java/com/c2kernel/entity/imports/ImportItem.java
index 74362d5..0e067f8 100644
--- a/src/main/java/com/c2kernel/entity/imports/ImportItem.java
+++ b/src/main/java/com/c2kernel/entity/imports/ImportItem.java
@@ -29,12 +29,12 @@ import org.custommonkey.xmlunit.XMLUnit;
import com.c2kernel.collection.Aggregation;
import com.c2kernel.collection.CollectionArrayList;
import com.c2kernel.collection.Dependency;
-import com.c2kernel.common.CannotManage;
+import com.c2kernel.common.CannotManageException;
import com.c2kernel.common.InvalidCollectionModification;
-import com.c2kernel.common.InvalidData;
-import com.c2kernel.common.ObjectAlreadyExists;
+import com.c2kernel.common.InvalidDataException;
+import com.c2kernel.common.ObjectAlreadyExistsException;
import com.c2kernel.common.ObjectCannotBeUpdated;
-import com.c2kernel.common.ObjectNotFound;
+import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.common.PersistencyException;
import com.c2kernel.entity.TraceableEntity;
import com.c2kernel.events.Event;
@@ -90,7 +90,7 @@ public class ImportItem extends ModuleImport {
if (existingItem.exists()) {
try {
itemPath = existingItem.getItemPath();
- } catch (ObjectNotFound ex) { }
+ } catch (ObjectNotFoundException ex) { }
}
}
if (itemPath == null) itemPath = new ItemPath();
@@ -109,12 +109,12 @@ public class ImportItem extends ModuleImport {
}
@Override
- public void create(AgentPath agentPath, boolean reset) throws ObjectCannotBeUpdated, ObjectNotFound, CannotManage, ObjectAlreadyExists, InvalidCollectionModification {
+ public void create(AgentPath agentPath, boolean reset) throws ObjectCannotBeUpdated, ObjectNotFoundException, CannotManageException, ObjectAlreadyExistsException, InvalidCollectionModification {
DomainPath domPath = new DomainPath(new DomainPath(initialPath), name);
if (domPath.exists()) {
ItemPath domItem = domPath.getItemPath();
if (!getItemPath().equals(domItem))
- throw new CannotManage("Item "+domPath+" was found with the wrong itemPath ("+domPath.getItemPath()+" vs "+getItemPath()+")");
+ throw new CannotManageException("Item "+domPath+" was found with the wrong itemPath ("+domPath.getItemPath()+" vs "+getItemPath()+")");
}
TraceableEntity newItem;
@@ -139,10 +139,10 @@ public class ImportItem extends ModuleImport {
else usedWfVer = workflowVer.intValue();
try {
compact = (CompositeActivityDef)LocalObjectLoader.getActDef(workflow, usedWfVer);
- } catch (ObjectNotFound ex) {
- throw new CannotManage("Could not find workflow "+workflow+"v"+usedWfVer+" for item "+domPath);
- } catch (InvalidData e) {
- throw new CannotManage("Workflow def "+workflow+" v"+usedWfVer+" for item "+domPath+" was not valid");
+ } catch (ObjectNotFoundException ex) {
+ throw new CannotManageException("Could not find workflow "+workflow+"v"+usedWfVer+" for item "+domPath);
+ } catch (InvalidDataException e) {
+ throw new CannotManageException("Workflow def "+workflow+" v"+usedWfVer+" for item "+domPath+" was not valid");
}
// create collections
@@ -167,7 +167,7 @@ public class ImportItem extends ModuleImport {
} catch (Exception ex) {
Logger.error("Error initialising new item "+name );
Logger.error(ex);
- throw new CannotManage("Problem initialising new item. See server log.");
+ throw new CannotManageException("Problem initialising new item. See server log.");
}
// import outcomes
@@ -192,12 +192,12 @@ public class ImportItem extends ModuleImport {
continue;
}
}
- } catch (ObjectNotFound ex) {
+ } catch (ObjectNotFoundException ex) {
Logger.msg(3, "View "+thisOutcome.schema+"/"+thisOutcome.viewname+" not found in "+name+". Creating.");
impView = new Viewpoint(getItemPath(), thisOutcome.schema, thisOutcome.viewname, thisOutcome.version, -1);
} catch (PersistencyException e) {
throw new ObjectCannotBeUpdated("Could not check data for view "+thisOutcome.schema+"/"+thisOutcome.viewname+" in "+name);
- } catch (InvalidData e) {
+ } catch (InvalidDataException e) {
throw new ObjectCannotBeUpdated("Could not check previous event for view "+thisOutcome.schema+"/"+thisOutcome.viewname+" in "+name);
}