Display the last login in the web client.
[pithos] / src / gr / ebs / gss / client / rest / resource / UserResource.java
index 17ca0ff..70f9d55 100644 (file)
@@ -58,6 +58,8 @@ public class UserResource extends RestResource {
 
        private String announcement;
 
+       private Date lastLogin;
+
        /**
         * Retrieve the name.
         *
@@ -284,7 +286,6 @@ public class UserResource extends RestResource {
                return announcement;
        }
 
-
        /**
         * Modify the announcement.
         *
@@ -294,6 +295,15 @@ public class UserResource extends RestResource {
                announcement = anAnnouncement;
        }
 
+       /**
+        * Retrieve the lastLogin.
+        *
+        * @return the lastLogin
+        */
+       public Date getLastLogin() {
+               return lastLogin;
+       }
+
        @Override
        public void createFromJSON(String text) {
                JSONObject json = (JSONObject) JSONParser.parse(text);
@@ -307,6 +317,8 @@ public class UserResource extends RestResource {
                tagsPath = unmarshallString(json, "tags");
                trashPath = unmarshallString(json, "trash");
                announcement = unmarshallString(json, "announcement");
+               if (json.get("lastLogin") != null)
+                       lastLogin = new Date(new Long(json.get("lastLogin").toString()));
                if (json.get("creationDate") != null)
                        creationDate = new Date(new Long(json.get("creationDate").toString()));
                if (json.get("modificationDate") != null)
@@ -331,4 +343,8 @@ public class UserResource extends RestResource {
                return res;
        }
 
+       @Override
+       public String getLastModifiedSince() {
+               return null;
+       }
 }