diff --git a/pom.xml b/pom.xml
index 139413b2bcdc4f7582b5ef075684a9a939752da8..0aca6ccade7dd8b97dfa4e7d290416728c25804c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -46,13 +46,33 @@
             <type>jar</type>
         </dependency>
         <dependency>
-            <groupId>ca.nrc.cadc.</groupId>
-            <artifactId>cadcUtil</artifactId>
+            <groupId>com.mysql.jdbc</groupId>
+            <artifactId>mysql-connector</artifactId>
             <version>0.0</version>
         </dependency>
         <dependency>
-            <groupId>com.mysql.jdbc</groupId>
-            <artifactId>mysql-connector</artifactId>
+            <groupId>ca.nrc.cadc.vos</groupId>
+            <artifactId>cadcVOS</artifactId>
+            <version>0.0</version>
+        </dependency>
+        <dependency>
+            <groupId>ca.nrc.cadc.vos</groupId>
+            <artifactId>cadcVOS-Server</artifactId>
+            <version>0.0</version>
+        </dependency>
+        <dependency>
+            <groupId>ca.nrc.cadc.uws</groupId>
+            <artifactId>cadcUWS-Server</artifactId>
+            <version>0.0</version>
+        </dependency>
+        <dependency>
+            <groupId>ca.nrc.cadc.uws</groupId>
+            <artifactId>cadcUWS</artifactId>
+            <version>0.0</version>
+        </dependency>
+        <dependency>
+            <groupId>ca.nrc.cadc</groupId>
+            <artifactId>cadcUtil</artifactId>
             <version>0.0</version>
         </dependency>
         <dependency>
