diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2014-10-03 17:30:41 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2014-10-03 17:30:41 +0200 |
| commit | 275d0bbf555c8917be82ce4cc21eb4cabb00f4c5 (patch) | |
| tree | ddcc6b14077d90d1b970b67829f07120547dbb62 /src/main/java/com/c2kernel/lifecycle/instance/stateMachine/Transition.java | |
| parent | a139f95bfeca603333b8c0310ae09c6805e58584 (diff) | |
Huge exception overhaul: Merged ClusterStorageException with
PersistencyException. Replaced MembershipException with
InvalidCollectionModification CORBA Exception. Made all predef steps
throw more accurate exceptions when they go wrong, and let more
exceptions bubble through from underneath.
Diffstat (limited to 'src/main/java/com/c2kernel/lifecycle/instance/stateMachine/Transition.java')
| -rw-r--r-- | src/main/java/com/c2kernel/lifecycle/instance/stateMachine/Transition.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/main/java/com/c2kernel/lifecycle/instance/stateMachine/Transition.java b/src/main/java/com/c2kernel/lifecycle/instance/stateMachine/Transition.java index 8c6502f..78786da 100644 --- a/src/main/java/com/c2kernel/lifecycle/instance/stateMachine/Transition.java +++ b/src/main/java/com/c2kernel/lifecycle/instance/stateMachine/Transition.java @@ -25,8 +25,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern;
import com.c2kernel.common.AccessRightsException;
-import com.c2kernel.common.InvalidDataException;
-import com.c2kernel.common.ObjectNotFoundException;
+import com.c2kernel.common.InvalidData;
+import com.c2kernel.common.ObjectNotFound;
import com.c2kernel.lifecycle.instance.Activity;
import com.c2kernel.lookup.AgentPath;
import com.c2kernel.lookup.RolePath;
@@ -188,15 +188,15 @@ public class Transition { this.targetStateId = targetStateId;
}
- public String getPerformingRole(Activity act, AgentPath agent) throws ObjectNotFoundException, AccessRightsException {
+ public String getPerformingRole(Activity act, AgentPath agent) throws ObjectNotFound, AccessRightsException {
// check available
if (!isEnabled(act.getProperties()))
- throw new AccessRightsException("Transition '"+name+"' is disabled by the '"+enabledProp+"' property.", "");
+ throw new AccessRightsException("Transition '"+name+"' is disabled by the '"+enabledProp+"' property.");
// check active
if (isRequiresActive() && !act.getActive())
- throw new AccessRightsException("Activity must be active to perform this transition", "");
+ throw new AccessRightsException("Activity must be active to perform this transition");
RolePath role = null;
String overridingRole = resolveValue(roleOverride, act.getProperties());
@@ -224,7 +224,7 @@ public class Transition { // Decide the access
if (isOwned && !override && !isOwner)
throw new AccessRightsException("Agent '"+agent.getAgentName()
- +"' cannot perform this transition because the activity '"+act.getName()+"' is currently owned by "+agentName, "");
+ +"' cannot perform this transition because the activity '"+act.getName()+"' is currently owned by "+agentName);
if (role != null) {
if (agent.hasRole(role))
@@ -233,7 +233,7 @@ public class Transition { return "Admin";
else
throw new AccessRightsException("Agent '"+agent.getAgentName()
- +"' does not hold a suitable role '"+role.getName()+"' for the activity "+act.getName(), "");
+ +"' does not hold a suitable role '"+role.getName()+"' for the activity "+act.getName());
}
else
return null;
@@ -284,13 +284,13 @@ public class Transition { return true;
}
- public Schema getSchema(CastorHashMap actProps) throws InvalidDataException, ObjectNotFoundException {
+ public Schema getSchema(CastorHashMap actProps) throws InvalidData, ObjectNotFound {
if (hasOutcome(actProps))
try {
return LocalObjectLoader.getSchema(resolveValue(outcome.schemaName, actProps),
Integer.parseInt(resolveValue(outcome.schemaVersion, actProps)));
} catch (NumberFormatException ex) {
- throw new InvalidDataException("Bad schema version number: "+outcome.schemaVersion+" ("+resolveValue(outcome.schemaVersion, actProps)+")", "");
+ throw new InvalidData("Bad schema version number: "+outcome.schemaVersion+" ("+resolveValue(outcome.schemaVersion, actProps)+")");
}
else
return null;
@@ -300,11 +300,11 @@ public class Transition { return resolveValue(script.scriptName, actProps);
}
- public int getScriptVersion(CastorHashMap actProps) throws InvalidDataException {
+ public int getScriptVersion(CastorHashMap actProps) throws InvalidData {
try {
return Integer.parseInt(resolveValue(script.scriptVersion, actProps));
} catch (NumberFormatException ex) {
- throw new InvalidDataException("Bad Script version number: "+script.scriptVersion+" ("+resolveValue(script.scriptVersion, actProps)+")", "");
+ throw new InvalidData("Bad Script version number: "+script.scriptVersion+" ("+resolveValue(script.scriptVersion, actProps)+")");
}
}
|
