]> git.mxchange.org Git - addressbook-lib.git/commitdiff
Continued:
authorRoland Haeder <roland@mxchange.org>
Thu, 22 Oct 2015 09:07:53 +0000 (11:07 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 22 Oct 2015 09:11:19 +0000 (11:11 +0200)
- added timestamp when the address book has been locked and reason
- added creation timestamp + user  parameters to constructor
- default status is UNLOCKED now
- updated jar(s)

Signed-off-by:Roland Häder <roland@mxchange.org>

lib/jcontacts-business-core.jar
lib/jcontacts-core.jar
lib/jcountry-core.jar
lib/jphone-core.jar
lib/juser-core.jar
src/org/mxchange/addressbook/model/addressbook/Addressbook.java
src/org/mxchange/addressbook/model/addressbook/UserAddressbook.java

index 0fe8af59887fac4e9ca050a8d5b51878e29999b2..20fa3745a1fd031cd1e06ab42ff53330983d49ef 100644 (file)
Binary files a/lib/jcontacts-business-core.jar and b/lib/jcontacts-business-core.jar differ
index 6b3619e1b879be6ab4b7b20ecf765dde842559b6..39ba8b2afd0485a67193d21df02299ba987fe176 100644 (file)
Binary files a/lib/jcontacts-core.jar and b/lib/jcontacts-core.jar differ
index 234d3fbe4b8bfd5ad614a4b2509deb29ba454fef..28024eeb45e65d2334a4e91585545cbe4004aa66 100644 (file)
Binary files a/lib/jcountry-core.jar and b/lib/jcountry-core.jar differ
index a5d222b5e458841311e097be654fba5408b3bc86..e5c2573169bfc234a14736809e9df575171e2584 100644 (file)
Binary files a/lib/jphone-core.jar and b/lib/jphone-core.jar differ
index 250549b88c0f7b748202c4f70c205928268eaf2f..1bd555dcbee0a4ab63c5f9ebbdb2abe1ea0e0564 100644 (file)
Binary files a/lib/juser-core.jar and b/lib/juser-core.jar differ
index 536cdb82fb61144fcde7935b0e0eb7834e188a16..f3e66933c3ea31e46a2c676aadc6a929109d1a0f 100644 (file)
@@ -98,9 +98,37 @@ public interface Addressbook extends Serializable {
         */
        void setAddressbookUser (final User addressbookUser);
 
+       /**
+        * Getter for last locked timestamp
+        * <p>
+        * @return Last locked timestamp
+        */
+       Calendar getAddressbookLastLocked ();
+
+       /**
+        * Setter for last locked timestamp
+        * <p>
+        * @param addressbookLastLocked Last locked timestamp
+        */
+       void setAddressbookLastLocked (final Calendar addressbookLastLocked);
+
+       /**
+        * Getter for last locked reason
+        * <p>
+        * @return Last locked reason
+        */
+       String getAddressbookLastLockedReason ();
+
+       /**
+        * Getter for last locked reason
+        * <p>
+        * @param addressbookLastLockedReason Last locked reason
+        */
+       void setAddressbookLastLockedReason (final String addressbookLastLockedReason);
+
        @Override
-        boolean equals (final Object object);
+       boolean equals (final Object object);
 
        @Override
-        int hashCode ();
+       int hashCode ();
 }
index 82dc36d8181a58f70032e98e8252ad8edf66e6c4..fe9a5c34b6f0f1fdd5006c8c1813bd0142e5ac2a 100644 (file)
@@ -28,6 +28,7 @@ import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.JoinColumn;
+import javax.persistence.Lob;
 import javax.persistence.NamedQueries;
 import javax.persistence.NamedQuery;
 import javax.persistence.OneToOne;
@@ -97,47 +98,43 @@ public class UserAddressbook implements Addressbook, Comparable<Addressbook> {
        @OneToOne (targetEntity = LoginUser.class, optional = false, cascade = CascadeType.MERGE)
        private User addressbookUser;
 
+       /**
+        * Last locked timestamp
+        */
+       @Temporal (TemporalType.TIMESTAMP)
+       @Column (name = "addressbook_last_locked")
+       private Calendar addressbookLastLocked;
+
+       /**
+        * Last locked timestamp
+        */
+       @Lob
+       @Column (name = "addressbook_last_locked_reason")
+       private String addressbookLastLockedReason;
+
        /**
         * Public constructor with address book name
         * <p>
         * @param addressbookName Address book name
+        * @param addressbookUser User instance
+        * @param addressbookCreated When this entry has been created
         */
-       public UserAddressbook (final String addressbookName) {
+       public UserAddressbook (final String addressbookName, final User addressbookUser, final Calendar addressbookCreated) {
                // Call default constructor
                this();
 
-               // Set name
+               // Set name, user instance and creation timestamp
                this.addressbookName = addressbookName;
+               this.addressbookUser = addressbookUser;
+               this.addressbookCreated = addressbookCreated;
        }
 
        /**
         * Default protected constructor
         */
        protected UserAddressbook () {
-       }
-
-       @Override
-       public int compareTo (final Addressbook addressbook) {
-               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-       }
-
-       @Override
-       public boolean equals (final Object object) {
-               if (object == null) {
-                       return false;
-               } else if (getClass() != object.getClass()) {
-                       return false;
-               }
-
-               final Addressbook other = (Addressbook) object;
-
-               if (!Objects.equals(this.getAddressbookName(), other.getAddressbookName())) {
-                       return false;
-               } else if (!Objects.equals(this.getAddressbookUser(), other.getAddressbookUser())) {
-                       return false;
-               }
-
-               return true;
+               // Set status to UNLOCKED
+               this.addressbookStatus = AddressbokStatus.UNLOCKED;
        }
 
        @Override
@@ -160,6 +157,26 @@ public class UserAddressbook implements Addressbook, Comparable<Addressbook> {
                this.addressbookId = addressbookId;
        }
 
+       @Override
+       public Calendar getAddressbookLastLocked () {
+               return this.addressbookLastLocked;
+       }
+
+       @Override
+       public void setAddressbookLastLocked (final Calendar addressbookLastLocked) {
+               this.addressbookLastLocked = addressbookLastLocked;
+       }
+
+       @Override
+       public String getAddressbookLastLockedReason () {
+               return this.addressbookLastLockedReason;
+       }
+
+       @Override
+       public void setAddressbookLastLockedReason (final String addressbookLastLockedReason) {
+               this.addressbookLastLockedReason = addressbookLastLockedReason;
+       }
+
        @Override
        public String getAddressbookName () {
                return this.addressbookName;
@@ -190,6 +207,30 @@ public class UserAddressbook implements Addressbook, Comparable<Addressbook> {
                this.addressbookUser = addressbookUser;
        }
 
+       @Override
+       public int compareTo (final Addressbook addressbook) {
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       }
+
+       @Override
+       public boolean equals (final Object object) {
+               if (object == null) {
+                       return false;
+               } else if (getClass() != object.getClass()) {
+                       return false;
+               }
+
+               final Addressbook other = (Addressbook) object;
+
+               if (!Objects.equals(this.getAddressbookName(), other.getAddressbookName())) {
+                       return false;
+               } else if (!Objects.equals(this.getAddressbookUser(), other.getAddressbookUser())) {
+                       return false;
+               }
+
+               return true;
+       }
+
        @Override
        public int hashCode () {
                int hash = 7;