Public and Private Locate entries
[aaf/authz.git] / auth / auth-cass / src / main / java / org / onap / aaf / auth / dao / cass / LocateDAO.java
index 5d7aebe..085f419 100644 (file)
@@ -99,6 +99,24 @@ public class LocateDAO extends CassDAOImpl<AuthzTrans,LocateDAO.Data> {
         public void reconstitute(ByteBuffer bb) throws IOException {
             LocateLoader.deflt.unmarshal(this, toDIS(bb));
         }
+
+               public Data copy() {
+                       Data out = new Data();
+            out.name = name;
+            out.hostname = hostname;
+            out.port = port;
+            out.major = major;
+            out.minor = minor;
+            out.patch = patch;
+            out.pkg = pkg;
+            out.latitude = latitude;
+            out.longitude = longitude;
+            out.protocol = protocol;
+            out.subprotocol = new HashSet<>();
+            out.subprotocol.addAll(subprotocol);
+            out.port_key = port_key;
+                       return out;
+               }
     }
 
     private static class LocateLoader extends Loader<Data> implements Streamer<Data>{
@@ -162,11 +180,11 @@ public class LocateDAO extends CassDAOImpl<AuthzTrans,LocateDAO.Data> {
             os.writeFloat(data.latitude);
             os.writeFloat(data.longitude);
             writeString(os, data.protocol);
-            if(data.subprotocol==null) {
+            if (data.subprotocol==null) {
                 os.writeInt(0);
             } else {
                 os.writeInt(data.subprotocol.size());
-                for(String s: data.subprotocol) {
+                for (String s: data.subprotocol) {
                     writeString(os,s);
                 }
             }
@@ -192,11 +210,11 @@ public class LocateDAO extends CassDAOImpl<AuthzTrans,LocateDAO.Data> {
             
             int size = is.readInt();
             data.subprotocol = new HashSet<>(size);
-            for(int i=0;i<size;++i) {
+            for (int i=0;i<size;++i) {
                 data.subprotocol.add(readString(is,buff));
             }
             String port_key = readString(is,buff);
-            if(port_key.length()>0) {
+            if (port_key.length()>0) {
                 data.port_key=UUID.fromString(port_key);
             } else {
                 data.port_key = null;