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. --- .../com/c2kernel/process/module/ModuleImport.java | 60 +++++++++++++++++++++- 1 file changed, 58 insertions(+), 2 deletions(-) (limited to 'src/main/java/com/c2kernel/process/module/ModuleImport.java') diff --git a/src/main/java/com/c2kernel/process/module/ModuleImport.java b/src/main/java/com/c2kernel/process/module/ModuleImport.java index 1f5b16d..f54b47d 100644 --- a/src/main/java/com/c2kernel/process/module/ModuleImport.java +++ b/src/main/java/com/c2kernel/process/module/ModuleImport.java @@ -1,10 +1,66 @@ package com.c2kernel.process.module; +import java.util.UUID; + +import com.c2kernel.common.CannotManageException; +import com.c2kernel.common.ObjectAlreadyExistsException; +import com.c2kernel.common.ObjectCannotBeUpdated; +import com.c2kernel.common.ObjectNotFoundException; +import com.c2kernel.lookup.AgentPath; import com.c2kernel.lookup.DomainPath; +import com.c2kernel.lookup.ItemPath; public abstract class ModuleImport { - public String name; - public DomainPath path; + protected String ns; + protected String name; + protected DomainPath domainPath; + protected ItemPath itemPath; + + public ModuleImport() { + } + + public abstract void create(AgentPath agentPath, boolean reset) throws ObjectNotFoundException, + ObjectCannotBeUpdated, CannotManageException, ObjectAlreadyExistsException; + + public void setID( String uuid ) + { + if (uuid != null) itemPath = new ItemPath(UUID.fromString(uuid)); + } + + public String getID() { + return itemPath==null?null:itemPath.getUUID().toString(); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public void setNamespace(String ns) { + this.ns = ns; + } + public String getNamespace() { + return ns; + } + + public DomainPath getDomainPath() { + return domainPath; + } + + public void setDomainPath(DomainPath domainPath) { + this.domainPath = domainPath; + } + + public ItemPath getItemPath() { + return itemPath; + } + + public void setItemPath(ItemPath itemPath) { + this.itemPath = itemPath; + } } \ No newline at end of file -- cgit v1.2.3