diff --git a/src/main/java/DelegationTokenKey.pub b/src/main/java/DelegationTokenKey.pub
new file mode 100644
index 0000000000000000000000000000000000000000..973ad53c4aabd44f5daba5103dcd5cfadf92196b
--- /dev/null
+++ b/src/main/java/DelegationTokenKey.pub
@@ -0,0 +1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDE+lo2eU+lvaqNfyE1K2PiEcVw7D6VoaVeFTQuEow9uGM4NyTLSYz4yD82jXNhheFzo399BzAk+EqdEWmx7P24OOSsCY1rzbohdeLgMDCURh+6wh4aeeKn+XptA9aXRs/Vlji337gG6BGS4zPICwCSWiHg8eGT0R3EIECLdI0+MBAwBxmOkkvrFMdDxcO4lRTu5lCWpR0gUvUde22kVUXfNoK+ZG92Ujxaw9zZapFaUEdDeCzFQCR9Bn4V4yWmSaJrVY+SsACzqz4A4vQ+FQh1+ayrNsoa0kgpPFCnv+Hv0lpPQ23yPpWO8mvdHs/OtJ5jT+jwdr/C3p87CFCkhGtP root@marmolada.oats.inaf.it
diff --git a/src/main/java/it/inaf/oats/vospacebackend/VOSpaceBackendApplication.java b/src/main/java/it/inaf/oats/vospacebackend/VOSpaceBackendApplication.java
index 4acd5f6c2163a3237c67c485399fadc9f2160710..54357c1a8a633c6424e17430b3f1b0b66abdfebd 100644
--- a/src/main/java/it/inaf/oats/vospacebackend/VOSpaceBackendApplication.java
+++ b/src/main/java/it/inaf/oats/vospacebackend/VOSpaceBackendApplication.java
@@ -38,8 +38,8 @@ public class VOSpaceBackendApplication extends Application {
         Router router = new Router(getContext());
         // Defines a route for the resource "list of items"
         router.attach("/myResource", VOSpaceBackendResource.class );
-        router.attach("/myResource/{security_token}/{unique_file_id_string}/{fileToManage}", VOSpaceBackendResource.class );
-        //router.attach("/vospaceBackendGet", VOSpaceBackendResourceGet.class );
+        //router.attach("/myResource/{security_token}/{unique_file_id_string}/{fileToManage}", VOSpaceBackendResource.class );
+        router.attach("/myResource/{parameters}",  VOSpaceBackendResource.class );      
         
         return router;
 
diff --git a/src/main/java/it/inaf/oats/vospacebackend/VOSpaceBackendResource.java b/src/main/java/it/inaf/oats/vospacebackend/VOSpaceBackendResource.java
index 6edb31a03030567d912c4e820699dbbcdbae97ab..a3c9b1f47e048cdf634e7c6beb67c609d1de2391 100644
--- a/src/main/java/it/inaf/oats/vospacebackend/VOSpaceBackendResource.java
+++ b/src/main/java/it/inaf/oats/vospacebackend/VOSpaceBackendResource.java
@@ -34,17 +34,22 @@ import java.io.File;
 import java.io.FileOutputStream;
 import java.io.InputStream;
 import java.io.IOException;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
 import java.text.MessageFormat;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.List;
 import java.util.Iterator;
 
+import javax.servlet.ServletContext;
+
 import org.apache.log4j.Logger;
 import org.apache.commons.fileupload.FileItem;
 import org.apache.commons.fileupload.disk.DiskFileItemFactory;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.commons.io.IOUtils; 
+import org.apache.commons.codec.binary.Hex;
 
 import org.restlet.resource.Get;
 import org.restlet.resource.Post;
@@ -62,6 +67,18 @@ import org.restlet.ext.fileupload.RestletFileUpload;
 import org.restlet.data.MediaType;
 import org.restlet.data.Status;
 
+import java.security.InvalidKeyException;
+import java.io.IOException;
+import java.io.ByteArrayInputStream;
+import java.io.UnsupportedEncodingException;  
+import java.io.OutputStream;
+import java.util.UUID;
+import javax.xml.bind.DatatypeConverter;
+
+import ca.nrc.cadc.util.RsaSignatureGenerator;
+import ca.nrc.cadc.util.RsaSignatureVerifier;
+import java.security.MessageDigest;
+
 /**
  *
  * @author bertocco
@@ -77,31 +94,28 @@ public class VOSpaceBackendResource extends ServerResource {
         
         log.info("Entering in PUT operation");
  
-        String security_token = "";
-        String unique_file_id_str = ""; 
-        String fileToManage = "";       
+        String vosuri = null;
+        String encodedParameters;
         InputStream is;
         if (entity != null) {
             log.info("Received good entity");
             try {
                 log.debug("Trying to read attributes");
                 Request request = getRequest();
-                log.debug("AAA");
-                security_token = (String)getRequest().getAttributes().get("security_token");
-                unique_file_id_str = (String)getRequest().getAttributes().get("unique_file_id_string");
-                fileToManage = (String)getRequest().getAttributes().get("fileToManage");
-                log.debug("\nsecurity token = " + security_token +
-                          "\nunique_file_id_str = " + unique_file_id_str +
-                          "\nfileToManage = " + fileToManage);
+                encodedParameters = (String)getRequest().getAttributes().get("parameters");
+                log.debug("Received encoded parameters : " + encodedParameters);
+                vosuri = manageParametersDecoding(encodedParameters);
+                log.debug("Received parameters decoded = " + vosuri);
             } catch (Exception e) {
                 log.debug("Exception reading string parameters");
+                log.debug(e);
             }   
-                        
+                       
             try {
  
                 is = entity.getStream();
                 log.debug("Input stream get");
-                result = readAndSaveFile(fileToManage, unique_file_id_str, is);
+                result = readAndSaveFile(vosuri, is);
                 
             } catch (Exception e) {
                 result = this.printMessage("File NOT Uploaded! Something went wrong.");    
@@ -112,7 +126,7 @@ public class VOSpaceBackendResource extends ServerResource {
         return result;
     }
     
-        
+/*        
     @Post
     public Representation doPost(Representation entity) throws Exception {
         
@@ -143,15 +157,16 @@ public class VOSpaceBackendResource extends ServerResource {
             setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
             result = this.printMessage("POST request with no entity.");
         }
-        
         return result;
     
     }
-
+*/
+    
     @Get
     public Representation doGet(){
         
         Representation result = null;
+        
         log.info("Entering in GET operation");
         String fileName = (String)getRequestAttributes().get("fileToManage");
         log.debug("File to download is: " + fileName);
@@ -162,6 +177,7 @@ public class VOSpaceBackendResource extends ServerResource {
             result = this.printMessage("GET request: failed to download file.");  
         }  
         
+        
         return result;
     }
     
@@ -172,6 +188,7 @@ public class VOSpaceBackendResource extends ServerResource {
         Representation result;
         
         log.info("Entering in DELETE operation");
+        
         String fileName = (String)getRequestAttributes().get("fileToManage");
         log.debug("File to delete is: " + fileName);
         try {       
@@ -179,10 +196,10 @@ public class VOSpaceBackendResource extends ServerResource {
         } catch (Exception e) {         
             result = this.printMessage("DELETE request: failed to delete file " + fileName);  
         }   
-         
-        return result;  
+        return result;                
+        
     }
-    
+/*    
     private Representation uploadFile(Representation entity) throws Exception {
                 
         Representation result = null;
@@ -269,13 +286,14 @@ public class VOSpaceBackendResource extends ServerResource {
         log.debug("fileName = " + origFileName);
         
         
-        result = readAndSaveFile(origFileName, unique_file_id_str, fileItemToStore);
+        result = readAndSaveFile(vosuri, fileItemToStore);
         
         return result;
         
     }
+    */
     
-    private Representation readAndSaveFile(String origFileName, String unique_file_id_str, FileItem fi)
+    private Representation readAndSaveFile(String vosuri, FileItem fi)
                            throws IOException, VOSpaceBackendException {
                 
         Representation result;
@@ -284,22 +302,21 @@ public class VOSpaceBackendResource extends ServerResource {
         InputStream is = fi.getInputStream();
         log.debug("Input stream get");
         
-        return readAndSaveFile(origFileName, unique_file_id_str, is);
+        return readAndSaveFile(vosuri, is);
         
     }
     
     
-    private Representation readAndSaveFile(String origFileName, String unique_file_id_str, InputStream is)
+    private Representation readAndSaveFile(String vosuri, InputStream is)
                            throws IOException, VOSpaceBackendException {
         
         Representation result;
+        String md5sum = null;
+        
+        // Generate the unique file identifier (storageFileID)
+        String unique_file_id_str = UUID.randomUUID().toString();
+        log.debug("Unique file identifyer " + unique_file_id_str);
         
-        byte[] data = IOUtils.toByteArray(is);
-        log.debug("toByteArray OK");
-        // Calculate the file MD5 checksum (so will not need to re-read 
-        // the file a new time later
-        String md5sum = new String(DigestUtils.md5Hex(data));
-        log.debug("MD5Sum del file: " + md5sum);
         // Get temporary document root from configuration file
         String tmpStorageRoot = new String();
         try {
@@ -320,10 +337,14 @@ public class VOSpaceBackendResource extends ServerResource {
         // Seve the temporary file in temporary location with the new unique name
         File savedUploadedFile = new File(path + File.separator + unique_file_id_str);
         FileOutputStream outStream = new FileOutputStream(savedUploadedFile);
-        outStream.write(data);
-        outStream.close();
         try {
-            if (this.storeUploadedFile(unique_file_id_str, origFileName, md5sum)) {  
+            md5sum = readWriteAndGetChecksum(is, outStream);
+        } catch (Exception e) {
+            result = this.printMessage("File NOT Uploaded! Something went wrong." + e.getMessage());    
+        }
+        
+        try {
+            if (this.storeUploadedFile(vosuri, unique_file_id_str, md5sum)) {  
                 setStatus(Status.SUCCESS_OK); 
                 result = this.printMessage("File successfully uploaded");
             } else {                  
@@ -337,7 +358,7 @@ public class VOSpaceBackendResource extends ServerResource {
     }
     
     
-    private boolean storeUploadedFile(String tmp_file_name, String orig_f_name, 
+    private boolean storeUploadedFile(String vosuri, String tmp_file_name, 
                                       String md5_sum) throws Exception {
         boolean stored = false;
         log.debug("Entering in storeUploadedFile");
@@ -345,7 +366,7 @@ public class VOSpaceBackendResource extends ServerResource {
         log.debug("myVOSpaceFactory created");
         VOSpaceBackend myVOSpace = myVOSpaceFactory.getVOSpaceBackImpl();
         log.debug("myVOSpace get");
-        stored = myVOSpace.createFile(orig_f_name, tmp_file_name, md5_sum);
+        stored = myVOSpace.createFile(vosuri, tmp_file_name, md5_sum);
         log.debug("File stored: " + stored);
         return stored;
                 
@@ -406,6 +427,118 @@ public class VOSpaceBackendResource extends ServerResource {
     }
     
     
+    
+
+    private String manageParametersDecoding(String toBeVerified) {
+        
+        String vosuri;
+        int count = 0;
+        
+        log.debug("manageParametersEncoding BEGIN");
+        String urlStr = new String(DatatypeConverter.parseBase64Binary(toBeVerified));
+        log.debug("urlStr = " + urlStr);
+        vosuri = urlStr.substring(0, urlStr.indexOf("|"));
+        log.debug("vosuri = " + vosuri);
+        String remaining = urlStr.substring(urlStr.indexOf("|")+1, urlStr.length());
+        log.debug("Remaining after get vosuri = " + remaining);
+        String signature = remaining.substring(remaining.indexOf("|")+1, remaining.length());
+        log.debug("signature = \n" + signature);
+        
+        // Validation
+        log.debug("I am going to create RsaSignatureVerifier");
+        RsaSignatureVerifier su = new RsaSignatureVerifier();
+        log.debug("Created");
+        
+        boolean valid = false;
+        try {
+        valid = su.verify(new ByteArrayInputStream(vosuri.getBytes()),
+                    DatatypeConverter.parseBase64Binary(signature));
+        } catch (IOException ioe) {
+            log.debug("IOException");
+            log.debug(ioe.getMessage());
+        } catch (InvalidKeyException ike) {
+            log.debug("InvalidKeyException");           
+            log.debug(ike.getMessage());       
+        }
+                
+        return vosuri;
+        
+    }
+    
+    public String readWriteAndGetChecksum(InputStream istream, FileOutputStream ostream) throws Exception {
+        
+        log.debug("Entering in readWriteAndGetChecksum(InputStream, FileOutputStream)");
+        
+        int DEFAULT_BUFFER_SIZE = 1024 * 4;
+        String checksum = null;
+        byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
+        int bytesRead;
+        
+        MessageDigest msgDigest = MessageDigest.getInstance("MD5");
+        
+        // do an initial read to ensure there are bytes in the stream
+        try {
+            bytesRead = istream.read(buffer, 0, DEFAULT_BUFFER_SIZE);
+            if (bytesRead <= 0) {
+                // do not allow the creation of zero-length files
+                log.debug("Cannot write a zero-length file.");
+                throw new Exception("Cannot write a zero-length file.");
+            } else
+                log.debug("First bytes read OK");
+        } catch (IOException ex) {
+            String errorMsg = "Upstream exception while reading from "
+                + istream.getClass().getName() + ": "
+                + ex.getMessage();
+            log.debug("IOException in the first byte reading of the incoming file");
+            log.debug(errorMsg);
+            //throw new TransferAbortedException(errorMsg);
+            throw new Exception(errorMsg);
+        }
+
+        // Loop reading and writing data.
+        msgDigest.update(buffer, 0, bytesRead);
+        log.debug("First msgDigest.update OK");
+        try {
+
+            while (bytesRead >= 0) {
+                ostream.write(buffer, 0, bytesRead);
+                try {
+                    bytesRead = istream.read(buffer, 0, DEFAULT_BUFFER_SIZE);
+                    if(bytesRead > 0) {
+                        msgDigest.update(buffer, 0, bytesRead);
+                    }
+                } catch (IOException ex) {
+                    String errorMsg = "Upstream exception while reading from "
+                        + istream.getClass().getName() + ": "
+                        + ex.getMessage();
+                    //throw new TransferAbortedException(errorMsg);                    
+                    log.debug(errorMsg);                   
+                    log.debug("A Exception in reading/writing file" + ex.getMessage());
+                    throw new Exception(errorMsg);
+                } 
+            } 
+            ostream.flush();
+            ostream.close();
+                
+        } catch (IOException ex) {
+            log.debug("B Exception in reading/writing file" + ex.getMessage());
+        }
+        
+        //Get the hash's bytes
+        byte[] bytes = null;
+        try {
+            bytes = msgDigest.digest();
+        } catch (Exception ex) {
+           log.debug("Exception doing msgDigest.digest()");
+        }
+        String md5_checksum = new String(Hex.encodeHex(bytes));
+        log.debug("************************ MD5 checksum calculated: " + md5_checksum);
+        
+        return md5_checksum;
+        
+    }
+    
+    
     private Representation printMessage(String error) {
         
             StringBuilder sb = new StringBuilder("");
@@ -413,5 +546,4 @@ public class VOSpaceBackendResource extends ServerResource {
             sb.append("\n");
             return new StringRepresentation(sb.toString(), MediaType.TEXT_PLAIN);
     }
-
 }
diff --git a/src/main/java/it/inaf/oats/vospacebackend/implementation/DatabaseJobPersistenceImpl.java b/src/main/java/it/inaf/oats/vospacebackend/implementation/DatabaseJobPersistenceImpl.java
new file mode 100644
index 0000000000000000000000000000000000000000..b1117d9ab76063d84f7b0944a7e6b369e6a44e9b
--- /dev/null
+++ b/src/main/java/it/inaf/oats/vospacebackend/implementation/DatabaseJobPersistenceImpl.java
@@ -0,0 +1,41 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package it.inaf.oats.vospacebackend.implementation;
+
+import ca.nrc.cadc.uws.server.DatabaseJobPersistence;
+import ca.nrc.cadc.uws.server.JobDAO;
+import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;
+
+import javax.sql.DataSource;
+/**
+ *
+ * @author bertocco
+ */
+public class DatabaseJobPersistenceImpl extends DatabaseJobPersistence {
+ 
+    
+
+    protected JobDAO.JobSchema getJobSchema() {
+        
+        return new JobDAO.JobSchema("Job", "JobDetail", false);
+        
+    }
+    
+    /**
+     * Providing a data source.
+     */
+    protected DataSource getDataSource() {
+    
+        MysqlDataSource dataSource = new MysqlDataSource();
+        dataSource.setDatabaseName("cadctest");
+        dataSource.setUser("oatsops");
+        dataSource.setPassword("Peper0ne");
+        dataSource.setServerName("localhost");
+        
+        return dataSource;
+    }
+    
+}
diff --git a/src/main/java/it/inaf/oats/vospacebackend/implementation/DatabaseNodePersistenceExt.java b/src/main/java/it/inaf/oats/vospacebackend/implementation/DatabaseNodePersistenceExt.java
index d27c97f7091df24746f6e17f1161cd7af0185f00..deb82573b3d8e7d2fcaa358ba4d9f583590b28e7 100644
--- a/src/main/java/it/inaf/oats/vospacebackend/implementation/DatabaseNodePersistenceExt.java
+++ b/src/main/java/it/inaf/oats/vospacebackend/implementation/DatabaseNodePersistenceExt.java
@@ -27,11 +27,7 @@ package it.inaf.oats.vospacebackend.implementation;
 import ca.nrc.cadc.auth.IdentityManager;
 import ca.nrc.cadc.vos.server.DatabaseNodePersistence;
 import ca.nrc.cadc.vos.server.NodeDAO;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
+
 import javax.sql.DataSource;
 
 import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;
@@ -43,7 +39,7 @@ public class DatabaseNodePersistenceExt extends DatabaseNodePersistence {
      * Constructor
      */
     public DatabaseNodePersistenceExt() {
-        super(new NodeDAO.NodeSchema("node", "nodeproperty", false), "/deleted_nodes");
+        super(new NodeDAO.NodeSchema("Node", "NodeProperty", false), "/deleted_nodes");
     }
 
     @Override
diff --git a/src/main/java/it/inaf/oats/vospacebackend/implementation/FileRecord.java b/src/main/java/it/inaf/oats/vospacebackend/implementation/FileRecord.java
index 4c11ede3d69b63b4a0a6978366c2a8c48acfb6f0..3aa93f7d653239df98aa363bba29f8fe5eadd523 100644
--- a/src/main/java/it/inaf/oats/vospacebackend/implementation/FileRecord.java
+++ b/src/main/java/it/inaf/oats/vospacebackend/implementation/FileRecord.java
@@ -29,40 +29,36 @@ import java.util.HashMap;
 
 public class FileRecord {
     
-    private static final String original_file_name = "original_file_name";
     private static final String stored_file_name   = "stored_file_name";
     private static final String md5_checksum       = "md5_checksum"; 
     private static final String relative_path      = "relative_path";  
-    private static final String vosuri             = "vosuri";       
+    private static final String nodeID             = "nodeID";       
     
     private HashMap content = new HashMap<String, String>();
     
     public FileRecord() {
         
-        content.put(original_file_name, "");
         content.put(stored_file_name, "");
         content.put(md5_checksum, "");
         content.put(relative_path, "");
-        content.put(vosuri, "");
+        content.put(nodeID, "");
         
     }
     
-    public FileRecord(String fileName, String stored_f_name, String md5Checksum, String relativePath) {
+    public FileRecord(String stored_f_name, String md5Checksum, String relativePath) {
         
-        content.put(original_file_name, fileName);
         content.put(stored_file_name, stored_f_name);
         content.put(md5_checksum, md5Checksum);
         content.put(relative_path, relativePath);
         
     }
     
-    public FileRecord(String fileName, String stored_f_name, String md5Checksum, String relativePath, String vosuriStr) {
-        
-        content.put(original_file_name, fileName);
+    public FileRecord(String stored_f_name, String md5Checksum, String relativePath, String nodeIDStr) {
+
         content.put(stored_file_name, stored_f_name);
         content.put(md5_checksum, md5Checksum);
         content.put(relative_path, relativePath);
-        content.put(vosuri, vosuriStr);
+        content.put(nodeID, nodeIDStr);
         
     }
     
@@ -72,9 +68,8 @@ public class FileRecord {
         
     }
     
-    public void setFileRecord(String fileName, String stored_f_name, String md5Checksum, String relativePath) {
-        
-        content.put(original_file_name, fileName);
+    public void setFileRecord(String stored_f_name, String md5Checksum, String relativePath) {
+
         content.put(stored_file_name, stored_f_name);
         content.put(md5_checksum, md5Checksum);
         content.put(relative_path, relativePath);
diff --git a/src/main/java/it/inaf/oats/vospacebackend/implementation/TransferGeneratorImpl.java b/src/main/java/it/inaf/oats/vospacebackend/implementation/TransferGeneratorImpl.java
index c4460d1b80e9211445692c89ac6296d7d9e6ae5c..f1cd6d7b4b2c2cd1671849a4be5f8165a9881ff1 100644
--- a/src/main/java/it/inaf/oats/vospacebackend/implementation/TransferGeneratorImpl.java
+++ b/src/main/java/it/inaf/oats/vospacebackend/implementation/TransferGeneratorImpl.java
@@ -33,6 +33,8 @@ import java.util.ArrayList;
 import java.sql.*;
 
 import ca.nrc.cadc.net.TransientException;
+import ca.nrc.cadc.util.RsaSignatureGenerator;
+import ca.nrc.cadc.util.RsaSignatureVerifier;
 import ca.nrc.cadc.uws.Job;
 import ca.nrc.cadc.uws.Parameter;
 import ca.nrc.cadc.vos.Protocol;
@@ -40,11 +42,18 @@ import ca.nrc.cadc.vos.VOSURI;
 import ca.nrc.cadc.vos.View;
 import it.inaf.oats.vospacebackend.exceptions.ExceptionMessage;
 import it.inaf.oats.vospacebackend.exceptions.VOSpaceBackendException;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
 import java.sql.SQLException;
 import java.util.UUID;
 import java.util.logging.Level;
 import javax.sql.DataSource;
 
+import java.io.UnsupportedEncodingException;    
+import java.security.InvalidKeyException;
+import javax.servlet.ServletContext;
+import javax.xml.bind.DatatypeConverter;
+
 import org.apache.log4j.Logger;
 
 /**
@@ -73,23 +82,8 @@ public class TransferGeneratorImpl {
         // Get the node path, file name, vosuri
         String path = target.getPath();
         String fileName = target.getName();
-        String vosuri = target.toString();
-                        
-
-        // Generate the unique file identifier (storageFileID)
-        String unique_file_id_str = UUID.randomUUID().toString();
-        log.debug("Unique file identifyer " + unique_file_id_str);
-        
-        // Needs a couple of keys private and public
-        // The backend servlet should have access to the public key
-        
-        // the url must encapsulate a token/password generated here
-        // and which will be verified in the resource servlet
-        // the VOSURI which will be used by the beckend to do the new NODE(VOSURI)
-        // and to perform the node metadata staging
-        String security_token = "fake_token_jkshdcukckq";
-         
-        
+        String vosuri = target.toString();              
+        /*
         HashMap myMetadata;
         try {
             myMetadata = setPutRequest(unique_file_id_str, vosuri);
@@ -100,12 +94,8 @@ public class TransferGeneratorImpl {
                 log.debug("File Put Request NOT set, return null");
                 return null;
             }
-                
-        result.add(new URL("http://localhost/VOSpaceBackend/service/myResource/" 
-                               + security_token + "/"
-                               + unique_file_id_str + "/"
-                               + fileName));
             
+ 
         } catch (MalformedURLException e) {
             log.debug("Error parsing target");
             return null;            
@@ -113,12 +103,22 @@ public class TransferGeneratorImpl {
             java.util.logging.Logger.getLogger(TransferGeneratorImpl.class.getName()).log(Level.SEVERE, null, ex);
         } catch (SQLException ex) {
             java.util.logging.Logger.getLogger(TransferGeneratorImpl.class.getName()).log(Level.SEVERE, null, ex);
-        }  
-                
+        } 
+        */
+        
+        try {
+            String parametersToEncode = vosuri;
+            String encodedParams = manageParametersEncoding(parametersToEncode);
+            result.add(new URL("http://localhost/VOSpaceBackend/service/myResource/" + encodedParams));
+        } catch (MalformedURLException e) {
+            log.debug("Error parsing target");
+            return null;            
+        }
+    
         return result;
     }
     
-    
+/*    
     public HashMap getPutRequests(String stored_f_name) 
                                   throws VOSpaceBackendException, SQLException {
         
@@ -271,5 +271,71 @@ public class TransferGeneratorImpl {
         return connection;
     
     }
+    */
+    
+    private String manageParametersEncoding(String toBeSigned) {
+        
+        log.debug("toBeSignedInput  = " + toBeSigned);
+                
+        // Encription
+        RsaSignatureGenerator signatureGen = null;
+        try {
+            signatureGen = new RsaSignatureGenerator();
+        } catch (Exception e) {
+            log.debug("Exception creating   RsaSignatureGenerator" + e.getMessage() + "##############");  
+            e.printStackTrace();
+        }
+        
+        ByteArrayInputStream bais = null;
+        try {   
+            bais = new ByteArrayInputStream(toBeSigned.getBytes());
+        } catch (Exception e) {
+            log.debug("Exception creating   ByteArrayInputStream");       
+        }
+        
+        StringBuilder sb = new StringBuilder();
+        try { 
+            byte[] sig = signatureGen.sign(bais);
+            sb.append(new String(DatatypeConverter.printBase64Binary(sig)));
+        } catch (IOException ioe) {
+            log.debug("1111111111111");
+            log.debug(ioe.getMessage());
+        } catch (InvalidKeyException ike) {
+            log.debug("222222222222222");
+            log.debug(ike.getMessage());        
+        }
+        
+        log.debug("url encripted = " + sb.toString());
+        String signature = sb.toString();
+        
+        // Validation
+        /*
+        RsaSignatureVerifier su = new RsaSignatureVerifier();
+        boolean valid = false;
+        try {
+        valid = su.verify(new ByteArrayInputStream(toBeSigned.getBytes()),
+                    DatatypeConverter.parseBase64Binary(signature));
+        } catch (IOException ioe) {
+            log.debug("2");
+            log.debug(ioe.getMessage());
+        } catch (InvalidKeyException ike) {
+            log.debug("2");           
+            log.debug(ike.getMessage());       
+        }
+        if (valid)
+            log.debug("VALID");
+        else
+            log.debug("BUGGY WORK!");
+        */
+        String finalStr = toBeSigned + "|" + signature;
+        log.debug("originalParams = " + finalStr); 
+        log.debug("Message = " + toBeSigned);
+        log.debug("Signature = " + signature);
+        finalStr = DatatypeConverter.printBase64Binary(finalStr.getBytes());
+        
+        return finalStr;
+        
+    }
+
 
 }
diff --git a/src/main/java/it/inaf/oats/vospacebackend/implementation/TransferJobManager.java b/src/main/java/it/inaf/oats/vospacebackend/implementation/TransferJobManager.java
new file mode 100644
index 0000000000000000000000000000000000000000..beb07dc1583b9be480e18110c40df3b6a5c9dd96
--- /dev/null
+++ b/src/main/java/it/inaf/oats/vospacebackend/implementation/TransferJobManager.java
@@ -0,0 +1,38 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package it.inaf.oats.vospacebackend.implementation;
+
+import ca.nrc.cadc.uws.server.JobExecutor;
+import ca.nrc.cadc.uws.server.SimpleJobManager;
+import ca.nrc.cadc.uws.server.ThreadPoolExecutor;
+import ca.nrc.cadc.vos.server.transfers.TransferRunner;
+
+/**
+ *
+ * @author bertocco
+ */
+public class TransferJobManager extends SimpleJobManager {
+    
+    public TransferJobManager() {
+        
+        super();
+        Long MAX_EXEC_DURATION = new Long(600L);;
+        Long MAX_DESTRUCTION = new Long(1L+MAX_EXEC_DURATION);
+        Long MAX_QUOTE = new Long(600L);
+        
+        DatabaseJobPersistenceImpl jobPersist = new DatabaseJobPersistenceImpl();
+        //this.config = jobPersist.getJobSchema();
+        
+        // exec jobs in in new thread using our custom TransferRunner
+        JobExecutor jobExec = new ThreadPoolExecutor(jobPersist, TransferRunner.class, 6);
+
+        super.setJobPersistence(jobPersist);
+        super.setJobExecutor(jobExec);
+        super.setMaxExecDuration(MAX_EXEC_DURATION);
+        super.setMaxDestruction(MAX_DESTRUCTION);
+        super.setMaxQuote(MAX_QUOTE);
+    }
+}
diff --git a/src/main/java/it/inaf/oats/vospacebackend/implementation/VOSpaceBackMetadata.java b/src/main/java/it/inaf/oats/vospacebackend/implementation/VOSpaceBackMetadata.java
index ad819be0a3a26a019b468ca1bc1d6c1908eedcf8..05e17ce49205c3cbb224f82588cbbce8fe849d77 100644
--- a/src/main/java/it/inaf/oats/vospacebackend/implementation/VOSpaceBackMetadata.java
+++ b/src/main/java/it/inaf/oats/vospacebackend/implementation/VOSpaceBackMetadata.java
@@ -88,15 +88,15 @@ public class VOSpaceBackMetadata {
      * @return boolean true if operation successful false if not
      * @throws VOSpaceBackendException
      */
-    public HashMap setFile(String fileName, String stored_f_name, String md5Checksum, 
+    public HashMap setFile(String stored_f_name, String md5Checksum, 
                          String relativePath) 
                                   throws VOSpaceBackendException, SQLException {
        
         String myOp = "SET";
-        String myQuery = "INSERT INTO vosbackend.StoredFiles " +
-                "(original_file_name, stored_file_name, md5_checksum, relative_path)" +
-                " VALUES (?, ?, ?, ?);";
-        FileRecord myParams = new FileRecord(fileName, stored_f_name,
+        String myQuery = "INSERT INTO cadctest.StoredFiles " +
+                "(stored_file_name, md5_checksum, relative_path)" +
+                " VALUES (?, ?, ?);";
+        FileRecord myParams = new FileRecord(stored_f_name,
                                                     md5Checksum, relativePath);
         
         
@@ -111,10 +111,10 @@ public class VOSpaceBackMetadata {
         
         String myOp = "GET";
         
-        String myQuery = "SELECT * FROM vosbackend.StoredFiles " +
+        String myQuery = "SELECT * FROM cadctest.StoredFiles " +
                 "WHERE original_file_name=?";
         
-        FileRecord myParams = new FileRecord(orig_f_name, "", "", "");
+        FileRecord myParams = new FileRecord(orig_f_name, "", "");
         
         myResult = excuteQuery(myOp, myQuery, myParams);
         
@@ -126,9 +126,9 @@ public class VOSpaceBackMetadata {
                                   throws VOSpaceBackendException, SQLException {
         
         String myOp = "DELETE";
-        String myQuery = "DELETE FROM vosbackend.StoredFiles WHERE original_file_name=?";
+        String myQuery = "DELETE FROM cadctest.StoredFiles WHERE original_file_name=?";
         
-        FileRecord myParams = new FileRecord(orig_f_name, "", "", "");
+        FileRecord myParams = new FileRecord(orig_f_name, "", "");
         
         myResult = excuteQuery(myOp, myQuery, myParams);
         
@@ -137,15 +137,15 @@ public class VOSpaceBackMetadata {
     }
     
     
-    public HashMap getPutRequests(String stored_f_name) 
+    public HashMap getPutRequest(String stored_f_name) 
                                   throws VOSpaceBackendException, SQLException {
         
         String myOp = "GET_PUT_REQ";
         
-        String myQuery = "SELECT * FROM vosbackend.RequestedPuts " +
+        String myQuery = "SELECT * FROM cadctest.NodeStoredFileAndNode " +
                 "WHERE storedFileID=?";
         
-        FileRecord myParams = new FileRecord("", stored_f_name, "", "");
+        FileRecord myParams = new FileRecord(stored_f_name, "", "", "");
         
         myResult = excuteQuery(myOp, myQuery, myParams);
         
@@ -154,14 +154,14 @@ public class VOSpaceBackMetadata {
     }
     
     
-    public HashMap setPutRequest(String stored_f_name, String vosuriStr) 
+    public HashMap setPutRequest(String stored_f_name, String nodeID) 
                                   throws VOSpaceBackendException, SQLException {
        
         String myOp = "SET_PUT_REQ";
-        String myQuery = "INSERT INTO vosbackend.PutRequests " +
-                "(storedFileID, vosuri)" +
+        String myQuery = "INSERT INTO cadctest.NodeStoredFileAndNode " +
+                "(nodeID, storedFileID)" +
                 " VALUES (?, ?);";
-        FileRecord myParams = new FileRecord("", stored_f_name, "", "", vosuriStr);
+        FileRecord myParams = new FileRecord(stored_f_name, "", "", nodeID);
         
         
         myResult = excuteQuery(myOp, myQuery, myParams);
@@ -172,6 +172,7 @@ public class VOSpaceBackMetadata {
     
     private HashMap excuteQuery(String operation, String query, FileRecord fileToStore) 
                                                 throws VOSpaceBackendException, SQLException {
+        
         PreparedStatement preparedStatementInsert = null;
        
         Connection dbConnection = null;
@@ -205,10 +206,9 @@ public class VOSpaceBackMetadata {
                 case "SET":
                     log.debug("Going to prepare query for SET operation");
                     preparedQuery = dbConnection.prepareStatement(query);
-                    preparedQuery.setString(1, (String)fileToStoreFields.get("original_file_name"));
-                    preparedQuery.setString(2, (String)fileToStoreFields.get("stored_file_name"));
-                    preparedQuery.setString(3, (String)fileToStoreFields.get("md5_checksum"));
-                    preparedQuery.setString(4, (String)fileToStoreFields.get("relative_path")); 
+                    preparedQuery.setString(1, (String)fileToStoreFields.get("stored_file_name"));
+                    preparedQuery.setString(2, (String)fileToStoreFields.get("md5_checksum"));
+                    preparedQuery.setString(3, (String)fileToStoreFields.get("relative_path")); 
                     log.debug("Going to execute query");
                     preparedQuery.executeUpdate();
                     log.debug("Query executed");
@@ -245,14 +245,14 @@ public class VOSpaceBackMetadata {
                     break;
                 case "GET_PUT_REQ":
                     preparedQuery = dbConnection.prepareStatement(query);
-                    preparedQuery.setString(1, (String)fileToStoreFields.get("stored_file_name"));
-                    preparedQuery.setString(1, (String)fileToStoreFields.get("vosuri"));
+                    preparedQuery.setString(1, (String)fileToStoreFields.get("nodeID"));
+                    preparedQuery.setString(2, (String)fileToStoreFields.get("stored_file_name"));
                     rs = preparedQuery.executeQuery();
                     rowCounter = 0;
                     while (rs.next()) {
                         rowCounter = rowCounter +1;
-                        myResult.put("stored_file_name", rs.getString("storedFileID"));
-                        myResult.put("vosuri", rs.getString("vosuri"));
+                        myResult.put("stored_file_name", rs.getString("stored_file_name"));
+                        myResult.put("nodeID", rs.getString("nodeID"));
                     }
                     if (rowCounter == 0) {
                         log.debug("GET_PUT_REQ: query successfully executed. File " + (String)fileToStoreFields.get("stored_file_name") + " not found");                      
@@ -265,9 +265,8 @@ public class VOSpaceBackMetadata {
                 case "SET_PUT_REQ":                   
                     log.debug("Going to prepare query for SET operation");
                     preparedQuery = dbConnection.prepareStatement(query);
-                    preparedQuery.setString(1, (String)fileToStoreFields.get("stored_file_name"));
-                    preparedQuery.setString(3, (String)fileToStoreFields.get("md5_checksum"));
-                    preparedQuery.setString(4, (String)fileToStoreFields.get("relative_path")); 
+                    preparedQuery.setString(1, (String)fileToStoreFields.get("nodeID"));
+                    preparedQuery.setString(2, (String)fileToStoreFields.get("stored_file_name"));
                     log.debug("Going to execute query");
                     preparedQuery.executeUpdate();
                     log.debug("Query executed");
@@ -325,7 +324,7 @@ public class VOSpaceBackMetadata {
         try {
             Context initContext = new InitialContext();
             Context envContext = (Context) initContext.lookup("java:comp/env");
-            String vosNodesDataSourceName = "jdbc/vosbackend";
+            String vosNodesDataSourceName = "jdbc/cadctest";
             ds = (DataSource) envContext.lookup(vosNodesDataSourceName);
         } catch (NamingException ex) {
             log.fatal(ex);
diff --git a/src/main/java/it/inaf/oats/vospacebackend/implementation/VOSpaceBackPosix.java b/src/main/java/it/inaf/oats/vospacebackend/implementation/VOSpaceBackPosix.java
index 167ae7f696b63598d127094195a3a236f6b6ae7d..3eda2358c890a28262a37bde8c772a21d1ed2fe3 100644
--- a/src/main/java/it/inaf/oats/vospacebackend/implementation/VOSpaceBackPosix.java
+++ b/src/main/java/it/inaf/oats/vospacebackend/implementation/VOSpaceBackPosix.java
@@ -25,13 +25,18 @@
 
 package it.inaf.oats.vospacebackend.implementation;
 
+import ca.nrc.cadc.net.TransientException;
+import ca.nrc.cadc.util.FileMetadata;
+import ca.nrc.cadc.vos.DataNode;
 import it.inaf.oats.vospacebackend.exceptions.ExceptionMessage;
 import it.inaf.oats.vospacebackend.exceptions.VOSpaceBackendException;
 import it.inaf.oats.vospacebackend.utils.ConfigReader;
 
 import ca.nrc.cadc.vos.Node;
+import ca.nrc.cadc.vos.server.NodeID;
 import ca.nrc.cadc.vos.VOSURI;
 import ca.nrc.cadc.vos.NodeNotFoundException;
+import ca.nrc.cadc.vos.VOS;
 
 import java.sql.SQLException;
 import java.io.File;
@@ -39,6 +44,7 @@ import java.io.IOException;
 import java.text.MessageFormat;
 import java.util.HashMap;
 import java.util.UUID;
+import java.util.logging.Level;
 
 import org.apache.log4j.Logger;
 import org.apache.commons.io.FileUtils;
@@ -74,41 +80,53 @@ public class VOSpaceBackPosix implements VOSpaceBackend {
     }
     
 
-    public boolean createFile(String orig_f_name, String tmp_file, String md5_sum) 
+    public boolean createFile(String vosuri, String tmp_file, String md5_sum) 
                            throws VOSpaceBackendException, SQLException, IOException {
         
+        log.debug("Entering in vospacebackendposix.createfile");
         VOSpaceBackMetadata metadata = new VOSpaceBackMetadata();
         
+        log.debug("md5_checksum received in backendposix.createFile : " + md5_sum);
         String relativePath = this.createPathFromString(md5_sum);
         
-        // Gets metadata on frontend
-        HashMap putReqData = metadata.getPutRequests(tmp_file);    
-        DatabaseNodePersistenceExt dbNodePers;
-        Node myNode;
-        boolean myresult = (boolean)putReqData.get("ifSuccessful");
-        if(myresult) {
-            String vosuri = (String)putReqData.get("vosuri");
-            dbNodePers = new DatabaseNodePersistenceExt();
-            try {
-                myNode = dbNodePers.get(new VOSURI(vosuri));
-            } catch (NodeNotFoundException e) {
-                log.debug("Node not found. Need to abort the operation");
-            } catch (Exception e) {
-                log.debug("Node not found. Need to abort the operation");
-            }
-            
-        } else 
-            log.debug("File frontend metadata NOT retrieved. Need to abort the operation");
+        // Gets metadata on frontend   
+        DatabaseNodePersistenceExt dbNodePers = new DatabaseNodePersistenceExt();
+        Node myNode = null;
+        try {
+            myNode = dbNodePers.get(new VOSURI(vosuri));
+        } catch (Exception e) {
+            log.debug("Exception getting node from persistence.");
+        }
+        NodeID nodeID = (NodeID)myNode.appData;
+        Long myNodeID = nodeID.getID();
+        
+        if (!(myNode instanceof DataNode)) {
+            log.debug("Node instance NOT found");
+            throw new VOSpaceBackendException("Node instance NOT found");
+        } 
         
-        // Needs syncronisation BEGIN
-        // Set busy state HOW ???
+        DataNode myDataNode = (DataNode)myNode;
         
-        // Set metadata on frontend
-        // HERE SET NODE - HOW ???
         
         
+        try {
+            // Needs syncronisation BEGIN
+            dbNodePers.setBusyState(myDataNode, VOS.NodeBusyState.notBusy, VOS.NodeBusyState.busyWithWrite);
+        } catch (TransientException ex) {
+            log.debug("TransientException in dbNodePers.setBusyState");
+            java.util.logging.Logger.getLogger(VOSpaceBackPosix.class.getName()).log(Level.SEVERE, null, ex);
+            throw new VOSpaceBackendException("TransientException in dbNodePers.setBusyState");
+        }
+        HashMap putReqData = metadata.setPutRequest(tmp_file, myNodeID.toString()); 
+        
+        boolean myresult = (boolean)putReqData.get("ifSuccessful");
+        if(!myresult) {
+            log.debug("Fails updating table NodeStoredFileAndNode");
+            throw new VOSpaceBackendException("Node instance NOT found");
+        }   
+        
         // sets backend metadata
-        HashMap fileMetadata = metadata.setFile(orig_f_name, tmp_file, md5_sum, relativePath);
+        HashMap fileMetadata = metadata.setFile(tmp_file, md5_sum, relativePath);
         
         // Writes the file on the file system
         boolean result = (boolean)fileMetadata.get("ifSuccessful");
@@ -117,7 +135,19 @@ public class VOSpaceBackPosix implements VOSpaceBackend {
             this.fileFromTmpToFinalStorageArea(tmp_file, relativePath, "MOVE"); 
         } else
             log.debug("File backend metadata NOT saved. Need to abort the operation");
-        
+        // Set front-end metadata and not busy
+        FileMetadata nodeMetadata = new FileMetadata();
+        nodeMetadata.setMd5Sum(md5_sum);
+        // INSERT A CORRECT FileSize !!!!!!!!!!!!!!!!!!!!
+        nodeMetadata.setContentLength(345678L);
+        //nodeMetadata.setContentLength("file_size");
+        try {
+            dbNodePers.setFileMetadata(myDataNode, nodeMetadata, false);
+        } catch (Exception e) {
+            log.debug("Exception doing databasePersistence.setFileMetadat.");
+            throw new VOSpaceBackendException("Node instance NOT found");
+        }
+   
         // Needs syncronisation END
         return result;
                    
diff --git a/src/main/java/it/inaf/oats/vospacebackend/implementation/VOSpaceBackend.java b/src/main/java/it/inaf/oats/vospacebackend/implementation/VOSpaceBackend.java
index dc7f32ae6bd1e397345b02392019a2d6ddd2344b..449bfdf42a87521c65bd4fa540a27df4a44777f4 100644
--- a/src/main/java/it/inaf/oats/vospacebackend/implementation/VOSpaceBackend.java
+++ b/src/main/java/it/inaf/oats/vospacebackend/implementation/VOSpaceBackend.java
@@ -35,7 +35,7 @@ import java.sql.SQLException;
  */
 public interface VOSpaceBackend {
     
-    public boolean createFile(String orig_f_name, String tmp_file, String md5_sum) 
+    public boolean createFile(String vosuri, String tmp_file, String md5_sum) 
                       throws VOSpaceBackendException, SQLException, IOException;
     
     public File returnFile(String orig_f_name)
diff --git a/src/main/java/sql/create_vospace_backend.sql b/src/main/java/sql/create_vospace_backend.sql
index db455548f1e0da1ee2132060551f15832bca6aad..ef96111d1128c7e4df619425e651f0213df5913a 100644
--- a/src/main/java/sql/create_vospace_backend.sql
+++ b/src/main/java/sql/create_vospace_backend.sql
@@ -32,19 +32,16 @@ grant all on vosbackend.* to 'vosbackadmin' identified by 'Peper0ne';
 CREATE TABLE StoredFiles
 (
     fileID int NOT NULL AUTO_INCREMENT, 
-    original_file_name varchar(255) NOT NULL,
     stored_file_name varchar(36) NOT NULL,
     md5_checksum varchar(36) NOT NULL,
     relative_path varchar(8),
     PRIMARY KEY (fileID)
 ) ENGINE=InnoDB; 
 
-ALTER TABLE StoredFiles ADD INDEX f_name (original_file_name);
-
-CREATE TABLE RequestedPuts
-(
-    storedFileID varchar(255) NOT NULL, 
-    vosuri varchar(255) NOT NULL,
+CREATE TABLE NodeStoredFileAndNode
+(    
+    storedFileID       varchar(255)         NOT NULL,
+    nodeID            BIGINT(20)           NOT NULL, 
     PRIMARY KEY (storedFileID)
 ) ENGINE=InnoDB; 
 
diff --git a/src/main/java/test/log4j.properties b/src/main/java/test/log4j.properties
new file mode 100644
index 0000000000000000000000000000000000000000..4579c25d3146902f842648953c9f95cde2e42d62
--- /dev/null
+++ b/src/main/java/test/log4j.properties
@@ -0,0 +1,8 @@
+# Root logger option
+log4j.rootLogger=DEBUG, stdout
+
+# Direct log messages to stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
diff --git a/src/main/webapp/META-INF/context.xml b/src/main/webapp/META-INF/context.xml
index 63add891fa224dec619ec4b794f866c1ab43d52e..e31741774ba8855c1973d63b852672a1c8da8789 100644
--- a/src/main/webapp/META-INF/context.xml
+++ b/src/main/webapp/META-INF/context.xml
@@ -28,7 +28,7 @@
 
    <Context path="/vospaceBackend" docBase="vospace"
               crossContext="true" reloadable="true" debug="1">
-
+<!--
        <Resource name="jdbc/vosbackend"
                  auth="Container"
                  type="javax.sql.DataSource"
@@ -38,4 +38,16 @@
                  maxActive="10"
                  maxWait="-1"
                  maxIdle="4" />
+ -->    
+   
+        <Resource name="jdbc/cadctest"
+                 auth="Container"
+                 type="javax.sql.DataSource"
+                 username="oatsops" password="Peper0ne"
+                 driverClassName="com.mysql.jdbc.Driver"
+                 url="jdbc:mysql://localhost/cadctest"
+                 maxActive="10"
+                 maxWait="-1"
+                 maxIdle="4" />
+           
    </Context>
diff --git a/target/VOSpaceBackend-0.0.war b/target/VOSpaceBackend-0.0.war
index 77ad3ac45a482f971da253ccd47045c2edf7c2e3..29dcea585e7831f2bf30c2adbe2ae68dd3e6adc0 100644
Binary files a/target/VOSpaceBackend-0.0.war and b/target/VOSpaceBackend-0.0.war differ
diff --git a/target/VOSpaceBackend-0.0/META-INF/context.xml b/target/VOSpaceBackend-0.0/META-INF/context.xml
index 63add891fa224dec619ec4b794f866c1ab43d52e..e31741774ba8855c1973d63b852672a1c8da8789 100644
--- a/target/VOSpaceBackend-0.0/META-INF/context.xml
+++ b/target/VOSpaceBackend-0.0/META-INF/context.xml
@@ -28,7 +28,7 @@
 
    <Context path="/vospaceBackend" docBase="vospace"
               crossContext="true" reloadable="true" debug="1">
-
+<!--
        <Resource name="jdbc/vosbackend"
                  auth="Container"
                  type="javax.sql.DataSource"
@@ -38,4 +38,16 @@
                  maxActive="10"
                  maxWait="-1"
                  maxIdle="4" />
+ -->    
+   
+        <Resource name="jdbc/cadctest"
+                 auth="Container"
+                 type="javax.sql.DataSource"
+                 username="oatsops" password="Peper0ne"
+                 driverClassName="com.mysql.jdbc.Driver"
+                 url="jdbc:mysql://localhost/cadctest"
+                 maxActive="10"
+                 maxWait="-1"
+                 maxIdle="4" />
+           
    </Context>
diff --git a/target/VOSpaceBackend-0.0/WEB-INF/classes/sql/create_vospace_backend.sql b/target/VOSpaceBackend-0.0/WEB-INF/classes/sql/create_vospace_backend.sql
index db455548f1e0da1ee2132060551f15832bca6aad..ef96111d1128c7e4df619425e651f0213df5913a 100644
--- a/target/VOSpaceBackend-0.0/WEB-INF/classes/sql/create_vospace_backend.sql
+++ b/target/VOSpaceBackend-0.0/WEB-INF/classes/sql/create_vospace_backend.sql
@@ -32,19 +32,16 @@ grant all on vosbackend.* to 'vosbackadmin' identified by 'Peper0ne';
 CREATE TABLE StoredFiles
 (
     fileID int NOT NULL AUTO_INCREMENT, 
-    original_file_name varchar(255) NOT NULL,
     stored_file_name varchar(36) NOT NULL,
     md5_checksum varchar(36) NOT NULL,
     relative_path varchar(8),
     PRIMARY KEY (fileID)
 ) ENGINE=InnoDB; 
 
-ALTER TABLE StoredFiles ADD INDEX f_name (original_file_name);
-
-CREATE TABLE RequestedPuts
-(
-    storedFileID varchar(255) NOT NULL, 
-    vosuri varchar(255) NOT NULL,
+CREATE TABLE NodeStoredFileAndNode
+(    
+    storedFileID       varchar(255)         NOT NULL,
+    nodeID            BIGINT(20)           NOT NULL, 
     PRIMARY KEY (storedFileID)
 ) ENGINE=InnoDB; 
 
diff --git a/target/VOSpaceBackend-0.0/WEB-INF/lib/cadcUtil-0.0.jar b/target/VOSpaceBackend-0.0/WEB-INF/lib/cadcUtil-0.0.jar
index 459dd73a7cd91bd2fe1b9c8ecfa738d8764bab6d..8740546de2a01670ba15a1c68dee53078a2fb522 100644
Binary files a/target/VOSpaceBackend-0.0/WEB-INF/lib/cadcUtil-0.0.jar and b/target/VOSpaceBackend-0.0/WEB-INF/lib/cadcUtil-0.0.jar differ
diff --git a/target/classes/sql/create_vospace_backend.sql b/target/classes/sql/create_vospace_backend.sql
index db455548f1e0da1ee2132060551f15832bca6aad..ef96111d1128c7e4df619425e651f0213df5913a 100644
--- a/target/classes/sql/create_vospace_backend.sql
+++ b/target/classes/sql/create_vospace_backend.sql
@@ -32,19 +32,16 @@ grant all on vosbackend.* to 'vosbackadmin' identified by 'Peper0ne';
 CREATE TABLE StoredFiles
 (
     fileID int NOT NULL AUTO_INCREMENT, 
-    original_file_name varchar(255) NOT NULL,
     stored_file_name varchar(36) NOT NULL,
     md5_checksum varchar(36) NOT NULL,
     relative_path varchar(8),
     PRIMARY KEY (fileID)
 ) ENGINE=InnoDB; 
 
-ALTER TABLE StoredFiles ADD INDEX f_name (original_file_name);
-
-CREATE TABLE RequestedPuts
-(
-    storedFileID varchar(255) NOT NULL, 
-    vosuri varchar(255) NOT NULL,
+CREATE TABLE NodeStoredFileAndNode
+(    
+    storedFileID       varchar(255)         NOT NULL,
+    nodeID            BIGINT(20)           NOT NULL, 
     PRIMARY KEY (storedFileID)
 ) ENGINE=InnoDB; 
 
diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties
index 51ac6fbdf41bf132866e6fc0746b3cd767500704..d325db511932573ead743e4e586bdab5b6161dd7 100644
--- a/target/maven-archiver/pom.properties
+++ b/target/maven-archiver/pom.properties
@@ -1,5 +1,5 @@
 #Generated by Maven
-#Tue May 24 19:51:21 PDT 2016
+#Fri May 27 15:09:07 PDT 2016
 version=0.0
 groupId=it.inaf.oats
 artifactId=VOSpaceBackend