diff options
Diffstat (limited to 'src/main/java/com/c2kernel/entity')
6 files changed, 21 insertions, 22 deletions
diff --git a/src/main/java/com/c2kernel/entity/TraceableLocator.java b/src/main/java/com/c2kernel/entity/TraceableLocator.java index e370ed6..a1dc702 100644 --- a/src/main/java/com/c2kernel/entity/TraceableLocator.java +++ b/src/main/java/com/c2kernel/entity/TraceableLocator.java @@ -14,9 +14,9 @@ package com.c2kernel.entity; import java.nio.ByteBuffer;
import java.sql.Timestamp;
-import java.util.UUID;
import com.c2kernel.common.ObjectNotFoundException;
+import com.c2kernel.common.SystemKey;
import com.c2kernel.lookup.ItemPath;
import com.c2kernel.process.Gateway;
import com.c2kernel.utils.Logger;
@@ -51,7 +51,7 @@ public class TraceableLocator extends org.omg.PortableServer.ServantLocatorPOA ByteBuffer bb = ByteBuffer.wrap(oid);
long msb = bb.getLong();
long lsb = bb.getLong();
- ItemPath syskey = new ItemPath(new UUID(msb, lsb));
+ ItemPath syskey = new ItemPath(new SystemKey(msb, lsb));
Logger.msg(1,"===========================================================");
Logger.msg(1,"Item called at "+new Timestamp( System.currentTimeMillis()) +": " + operation +
diff --git a/src/main/java/com/c2kernel/entity/agent/ActiveLocator.java b/src/main/java/com/c2kernel/entity/agent/ActiveLocator.java index 966b265..a1561ed 100644 --- a/src/main/java/com/c2kernel/entity/agent/ActiveLocator.java +++ b/src/main/java/com/c2kernel/entity/agent/ActiveLocator.java @@ -14,11 +14,11 @@ package com.c2kernel.entity.agent; import java.nio.ByteBuffer;
import java.sql.Timestamp;
-import java.util.UUID;
import com.c2kernel.common.ObjectNotFoundException;
+import com.c2kernel.common.SystemKey;
import com.c2kernel.lookup.AgentPath;
-import com.c2kernel.lookup.InvalidAgentPathException;
+import com.c2kernel.lookup.InvalidItemPathException;
import com.c2kernel.process.Gateway;
import com.c2kernel.utils.Logger;
@@ -55,7 +55,7 @@ public class ActiveLocator extends org.omg.PortableServer.ServantLocatorPOA ByteBuffer bb = ByteBuffer.wrap(oid);
long msb = bb.getLong();
long lsb = bb.getLong();
- AgentPath syskey = new AgentPath(new UUID(msb, lsb));
+ AgentPath syskey = new AgentPath(new SystemKey(msb, lsb));
Logger.msg(1,"===========================================================");
Logger.msg(1,"Agent called at "+new Timestamp( System.currentTimeMillis()) +": " + operation +
@@ -68,8 +68,8 @@ public class ActiveLocator extends org.omg.PortableServer.ServantLocatorPOA {
Logger.error("ObjectNotFoundException::ActiveLocator::preinvoke() "+ex.toString());
throw new org.omg.CORBA.OBJECT_NOT_EXIST();
- } catch (InvalidAgentPathException ex) {
- Logger.error("InvalidAgentPathException::ActiveLocator::preinvoke() "+ex.toString());
+ } catch (InvalidItemPathException ex) {
+ Logger.error("InvalidItemPathException::ActiveLocator::preinvoke() "+ex.toString());
throw new org.omg.CORBA.INV_OBJREF();
}
}
diff --git a/src/main/java/com/c2kernel/entity/agent/Job.java b/src/main/java/com/c2kernel/entity/agent/Job.java index 13bd268..97f8eef 100644 --- a/src/main/java/com/c2kernel/entity/agent/Job.java +++ b/src/main/java/com/c2kernel/entity/agent/Job.java @@ -1,7 +1,6 @@ package com.c2kernel.entity.agent;
import java.util.HashMap;
-import java.util.UUID;
import com.c2kernel.common.InvalidDataException;
import com.c2kernel.common.ObjectNotFoundException;
@@ -132,9 +131,9 @@ public class Job implements C2KLocalObject item = null;
}
- public void setItemUUID( String uuid )
+ public void setItemUUID( String uuid ) throws InvalidItemPathException
{
- setItemPath(new ItemPath(UUID.fromString(uuid)));
+ setItemPath(ItemPath.fromUUIDString(uuid));
}
public String getItemUUID() {
@@ -189,7 +188,7 @@ public class Job implements C2KLocalObject {
if (uuid != null)
try {
- setAgentPath(new AgentPath(UUID.fromString(uuid)));
+ setAgentPath(AgentPath.fromUUIDString(uuid));
} catch (InvalidAgentPathException e) {
Logger.error("Invalid agent path in Job: "+uuid);
}
diff --git a/src/main/java/com/c2kernel/entity/imports/ImportAggregation.java b/src/main/java/com/c2kernel/entity/imports/ImportAggregation.java index 2f19452..2d8f0a2 100644 --- a/src/main/java/com/c2kernel/entity/imports/ImportAggregation.java +++ b/src/main/java/com/c2kernel/entity/imports/ImportAggregation.java @@ -1,12 +1,12 @@ package com.c2kernel.entity.imports;
import java.util.ArrayList;
-import java.util.UUID;
import com.c2kernel.collection.MembershipException;
import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.graph.model.GraphPoint;
import com.c2kernel.lookup.DomainPath;
+import com.c2kernel.lookup.InvalidItemPathException;
import com.c2kernel.lookup.ItemPath;
import com.c2kernel.property.PropertyDescription;
import com.c2kernel.property.PropertyDescriptionList;
@@ -36,8 +36,8 @@ public class ImportAggregation implements java.io.Serializable { if (thisMem.itemDescriptionPath != null && thisMem.itemDescriptionPath.length()>0) {
ItemPath itemPath;
try {
- itemPath = new ItemPath(UUID.fromString(thisMem.itemDescriptionPath));
- } catch (IllegalArgumentException ex) {
+ itemPath = ItemPath.fromUUIDString(thisMem.itemDescriptionPath);
+ } catch (InvalidItemPathException ex) {
itemPath = new DomainPath(thisMem.itemDescriptionPath).getItemPath();
}
PropertyDescriptionList propList = PropertyUtility.getPropertyDescriptionOutcome(itemPath);
@@ -50,8 +50,8 @@ public class ImportAggregation implements java.io.Serializable { if (thisMem.itemPath != null && thisMem.itemPath.length()>0) {
ItemPath itemPath;
try {
- itemPath = new ItemPath(UUID.fromString(thisMem.itemPath));
- } catch (IllegalArgumentException ex) {
+ itemPath = ItemPath.fromUUIDString(thisMem.itemPath);
+ } catch (InvalidItemPathException ex) {
itemPath = new DomainPath(thisMem.itemPath).getItemPath();
}
if (itemPath == null)
diff --git a/src/main/java/com/c2kernel/entity/imports/ImportDependency.java b/src/main/java/com/c2kernel/entity/imports/ImportDependency.java index a43f6e3..87e6b11 100644 --- a/src/main/java/com/c2kernel/entity/imports/ImportDependency.java +++ b/src/main/java/com/c2kernel/entity/imports/ImportDependency.java @@ -1,11 +1,11 @@ package com.c2kernel.entity.imports;
import java.util.ArrayList;
-import java.util.UUID;
import com.c2kernel.collection.MembershipException;
import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.lookup.DomainPath;
+import com.c2kernel.lookup.InvalidItemPathException;
import com.c2kernel.lookup.ItemPath;
import com.c2kernel.property.PropertyDescription;
import com.c2kernel.property.PropertyDescriptionList;
@@ -58,8 +58,8 @@ public class ImportDependency implements java.io.Serializable { for (ImportDependencyMember thisMem : dependencyMemberList) {
ItemPath itemPath;
try {
- itemPath = new ItemPath(UUID.fromString(thisMem.itemPath));
- } catch (IllegalArgumentException ex) {
+ itemPath = ItemPath.fromUUIDString(thisMem.itemPath);
+ } catch (InvalidItemPathException ex) {
itemPath = new DomainPath(thisMem.itemPath).getItemPath();
}
diff --git a/src/main/java/com/c2kernel/entity/transfer/TransferItem.java b/src/main/java/com/c2kernel/entity/transfer/TransferItem.java index bcbbe65..4ec8953 100644 --- a/src/main/java/com/c2kernel/entity/transfer/TransferItem.java +++ b/src/main/java/com/c2kernel/entity/transfer/TransferItem.java @@ -3,7 +3,6 @@ package com.c2kernel.entity.transfer; import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
-import java.util.UUID;
import com.c2kernel.collection.Collection;
import com.c2kernel.collection.CollectionArrayList;
@@ -13,6 +12,7 @@ import com.c2kernel.entity.TraceableEntity; import com.c2kernel.lifecycle.instance.Workflow;
import com.c2kernel.lookup.AgentPath;
import com.c2kernel.lookup.DomainPath;
+import com.c2kernel.lookup.InvalidItemPathException;
import com.c2kernel.lookup.ItemPath;
import com.c2kernel.lookup.Path;
import com.c2kernel.persistency.ClusterStorage;
@@ -55,9 +55,9 @@ public class TransferItem { this.domainPaths = domainPaths;
}
- public void setUUID( String uuid )
+ public void setUUID( String uuid ) throws InvalidItemPathException
{
- itemPath = new ItemPath(UUID.fromString(uuid));
+ itemPath = ItemPath.fromUUIDString(uuid);
}
public String getUUID() {
|
