summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/lifecycle/instance/predefined/item/CreateItemFromDescription.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/lifecycle/instance/predefined/item/CreateItemFromDescription.java
parent275d0bbf555c8917be82ce4cc21eb4cabb00f4c5 (diff)
Rolled back the renaming of existing exceptions.
Diffstat (limited to 'src/main/java/com/c2kernel/lifecycle/instance/predefined/item/CreateItemFromDescription.java')
-rw-r--r--src/main/java/com/c2kernel/lifecycle/instance/predefined/item/CreateItemFromDescription.java38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/main/java/com/c2kernel/lifecycle/instance/predefined/item/CreateItemFromDescription.java b/src/main/java/com/c2kernel/lifecycle/instance/predefined/item/CreateItemFromDescription.java
index 02ea642..140f68c 100644
--- a/src/main/java/com/c2kernel/lifecycle/instance/predefined/item/CreateItemFromDescription.java
+++ b/src/main/java/com/c2kernel/lifecycle/instance/predefined/item/CreateItemFromDescription.java
@@ -24,11 +24,11 @@ import com.c2kernel.collection.Collection;
import com.c2kernel.collection.CollectionArrayList;
import com.c2kernel.collection.CollectionDescription;
import com.c2kernel.collection.CollectionMember;
-import com.c2kernel.common.CannotManage;
-import com.c2kernel.common.InvalidData;
-import com.c2kernel.common.ObjectAlreadyExists;
+import com.c2kernel.common.CannotManageException;
+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.CorbaServer;
import com.c2kernel.entity.TraceableEntity;
@@ -62,7 +62,7 @@ public class CreateItemFromDescription extends PredefinedStep
//requestdata is xmlstring
@Override
protected String runActivityLogic(AgentPath agent, ItemPath itemPath,
- int transitionID, String requestData) throws InvalidData, ObjectNotFound, ObjectAlreadyExists, CannotManage, ObjectCannotBeUpdated, PersistencyException {
+ int transitionID, String requestData) throws InvalidDataException, ObjectNotFoundException, ObjectAlreadyExistsException, CannotManageException, ObjectCannotBeUpdated, PersistencyException {
String[] input = getDataList(requestData);
String newName = input[0];
@@ -77,7 +77,7 @@ public class CreateItemFromDescription extends PredefinedStep
DomainPath context = new DomainPath(new DomainPath(domPath), newName);
//Logger.debug(8,"context "+context.getItemPath()+" "+context.getPath()+" "+context.getString());
if (context.exists())
- throw new ObjectAlreadyExists("The path " +context+ " exists already.");
+ throw new ObjectAlreadyExistsException("The path " +context+ " exists already.");
// get init objects
@@ -93,7 +93,7 @@ public class CreateItemFromDescription extends PredefinedStep
// create the Item object
Logger.msg(3, "CreateItemFromDescription - Creating Item");
CorbaServer factory = Gateway.getCorbaServer();
- if (factory == null) throw new CannotManage("This process cannot create new Items");
+ if (factory == null) throw new CannotManageException("This process cannot create new Items");
TraceableEntity newItem = factory.createItem(newItemPath);
Gateway.getLookupManager().add(newItemPath);
@@ -112,7 +112,7 @@ public class CreateItemFromDescription extends PredefinedStep
} catch (PersistencyException e) {
throw e;
} catch (Exception e) {
- throw new InvalidData("CreateAgentFromDescription: Problem initializing new Agent. See log: "+e.getMessage());
+ throw new InvalidDataException("CreateAgentFromDescription: Problem initializing new Agent. See log: "+e.getMessage());
}
// add its domain path
Logger.msg(3, "CreateItemFromDescription - Creating "+context);
@@ -121,16 +121,16 @@ public class CreateItemFromDescription extends PredefinedStep
return requestData;
}
- protected PropertyArrayList getInitProperties(String input) throws InvalidData {
+ protected PropertyArrayList getInitProperties(String input) throws InvalidDataException {
try {
return (PropertyArrayList)Gateway.getMarshaller().unmarshall(input);
} catch (Exception e) {
Logger.error(e);
- throw new InvalidData("Initial property parameter was not a marshalled PropertyArrayList: "+input);
+ throw new InvalidDataException("Initial property parameter was not a marshalled PropertyArrayList: "+input);
}
}
- protected PropertyArrayList getNewProperties(ItemPath itemPath, String descVer, PropertyArrayList initProps, String newName, AgentPath agent) throws ObjectNotFound, InvalidData {
+ protected PropertyArrayList getNewProperties(ItemPath itemPath, String descVer, PropertyArrayList initProps, String newName, AgentPath agent) throws ObjectNotFoundException, InvalidDataException {
// copy properties -- intend to create from propdesc
PropertyDescriptionList pdList = PropertyUtility.getPropertyDescriptionOutcome(itemPath, descVer);
PropertyArrayList props = pdList.instantiate(initProps);
@@ -147,7 +147,7 @@ public class CreateItemFromDescription extends PredefinedStep
return props;
}
- protected CompositeActivity getNewWorkflow(ItemPath itemPath, String descVer) throws ObjectNotFound, InvalidData, PersistencyException {
+ protected CompositeActivity getNewWorkflow(ItemPath itemPath, String descVer) throws ObjectNotFoundException, InvalidDataException, PersistencyException {
// find the workflow def for the given description version
String wfDefName = null; Integer wfDefVer = null;
@@ -159,26 +159,26 @@ public class CreateItemFromDescription extends PredefinedStep
try {
wfDefVer = Integer.parseInt(wfVerObj.toString());
} catch (NumberFormatException ex) {
- throw new InvalidData("Invalid workflow version number: "+wfVerObj.toString());
+ throw new InvalidDataException("Invalid workflow version number: "+wfVerObj.toString());
}
// load workflow def
if (wfDefName == null)
- throw new InvalidData("No workflow given or defined");
+ throw new InvalidDataException("No workflow given or defined");
if (wfDefVer == null)
- throw new InvalidData("No workflow def version given");
+ throw new InvalidDataException("No workflow def version given");
try {
CompositeActivityDef wfDef = (CompositeActivityDef)LocalObjectLoader.getActDef(wfDefName, wfDefVer);
return (CompositeActivity)wfDef.instantiate();
- } catch (ObjectNotFound ex) {
- throw new InvalidData("Workflow def '"+wfDefName+"'v"+wfDefVer+" not found");
+ } catch (ObjectNotFoundException ex) {
+ throw new InvalidDataException("Workflow def '"+wfDefName+"'v"+wfDefVer+" not found");
} catch (ClassCastException ex) {
- throw new InvalidData("Activity def '"+wfDefName+"' was not Composite");
+ throw new InvalidDataException("Activity def '"+wfDefName+"' was not Composite");
}
}
- protected CollectionArrayList getNewCollections(ItemPath itemPath, String descVer) throws ObjectNotFound, PersistencyException {
+ protected CollectionArrayList getNewCollections(ItemPath itemPath, String descVer) throws ObjectNotFoundException, PersistencyException {
// loop through collections, collecting instantiated descriptions and finding the default workflow def
CollectionArrayList colls = new CollectionArrayList();
String[] collNames = Gateway.getStorage().getClusterContents(itemPath, ClusterStorage.COLLECTION);