From da731d2bb81666b9c697d9099da632e7dfcdc0f7 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Tue, 9 Sep 2014 12:13:21 +0200 Subject: Replaced int sysKey Item identifier with UUID, which is now portable. ItemPath objects are now used to identify Items throughout the kernel, replacing ints and Integers. --- .../instance/predefined/AddDomainPath.java | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'src/main/java/com/c2kernel/lifecycle/instance/predefined/AddDomainPath.java') diff --git a/src/main/java/com/c2kernel/lifecycle/instance/predefined/AddDomainPath.java b/src/main/java/com/c2kernel/lifecycle/instance/predefined/AddDomainPath.java index 4c02cbb..daa8fcc 100644 --- a/src/main/java/com/c2kernel/lifecycle/instance/predefined/AddDomainPath.java +++ b/src/main/java/com/c2kernel/lifecycle/instance/predefined/AddDomainPath.java @@ -10,10 +10,11 @@ package com.c2kernel.lifecycle.instance.predefined; +import java.util.Arrays; + import com.c2kernel.common.InvalidDataException; import com.c2kernel.lookup.AgentPath; import com.c2kernel.lookup.DomainPath; -import com.c2kernel.lookup.InvalidItemPathException; import com.c2kernel.lookup.ItemPath; import com.c2kernel.lookup.LookupManager; import com.c2kernel.process.Gateway; @@ -28,30 +29,22 @@ public class AddDomainPath extends PredefinedStep //requestdata is xmlstring @Override - protected String runActivityLogic(AgentPath agent, int itemSysKey, + protected String runActivityLogic(AgentPath agent, ItemPath item, int transitionID, String requestData) throws InvalidDataException { - Logger.msg(1,"AddAlias::request() - Starting."); + String[] params = getDataList(requestData); + if (Logger.doLog(3)) Logger.msg(3, "AddDomainPath: called by "+agent+" on "+item+" with parameters "+Arrays.toString(params)); try { LookupManager lookupManager = Gateway.getLookupManager(); - DomainPath domainPath = new DomainPath(getDataList(requestData)[0], new ItemPath(itemSysKey)); + DomainPath domainPath = new DomainPath(params[0], item); lookupManager.add(domainPath); - Logger.msg(8,"AddDomainPath::request() - systemKey:" + itemSysKey + - ". Adding dompath. DONE."); return requestData; } - catch (InvalidItemPathException ex) - { - Logger.error(ex); - throw new InvalidDataException(ex.toString(), ""); - } catch( Exception ex ) { - Logger.error("AddDomainPath::request() - during anyHelper.extract."); - Logger.error(ex); - throw new InvalidDataException(ex.toString(), ""); + throw unknownException(ex); } } -- cgit v1.2.3