diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2014-10-03 23:18:47 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2014-10-03 23:18:47 +0200 |
| commit | b68ea0f2b12c4c5189c5fc7c182a1b242dc63579 (patch) | |
| tree | 85b1cc4713ba978c044bfa0656f9115c9f9bf9e3 /src/main/java/com/c2kernel/lifecycle/instance/predefined/agent/RemoveAgent.java | |
| parent | 275d0bbf555c8917be82ce4cc21eb4cabb00f4c5 (diff) | |
Rolled back the renaming of existing exceptions.
Diffstat (limited to 'src/main/java/com/c2kernel/lifecycle/instance/predefined/agent/RemoveAgent.java')
| -rw-r--r-- | src/main/java/com/c2kernel/lifecycle/instance/predefined/agent/RemoveAgent.java | 24 |
1 files changed, 12 insertions, 12 deletions
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;
|
