comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:3dc0c5604566
1 package org.dancres.blitz.oid;
2
3 /**
4 <p>Provides the means by which to reconstitute an OID from it's constituent
5 parts.</p>
6
7 <p>This class will change some when we introduce a node id as will
8 the OID interface. Likely as not, all marshalling and unmarshalling will
9 move into this class and need to introduce a type identifier as part of
10 the marshalling to make sure we return the appropriate concrete
11 implementation class.</p>
12 */
13 public class OIDFactory {
14 public static final int KEY_SIZE = UIDImpl.KEY_SIZE;
15
16 public static OID newOID(int aZoneId, long anId) {
17 return new UIDImpl(aZoneId, anId);
18 }
19
20 public static OID newOID(byte[] aKey) {
21 return new UIDImpl(aKey);
22 }
23
24 public static byte[] getKey(OID anOID) {
25 return ((UIDImpl) anOID).getKey();
26 }
27 }