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. --- .../predefined/item/CreateItemFromDescription.java | 38 +++++++++++----------- .../lifecycle/instance/predefined/item/Erase.java | 8 ++--- 2 files changed, 23 insertions(+), 23 deletions(-) (limited to 'src/main/java/com/c2kernel/lifecycle/instance/predefined/item') 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); diff --git a/src/main/java/com/c2kernel/lifecycle/instance/predefined/item/Erase.java b/src/main/java/com/c2kernel/lifecycle/instance/predefined/item/Erase.java index f96bc08..a34b202 100644 --- a/src/main/java/com/c2kernel/lifecycle/instance/predefined/item/Erase.java +++ b/src/main/java/com/c2kernel/lifecycle/instance/predefined/item/Erase.java @@ -24,10 +24,10 @@ package com.c2kernel.lifecycle.instance.predefined.item; import java.util.Iterator; -import com.c2kernel.common.CannotManage; -import com.c2kernel.common.InvalidData; +import com.c2kernel.common.CannotManageException; +import com.c2kernel.common.InvalidDataException; import com.c2kernel.common.ObjectCannotBeUpdated; -import com.c2kernel.common.ObjectNotFound; +import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.common.PersistencyException; import com.c2kernel.lifecycle.instance.predefined.PredefinedStep; import com.c2kernel.lookup.AgentPath; @@ -54,7 +54,7 @@ public class Erase extends PredefinedStep //requestdata is xmlstring @Override protected String runActivityLogic(AgentPath agent, ItemPath item, - int transitionID, String requestData) throws InvalidData, ObjectNotFound, ObjectCannotBeUpdated, CannotManage, PersistencyException { + int transitionID, String requestData) throws InvalidDataException, ObjectNotFoundException, ObjectCannotBeUpdated, CannotManageException, PersistencyException { Logger.msg(1, "Erase::request() - Starting."); -- cgit v1.2.3