diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2013-11-18 09:48:03 +0100 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2013-11-18 17:25:00 +0100 |
| commit | d43164830403245353080f5d6f838ed9f56d9a35 (patch) | |
| tree | d880c9103fb61f5ef39f1723c4dbd634d5d83b67 /src/main/java/com/c2kernel/lifecycle/instance/predefined/ClearSlot.java | |
| parent | 37a3c3867cb4c7705065ed1d079bdac4f3f52f50 (diff) | |
3.0-SNAPSHOT (Will be first open source version)
New StateMachine desc
IssueID #28
Diffstat (limited to 'src/main/java/com/c2kernel/lifecycle/instance/predefined/ClearSlot.java')
| -rw-r--r-- | src/main/java/com/c2kernel/lifecycle/instance/predefined/ClearSlot.java | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/main/java/com/c2kernel/lifecycle/instance/predefined/ClearSlot.java b/src/main/java/com/c2kernel/lifecycle/instance/predefined/ClearSlot.java index 66df3b2..60e63f1 100644 --- a/src/main/java/com/c2kernel/lifecycle/instance/predefined/ClearSlot.java +++ b/src/main/java/com/c2kernel/lifecycle/instance/predefined/ClearSlot.java @@ -14,12 +14,9 @@ package com.c2kernel.lifecycle.instance.predefined; import com.c2kernel.collection.Aggregation;
import com.c2kernel.collection.AggregationMember;
-import com.c2kernel.common.AccessRightsException;
import com.c2kernel.common.InvalidDataException;
-import com.c2kernel.common.InvalidTransitionException;
import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.lookup.AgentPath;
-import com.c2kernel.lookup.EntityPath;
import com.c2kernel.persistency.ClusterStorage;
import com.c2kernel.persistency.ClusterStorageException;
import com.c2kernel.process.Gateway;
@@ -47,23 +44,17 @@ public class ClearSlot extends PredefinedStep * 1 - slot number
*/
@Override
- public void request(AgentPath agent, int transitionID, String requestData)
- throws AccessRightsException,
- InvalidTransitionException,
- InvalidDataException
- {
- EntityPath entityPath = getItemEntityPath();
+ protected String runActivityLogic(AgentPath agent, int itemSysKey,
+ int transitionID, String requestData) throws InvalidDataException {
+
String collName;
int slotNo;
Aggregation agg;
Logger.msg(1, "ClearSlot::request() - Starting.");
- checkAccessRights(agent);
-
// extract parameters
try {
- entityPath = getItemEntityPath();
String[] params = getDataList(requestData);
collName = params[0];
slotNo = Integer.parseInt(params[1]);
@@ -73,7 +64,7 @@ public class ClearSlot extends PredefinedStep // load collection
try {
- agg = (Aggregation)Gateway.getStorage().get(entityPath.getSysKey(), ClusterStorage.COLLECTION+"/"+collName, null);
+ agg = (Aggregation)Gateway.getStorage().get(itemSysKey, ClusterStorage.COLLECTION+"/"+collName, null);
} catch (ObjectNotFoundException ex) {
throw new InvalidDataException("Collection '"+collName+"' not found in this Item", "");
} catch (ClusterStorageException ex) {
@@ -98,13 +89,12 @@ public class ClearSlot extends PredefinedStep try {
- Gateway.getStorage().put(entityPath.getSysKey(), agg, null);
+ Gateway.getStorage().put(itemSysKey, agg, null);
} catch (ClusterStorageException e) {
Logger.error(e);
throw new InvalidDataException("Error storing collection", "");
}
- sendEventStoreOutcome(transitionID, requestData, agent);
-
Logger.msg(1, "ClearSlot::request() - DONE.");
+ return requestData;
}
}
|
