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/agent/RemoveAgent.java | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/main/java/com/c2kernel/lifecycle/instance/predefined/agent/RemoveAgent.java') diff --git a/src/main/java/com/c2kernel/lifecycle/instance/predefined/agent/RemoveAgent.java b/src/main/java/com/c2kernel/lifecycle/instance/predefined/agent/RemoveAgent.java index 65608c7..41fc7ba 100644 --- a/src/main/java/com/c2kernel/lifecycle/instance/predefined/agent/RemoveAgent.java +++ b/src/main/java/com/c2kernel/lifecycle/instance/predefined/agent/RemoveAgent.java @@ -20,10 +20,10 @@ */ package com.c2kernel.lifecycle.instance.predefined.agent; -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; @@ -41,7 +41,7 @@ public class RemoveAgent extends PredefinedStep { @Override protected String runActivityLogic(AgentPath agent, ItemPath itemPath, - int transitionID, String requestData) throws InvalidData { + int transitionID, String requestData) throws InvalidDataException { Logger.msg(1, "RemoveAgent::request() - Starting."); @@ -49,7 +49,7 @@ public class RemoveAgent extends PredefinedStep { try { targetAgent = new AgentPath(itemPath); } catch (InvalidAgentPathException ex) { - throw new InvalidData("Could not resolve "+itemPath+" as an Agent."); + throw new InvalidDataException("Could not resolve "+itemPath+" as an Agent."); } String agentName = targetAgent.getAgentName(); @@ -59,12 +59,12 @@ public class RemoveAgent extends PredefinedStep { Gateway.getLookupManager().removeRole(targetAgent, role); } catch (ObjectCannotBeUpdated e) { Logger.error(e); - throw new InvalidData("Error removing "+agentName+" from Role "+role.getName()); - } catch (ObjectNotFound e) { + throw new InvalidDataException("Error removing "+agentName+" from Role "+role.getName()); + } catch (ObjectNotFoundException e) { Logger.error(e); - throw new InvalidData("Tried to remove "+agentName+" from Role "+role.getName()+" that doesn't exist."); - } catch (CannotManage e) { - throw new InvalidData("Tried to alter roles in a non-server process."); + throw new InvalidDataException("Tried to remove "+agentName+" from Role "+role.getName()+" that doesn't exist."); + } catch (CannotManageException e) { + throw new InvalidDataException("Tried to alter roles in a non-server process."); } } @@ -73,14 +73,14 @@ public class RemoveAgent extends PredefinedStep { Gateway.getStorage().removeCluster(targetAgent, "", null); } catch (PersistencyException e) { Logger.error(e); - throw new InvalidData("Error deleting storage for "+agentName); + throw new InvalidDataException("Error deleting storage for "+agentName); } //remove entity path try { Gateway.getLookupManager().delete(targetAgent); } catch (Exception e) { - throw new InvalidData("Error deleting AgentPath for "+agentName); + throw new InvalidDataException("Error deleting AgentPath for "+agentName); } return requestData; -- cgit v1.2.3