diff src/org/dancres/blitz/oid/OIDFactory.java @ 0:3dc0c5604566

Initial checkin of blitz 2.0 fcs - no installer yet.
author Dan Creswell <dan.creswell@gmail.com>
date Sat, 21 Mar 2009 11:00:06 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/dancres/blitz/oid/OIDFactory.java	Sat Mar 21 11:00:06 2009 +0000
@@ -0,0 +1,27 @@
+package org.dancres.blitz.oid;
+
+/**
+   <p>Provides the means by which to reconstitute an OID from it's constituent
+   parts.</p>
+
+   <p>This class will change some when we introduce a node id as will
+   the OID interface.  Likely as not, all marshalling and unmarshalling will
+   move into this class and need to introduce a type identifier as part of
+   the marshalling to make sure we return the appropriate concrete
+   implementation class.</p>
+ */
+public class OIDFactory {
+    public static final int KEY_SIZE = UIDImpl.KEY_SIZE;
+
+    public static OID newOID(int aZoneId, long anId) {
+        return new UIDImpl(aZoneId, anId);
+    }
+
+    public static OID newOID(byte[] aKey) {
+        return new UIDImpl(aKey);
+    }
+
+    public static byte[] getKey(OID anOID) {
+        return ((UIDImpl) anOID).getKey();
+    }
+}
\ No newline at end of file