Started with the separated DB with the given code
[RRRRHHHH_Code] / ruralHouses / src / domain / Account.java
index ee67f15..989440c 100644 (file)
@@ -5,6 +5,7 @@ import java.util.Arrays;
 
 import businessLogic.SecurityManager;
 
+
 public class Account implements Serializable {
 
        /**
@@ -16,25 +17,15 @@ public class Account implements Serializable {
        private byte[] username;
        private byte[] password;
        private byte[] salt;
-
-
        private Owner owner;
        private boolean admin = false;
 
-       
+
        public Account(byte[] usr){
                this.username = usr;
                this.salt =null;
                this.password = null;
                this.owner = null;
-               
-       }
-       public Account(Owner own){
-               this.username = null;
-               this.salt =null;
-               this.password = null;
-               this.owner = own;
-               
        }
        public Account(String usr, String pass, boolean isAdmin) {
                this.username = SecurityManager.getInstance().calculateHash(usr);
@@ -42,7 +33,13 @@ public class Account implements Serializable {
                this.password = SecurityManager.getInstance().calculateSaltedHash(pass.toCharArray(), this.salt);
                this.owner = null;
                this.admin = isAdmin;
-
+       }
+       
+       public Account(Owner own){
+               this.username = null;
+               this.salt =null;
+               this.password = null;
+               this.owner = own;
        }
 
        public Account(String usr, String pass, Owner ow) {
@@ -55,7 +52,9 @@ public class Account implements Serializable {
 
        }
 
+
        
+
        public byte[] getUsername() {
                return username;
        }
@@ -72,6 +71,7 @@ public class Account implements Serializable {
                return admin;
        }
 
+       
        public void setAdmin(boolean admin) {
                this.admin = admin;
        }