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 3aa93f7d653239df98aa363bba29f8fe5eadd523..26465ed8f4a93d6232fc1a0a5615951f26337565 100644 --- a/src/main/java/it/inaf/oats/vospacebackend/implementation/FileRecord.java +++ b/src/main/java/it/inaf/oats/vospacebackend/implementation/FileRecord.java @@ -1,4 +1,5 @@ -/**_____________________________________________________________________________ +/** + * _____________________________________________________________________________ * * OATS - INAF * Osservatorio Astronomico di Tireste - Istituto Nazionale di Astrofisica @@ -6,7 +7,7 @@ * ____________________________________________________________________________ * * Copyright (C) 20016 Istituto Nazionale di Astrofisica - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -18,63 +19,119 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, Inc., + * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * _____________________________________________________________________________ - **/ + * + */ package it.inaf.oats.vospacebackend.implementation; import java.util.HashMap; - public class FileRecord { + + //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 nodeID = "nodeID"; + //private static final String operationSuccessful = "ifSuccessful"; - 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 nodeID = "nodeID"; - - private HashMap content = new HashMap<String, String>(); - - public FileRecord() { + private String stored_file_name_value; + private String md5_checksum_value; + private String relative_path_value; + private String nodeID_value; + private boolean operationSuccessful_value; + + public FileRecord() { - content.put(stored_file_name, ""); - content.put(md5_checksum, ""); - content.put(relative_path, ""); - content.put(nodeID, ""); + stored_file_name_value = ""; + md5_checksum_value = ""; + relative_path_value = ""; + nodeID_value = ""; + operationSuccessful_value = false; + + } + + public void setFileRecord(String stored_f_name, String md5Checksum, + String relativePath, String nodeId, boolean ifSuccessful) { + + this.stored_file_name_value = stored_f_name; + this.md5_checksum_value = md5Checksum; + this.relative_path_value = relativePath; + this.nodeID_value = nodeId; + this.operationSuccessful_value = ifSuccessful; + + } + + public void setStoredfileName(String storedfName) { + + this.stored_file_name_value = storedfName; } - - public FileRecord(String stored_f_name, String md5Checksum, String relativePath) { + + public String getStoredfileName() { + + return this.stored_file_name_value; - content.put(stored_file_name, stored_f_name); - content.put(md5_checksum, md5Checksum); - content.put(relative_path, relativePath); + } + + public void setMD5Checksum(String md5checksum) { + + this.md5_checksum_value = md5checksum; } - - 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(nodeID, nodeIDStr); + public String getMD5Checksum() { + + return this.md5_checksum_value; } - - public HashMap getFileRecord() { + + public void setRelativePath(String relativePath) { - return content; + this.relative_path_value = relativePath; } - - 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); + public String getRelativePath() { + + return this.relative_path_value; + + } + + public void setNodeId(String nodeId) { + + this.nodeID_value = nodeId; + + } + + public String getNodeId() { + + return this.nodeID_value; } - -} + public boolean getIfOperationSuccessful() { + + return this.operationSuccessful_value; + + } + + public void setIfOperationSuccessful(boolean ifSuccess) { + + this.operationSuccessful_value = ifSuccess; + } + + public String toString() { + + String res = "FileRecord: \nstored_file_name = " + getStoredfileName() + "\n" + + "md5_checksum = " + getMD5Checksum() + "\n" + + "relative_path = " + getRelativePath() + "\n" + + "nodeID = " + getNodeId() + "\n" + + "operationSuccessful = " + getIfOperationSuccessful() + "\n"; + + return res; + + } + +}