added svcapi ui and camunda code
[it/otf.git] / otf-service-api / src / main / java / org / oran / otf / common / model / User.java
1 /*  Copyright (c) 2019 AT&T Intellectual Property.                             #\r
2 #                                                                              #\r
3 #   Licensed under the Apache License, Version 2.0 (the "License");            #\r
4 #   you may not use this file except in compliance with the License.           #\r
5 #   You may obtain a copy of the License at                                    #\r
6 #                                                                              #\r
7 #       http://www.apache.org/licenses/LICENSE-2.0                             #\r
8 #                                                                              #\r
9 #   Unless required by applicable law or agreed to in writing, software        #\r
10 #   distributed under the License is distributed on an "AS IS" BASIS,          #\r
11 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #\r
12 #   See the License for the specific language governing permissions and        #\r
13 #   limitations under the License.                                             #\r
14 ##############################################################################*/\r
15 \r
16 \r
17 package org.oran.otf.common.model;\r
18 \r
19 import org.oran.otf.common.model.local.UserGroup;\r
20 import org.oran.otf.common.utility.gson.Convert;\r
21 import java.io.Serializable;\r
22 import java.util.Date;\r
23 import java.util.List;\r
24 import org.bson.types.ObjectId;\r
25 import org.springframework.data.mongodb.core.mapping.Document;\r
26 \r
27 @Document(collection = "users")\r
28 public class User implements Serializable {\r
29 \r
30   private static final long serialVersionUID = 1L;\r
31 \r
32   private ObjectId _id;\r
33   private List<String> permissions;\r
34   private String firstName;\r
35   private String lastName;\r
36   private String email;\r
37   private String password;\r
38   private List<UserGroup> groups;\r
39   private Date createdAt;\r
40   private Date updatedAt;\r
41 \r
42   //Added User for testing\r
43   public User(){};\r
44 \r
45   public User(\r
46       ObjectId _id,\r
47       List<String> permissions,\r
48       String firstName,\r
49       String lastName,\r
50       String email,\r
51       String password,\r
52       List<UserGroup> groups,\r
53       Date createdAt,\r
54       Date updatedAt) {\r
55     this._id = _id;\r
56     this.permissions = permissions;\r
57     this.firstName = firstName;\r
58     this.lastName = lastName;\r
59     this.email = email;\r
60     this.password = password;\r
61     this.groups = groups;\r
62     this.createdAt = createdAt;\r
63     this.updatedAt = updatedAt;\r
64   }\r
65 \r
66   public ObjectId get_id() {\r
67     return _id;\r
68   }\r
69 \r
70   public void set_id(ObjectId _id) {\r
71     this._id = _id;\r
72   }\r
73 \r
74   public List<String> getPermissions() {\r
75     return permissions;\r
76   }\r
77 \r
78   public void setPermissions(List<String> permissions) {\r
79     this.permissions = permissions;\r
80   }\r
81 \r
82   public String getFirstName() {\r
83     return firstName;\r
84   }\r
85 \r
86   public void setFirstName(String firstName) {\r
87     this.firstName = firstName;\r
88   }\r
89 \r
90   public String getLastName() {\r
91     return lastName;\r
92   }\r
93 \r
94   public void setLastName(String lastName) {\r
95     this.lastName = lastName;\r
96   }\r
97 \r
98   public String getEmail() {\r
99     return email;\r
100   }\r
101 \r
102   public void setEmail(String email) {\r
103     this.email = email;\r
104   }\r
105 \r
106   public String getPassword() {\r
107     return password;\r
108   }\r
109 \r
110   public void setPassword(String password) {\r
111     this.password = password;\r
112   }\r
113 \r
114   public List<UserGroup> getGroups() {\r
115     return groups;\r
116   }\r
117 \r
118   public void setGroups(List<UserGroup> groups) {\r
119     this.groups = groups;\r
120   }\r
121 \r
122   public Date getCreatedAt() {\r
123     return createdAt;\r
124   }\r
125 \r
126   public void setCreatedAt(Date createdAt) {\r
127     this.createdAt = createdAt;\r
128   }\r
129 \r
130   public Date getUpdatedAt() {\r
131     return updatedAt;\r
132   }\r
133 \r
134   public void setUpdatedAt(Date updatedAt) {\r
135     this.updatedAt = updatedAt;\r
136   }\r
137 \r
138   @Override\r
139   public String toString() {\r
140     return Convert.objectToJson(this);\r
141   }\r
142 }\r