From b68ea0f2b12c4c5189c5fc7c182a1b242dc63579 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Fri, 3 Oct 2014 23:18:47 +0200 Subject: Rolled back the renaming of existing exceptions. --- .../instance/predefined/AddNewCollectionDescription.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/main/java/com/c2kernel/lifecycle/instance/predefined/AddNewCollectionDescription.java') diff --git a/src/main/java/com/c2kernel/lifecycle/instance/predefined/AddNewCollectionDescription.java b/src/main/java/com/c2kernel/lifecycle/instance/predefined/AddNewCollectionDescription.java index 6eb69f3..99fd666 100644 --- a/src/main/java/com/c2kernel/lifecycle/instance/predefined/AddNewCollectionDescription.java +++ b/src/main/java/com/c2kernel/lifecycle/instance/predefined/AddNewCollectionDescription.java @@ -26,9 +26,9 @@ import java.util.Arrays; import com.c2kernel.collection.AggregationDescription; import com.c2kernel.collection.CollectionDescription; import com.c2kernel.collection.DependencyDescription; -import com.c2kernel.common.InvalidData; -import com.c2kernel.common.ObjectAlreadyExists; -import com.c2kernel.common.ObjectNotFound; +import com.c2kernel.common.InvalidDataException; +import com.c2kernel.common.ObjectAlreadyExistsException; +import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.common.PersistencyException; import com.c2kernel.lookup.AgentPath; import com.c2kernel.lookup.ItemPath; @@ -63,7 +63,7 @@ public class AddNewCollectionDescription extends PredefinedStep */ @Override protected String runActivityLogic(AgentPath agent, ItemPath item, - int transitionID, String requestData) throws InvalidData, ObjectAlreadyExists, PersistencyException { + int transitionID, String requestData) throws InvalidDataException, ObjectAlreadyExistsException, PersistencyException { String collName; String collType; @@ -72,7 +72,7 @@ public class AddNewCollectionDescription extends PredefinedStep String[] params = getDataList(requestData); if (Logger.doLog(3)) Logger.msg(3, "AddNewCollectionDescription: called by "+agent+" on "+item+" with parameters "+Arrays.toString(params)); if (params.length != 2) - throw new InvalidData("AddNewCollectionDescription: Invalid parameters "+Arrays.toString(params)); + throw new InvalidDataException("AddNewCollectionDescription: Invalid parameters "+Arrays.toString(params)); collName = params[0]; collType = params[1]; @@ -80,8 +80,8 @@ public class AddNewCollectionDescription extends PredefinedStep // check if collection already exists try { Gateway.getStorage().get(item, ClusterStorage.COLLECTION+"/"+collName+"/last", null); - throw new ObjectAlreadyExists("Collection '"+collName+"' already exists"); - } catch (ObjectNotFound ex) { + throw new ObjectAlreadyExistsException("Collection '"+collName+"' already exists"); + } catch (ObjectNotFoundException ex) { // collection doesn't exist } catch (PersistencyException ex) { Logger.error(ex); @@ -96,7 +96,7 @@ public class AddNewCollectionDescription extends PredefinedStep if (collType.equals("Dependency")) newCollDesc = new DependencyDescription(collName); else - throw new InvalidData("AddNewCollectionDescription: Invalid collection type specified: '"+collType+"'. Must be Aggregation or Dependency."); + throw new InvalidDataException("AddNewCollectionDescription: Invalid collection type specified: '"+collType+"'. Must be Aggregation or Dependency."); // store it try { -- cgit v1.2.3