Statistics
| Branch: | Tag: | Revision:

root / web_client / src / gr / grnet / pithos / web / client / rest / resource / GroupUserResource.java @ 5cd18037

History | View | Annotate | Download (1.4 kB)

1 ab1eb3f8 Christos Stathis
/*
2 6dd67d1c Christos Stathis
 *  Copyright (c) 2011 Greek Research and Technology Network
3 ab1eb3f8 Christos Stathis
 */
4 ab1eb3f8 Christos Stathis
package gr.grnet.pithos.web.client.rest.resource;
5 ab1eb3f8 Christos Stathis
6 ab1eb3f8 Christos Stathis
import com.google.gwt.json.client.JSONObject;
7 ab1eb3f8 Christos Stathis
import com.google.gwt.json.client.JSONParser;
8 ab1eb3f8 Christos Stathis
9 ab1eb3f8 Christos Stathis
10 ab1eb3f8 Christos Stathis
public class GroupUserResource extends RestResource{
11 ab1eb3f8 Christos Stathis
12 ab1eb3f8 Christos Stathis
        public GroupUserResource(String aUri) {
13 ab1eb3f8 Christos Stathis
                super(aUri);
14 ab1eb3f8 Christos Stathis
        }
15 ab1eb3f8 Christos Stathis
16 ab1eb3f8 Christos Stathis
        String username;
17 ab1eb3f8 Christos Stathis
        String name;
18 ab1eb3f8 Christos Stathis
        String home;
19 ab1eb3f8 Christos Stathis
20 ab1eb3f8 Christos Stathis
        /**
21 ab1eb3f8 Christos Stathis
         * Retrieve the username.
22 ab1eb3f8 Christos Stathis
         *
23 ab1eb3f8 Christos Stathis
         * @return the username
24 ab1eb3f8 Christos Stathis
         */
25 ab1eb3f8 Christos Stathis
        public String getUsername() {
26 ab1eb3f8 Christos Stathis
                return username;
27 ab1eb3f8 Christos Stathis
        }
28 ab1eb3f8 Christos Stathis
29 ab1eb3f8 Christos Stathis
        /**
30 ab1eb3f8 Christos Stathis
         * Modify the username.
31 ab1eb3f8 Christos Stathis
         *
32 ab1eb3f8 Christos Stathis
         * @param aUsername the username to set
33 ab1eb3f8 Christos Stathis
         */
34 ab1eb3f8 Christos Stathis
        public void setUsername(String aUsername) {
35 ab1eb3f8 Christos Stathis
                username = aUsername;
36 ab1eb3f8 Christos Stathis
        }
37 ab1eb3f8 Christos Stathis
38 ab1eb3f8 Christos Stathis
        /**
39 ab1eb3f8 Christos Stathis
         * Retrieve the name.
40 ab1eb3f8 Christos Stathis
         *
41 ab1eb3f8 Christos Stathis
         * @return the name
42 ab1eb3f8 Christos Stathis
         */
43 ab1eb3f8 Christos Stathis
        @Override
44 ab1eb3f8 Christos Stathis
        public String getName() {
45 ab1eb3f8 Christos Stathis
                return name;
46 ab1eb3f8 Christos Stathis
        }
47 ab1eb3f8 Christos Stathis
48 ab1eb3f8 Christos Stathis
        /**
49 ab1eb3f8 Christos Stathis
         * Modify the name.
50 ab1eb3f8 Christos Stathis
         *
51 ab1eb3f8 Christos Stathis
         * @param aName the name to set
52 ab1eb3f8 Christos Stathis
         */
53 ab1eb3f8 Christos Stathis
        public void setName(String aName) {
54 ab1eb3f8 Christos Stathis
                name = aName;
55 ab1eb3f8 Christos Stathis
        }
56 ab1eb3f8 Christos Stathis
57 ab1eb3f8 Christos Stathis
        /**
58 ab1eb3f8 Christos Stathis
         * Retrieve the home.
59 ab1eb3f8 Christos Stathis
         *
60 ab1eb3f8 Christos Stathis
         * @return the home
61 ab1eb3f8 Christos Stathis
         */
62 ab1eb3f8 Christos Stathis
        public String getHome() {
63 ab1eb3f8 Christos Stathis
                return home;
64 ab1eb3f8 Christos Stathis
        }
65 ab1eb3f8 Christos Stathis
66 ab1eb3f8 Christos Stathis
        /**
67 ab1eb3f8 Christos Stathis
         * Modify the home.
68 ab1eb3f8 Christos Stathis
         *
69 ab1eb3f8 Christos Stathis
         * @param aHome the home to set
70 ab1eb3f8 Christos Stathis
         */
71 ab1eb3f8 Christos Stathis
        public void setHome(String aHome) {
72 ab1eb3f8 Christos Stathis
                home = aHome;
73 ab1eb3f8 Christos Stathis
        }
74 ab1eb3f8 Christos Stathis
75 ab1eb3f8 Christos Stathis
        @Override
76 ab1eb3f8 Christos Stathis
        public void createFromJSON(String text) {
77 ab1eb3f8 Christos Stathis
                JSONObject json = (JSONObject) JSONParser.parse(text);
78 ab1eb3f8 Christos Stathis
                name = unmarshallString(json, "name");
79 ab1eb3f8 Christos Stathis
                home = unmarshallString(json, "home");
80 ab1eb3f8 Christos Stathis
                username = unmarshallString(json, "username");
81 ab1eb3f8 Christos Stathis
        }
82 ab1eb3f8 Christos Stathis
83 ab1eb3f8 Christos Stathis
        @Override
84 ab1eb3f8 Christos Stathis
        public String getLastModifiedSince() {
85 ab1eb3f8 Christos Stathis
                return null;
86 ab1eb3f8 Christos Stathis
        }
87 ab1eb3f8 Christos Stathis
}