diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2014-09-22 16:02:52 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2014-09-22 16:02:52 +0200 |
| commit | 6ac605c864a6c8541ceafd59bb271733b1ec150c (patch) | |
| tree | 4413256706c4934f40c2f7b11f4c6f0521f239a2 /src | |
| parent | a7cefce58cdb0f7f2d0868a1d5ee2f24f3890646 (diff) | |
Castor unmarshalling was resulting in null itemPaths in ImportItem.
ItemPath wasn't being set by the constructor either.
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/java/com/c2kernel/entity/imports/ImportItem.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/com/c2kernel/entity/imports/ImportItem.java b/src/main/java/com/c2kernel/entity/imports/ImportItem.java index 586ebba..9038cc5 100644 --- a/src/main/java/com/c2kernel/entity/imports/ImportItem.java +++ b/src/main/java/com/c2kernel/entity/imports/ImportItem.java @@ -54,6 +54,7 @@ public class ImportItem extends ModuleImport { this();
setNamespace(ns);
setName(name);
+ setItemPath(itemPath);
setInitialPath(initialPath);
setWorkflow(wf);
setWorkflowVer(wfVer);
@@ -77,18 +78,21 @@ public class ImportItem extends ModuleImport { public void setNamespace(String ns) {
super.setNamespace(ns);
if (initialPath == null) initialPath = "/desc/"+ns;
- itemPath = null;
}
@Override
public void setName(String name) {
super.setName(name);
- itemPath = null;
}
@Override
public void create(AgentPath agentPath, boolean reset) throws ObjectCannotBeUpdated, ObjectNotFoundException, CannotManageException, ObjectAlreadyExistsException {
DomainPath domPath = new DomainPath(new DomainPath(initialPath), name);
+ if (domPath.exists()) {
+ ItemPath domItem = domPath.getItemPath();
+ if (!getItemPath().equals(domItem))
+ throw new CannotManageException("Item "+domPath+" was found with the wrong itemPath ("+domPath.getItemPath()+" vs "+getItemPath()+")", "");
+ }
TraceableEntity newItem;
if (getItemPath().exists()) {
@@ -210,7 +214,6 @@ public class ImportItem extends ModuleImport { public void setInitialPath(String initialPath) {
this.initialPath = initialPath;
- itemPath = null;
}
public String getWorkflow() {
|
