securis/src/main/java/net/curisit/securis/db/Application.java
.. .. @@ -20,6 +20,7 @@ 20 20 21 21 import com.fasterxml.jackson.annotation.JsonAutoDetect; 22 22 import com.fasterxml.jackson.annotation.JsonIgnore; 23 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;23 24 import com.fasterxml.jackson.annotation.JsonInclude; 24 25 import com.fasterxml.jackson.annotation.JsonInclude.Include; 25 26 import com.fasterxml.jackson.annotation.JsonManagedReference; .. .. @@ -31,121 +32,120 @@ 31 32 */ 32 33 @JsonAutoDetect 33 34 @JsonInclude(Include.NON_NULL) 35 +@JsonIgnoreProperties(ignoreUnknown = true)34 36 @Entity 35 37 @Table(name = "application") 36 -@NamedQueries({37 - @NamedQuery(name = "list-applications", query = "SELECT a FROM Application a")38 -})38 +@NamedQueries({ @NamedQuery(name = "list-applications", query = "SELECT a FROM Application a") })39 39 public class Application implements Serializable { 40 40 41 - private static final Logger LOG = LogManager.getLogger(Application.class);41 + private static final Logger LOG = LogManager.getLogger(Application.class);42 42 43 - private static final long serialVersionUID = 1L;43 + private static final long serialVersionUID = 1L;44 44 45 - @Id46 - @GeneratedValue47 - private Integer id;45 + @Id46 + @GeneratedValue47 + private Integer id;48 48 49 - private String code;50 - private String name;51 - private String description;49 + private String code;50 + private String name;51 + private String description;52 52 53 - @Column(name = "license_filename")54 - @JsonProperty("license_filename")55 - private String licenseFilename;53 + @Column(name = "license_filename")54 + @JsonProperty("license_filename")55 + private String licenseFilename;56 56 57 - @Column(name = "creation_timestamp")58 - @JsonProperty("creation_timestamp")59 - private Date creationTimestamp;57 + @Column(name = "creation_timestamp")58 + @JsonProperty("creation_timestamp")59 + private Date creationTimestamp;60 60 61 - // We don't include the referenced entities to limit the size of each row at62 - // // the listing63 - @JsonIgnore64 - @OneToMany(fetch = FetchType.LAZY, mappedBy = "application")65 - private Set<LicenseType> licenseTypes;61 + // We don't include the referenced entities to limit the size of each row at62 + // // the listing63 + @JsonIgnore64 + @OneToMany(fetch = FetchType.LAZY, mappedBy = "application")65 + private Set<LicenseType> licenseTypes;66 66 67 - @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "application")68 - @JsonManagedReference69 - private Set<ApplicationMetadata> metadata;67 + @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "application")68 + @JsonManagedReference69 + private Set<ApplicationMetadata> metadata;70 70 71 - public Integer getId() {72 - return id;73 - }71 + public Integer getId() {72 + return id;73 + }74 74 75 - public void setId(Integer id) {76 - this.id = id;77 - }75 + public void setId(Integer id) {76 + this.id = id;77 + }78 78 79 - public String getName() {80 - return name;81 - }79 + public String getName() {80 + return name;81 + }82 82 83 - public void setName(String name) {84 - this.name = name;85 - }83 + public void setName(String name) {84 + this.name = name;85 + }86 86 87 - public String getDescription() {88 - return description;89 - }87 + public String getDescription() {88 + return description;89 + }90 90 91 - public void setDescription(String description) {92 - this.description = description;93 - }91 + public void setDescription(String description) {92 + this.description = description;93 + }94 94 95 - public Date getCreationTimestamp() {96 - return creationTimestamp;97 - }95 + public Date getCreationTimestamp() {96 + return creationTimestamp;97 + }98 98 99 - public void setCreationTimestamp(Date creationTimestamp) {100 - this.creationTimestamp = creationTimestamp;101 - }99 + public void setCreationTimestamp(Date creationTimestamp) {100 + this.creationTimestamp = creationTimestamp;101 + }102 102 103 - @JsonProperty("metadata")104 - public Set<ApplicationMetadata> getApplicationMetadata() {105 - return metadata;106 - }103 + @JsonProperty("metadata")104 + public Set<ApplicationMetadata> getApplicationMetadata() {105 + return metadata;106 + }107 107 108 - @JsonProperty("metadata")109 - public void setApplicationMetadata(Set<ApplicationMetadata> metadata) {110 - this.metadata = metadata;111 - }108 + @JsonProperty("metadata")109 + public void setApplicationMetadata(Set<ApplicationMetadata> metadata) {110 + this.metadata = metadata;111 + }112 112 113 - @Override114 - public boolean equals(Object obj) {115 - if (!(obj instanceof Application))116 - return false;117 - Application other = (Application) obj;118 - return id.equals(other.id);119 - }113 + @Override114 + public boolean equals(Object obj) {115 + if (!(obj instanceof Application))116 + return false;117 + Application other = (Application) obj;118 + return id.equals(other.id);119 + }120 120 121 - @Override122 - public int hashCode() {121 + @Override122 + public int hashCode() {123 123 124 - return (id == null ? 0 : id.hashCode());125 - }124 + return (id == null ? 0 : id.hashCode());125 + }126 126 127 - public String getLicenseFilename() {128 - return licenseFilename;129 - }127 + public String getLicenseFilename() {128 + return licenseFilename;129 + }130 130 131 - public void setLicenseFilename(String licenseFilename) {132 - this.licenseFilename = licenseFilename;133 - }131 + public void setLicenseFilename(String licenseFilename) {132 + this.licenseFilename = licenseFilename;133 + }134 134 135 - public Set<LicenseType> getLicenseTypes() {136 - LOG.info("Getting list license types!!!!");137 - return licenseTypes;138 - }135 + public Set<LicenseType> getLicenseTypes() {136 + LOG.info("Getting list license types!!!!");137 + return licenseTypes;138 + }139 139 140 - public void setLicenseTypes(Set<LicenseType> licenseTypes) {141 - this.licenseTypes = licenseTypes;142 - }140 + public void setLicenseTypes(Set<LicenseType> licenseTypes) {141 + this.licenseTypes = licenseTypes;142 + }143 143 144 - public String getCode() {145 - return code;146 - }144 + public String getCode() {145 + return code;146 + }147 147 148 - public void setCode(String code) {149 - this.code = code;150 - }148 + public void setCode(String code) {149 + this.code = code;150 + }151 151 } securis/src/main/java/net/curisit/securis/db/ApplicationMetadata.java
.. .. @@ -30,7 +30,7 @@ 30 30 @JsonInclude(Include.NON_NULL) 31 31 @Entity 32 32 @Table(name = "application_metadata") 33 -@JsonIgnoreProperties(value = { "readonly" })33 +@JsonIgnoreProperties(ignoreUnknown = true)34 34 @NamedQueries({ @NamedQuery(name = "list-application-metadata", query = "SELECT a FROM ApplicationMetadata a where a.application.id = :applicationId") }) 35 35 public class ApplicationMetadata implements Serializable { 36 36 securis/src/main/java/net/curisit/securis/db/LicenseTypeMetadata.java
.. .. @@ -25,7 +25,7 @@ 25 25 @JsonInclude(Include.NON_NULL) 26 26 @Entity 27 27 @Table(name = "licensetype_metadata") 28 -@JsonIgnoreProperties(value = { "readonly" })28 +@JsonIgnoreProperties(ignoreUnknown = true)29 29 @NamedQueries({ @NamedQuery(name = "list-licensetype-metadata", query = "SELECT a FROM LicenseTypeMetadata a where a.licenseType.id = :licenseTypeId") }) 30 30 public class LicenseTypeMetadata implements Serializable { 31 31 securis/src/main/java/net/curisit/securis/db/Organization.java
.. .. @@ -26,6 +26,7 @@ 26 26 27 27 import com.fasterxml.jackson.annotation.JsonAutoDetect; 28 28 import com.fasterxml.jackson.annotation.JsonIgnore; 29 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;29 30 import com.fasterxml.jackson.annotation.JsonInclude; 30 31 import com.fasterxml.jackson.annotation.JsonInclude.Include; 31 32 import com.fasterxml.jackson.annotation.JsonProperty; .. .. @@ -36,164 +37,159 @@ 36 37 */ 37 38 @JsonAutoDetect 38 39 @JsonInclude(Include.NON_NULL) 40 +@JsonIgnoreProperties(ignoreUnknown = true)39 41 @Entity 40 42 @Table(name = "organization") 41 -@NamedQueries({42 - @NamedQuery(name = "list-organizations", query = "SELECT o FROM Organization o"),43 - @NamedQuery(name = "list-organizations-by-ids", query = "SELECT o FROM Organization o where id in :list_ids"),44 - @NamedQuery(name = "find-children-org", query = "SELECT o FROM Organization o where o.parentOrganization = :parentOrganization")45 -})43 +@NamedQueries({ @NamedQuery(name = "list-organizations", query = "SELECT o FROM Organization o"),44 + @NamedQuery(name = "list-organizations-by-ids", query = "SELECT o FROM Organization o where id in :list_ids"),45 + @NamedQuery(name = "find-children-org", query = "SELECT o FROM Organization o where o.parentOrganization = :parentOrganization") })46 46 public class Organization implements Serializable { 47 47 48 - @SuppressWarnings("unused")49 - private static final Logger LOG = LogManager.getLogger(Organization.class);48 + @SuppressWarnings("unused")49 + private static final Logger LOG = LogManager.getLogger(Organization.class);50 50 51 - private static final long serialVersionUID = 1L;51 + private static final long serialVersionUID = 1L;52 52 53 - @Id54 - @GeneratedValue55 - private Integer id;53 + @Id54 + @GeneratedValue55 + private Integer id;56 56 57 - private String code;58 - private String name;59 - private String description;57 + private String code;58 + private String name;59 + private String description;60 60 61 - @Column(name = "creation_timestamp")62 - @JsonProperty("creation_timestamp")63 - private Date creationTimestamp;61 + @Column(name = "creation_timestamp")62 + @JsonProperty("creation_timestamp")63 + private Date creationTimestamp;64 64 65 - @JsonIgnore66 - // We don't include the users to limit the size of each row a the listing67 - @ManyToMany(cascade = CascadeType.REMOVE)68 - @JoinTable(name = "user_organization", //69 - joinColumns = {70 - @JoinColumn(name = "organization_id", referencedColumnName = "id")71 - }, //72 - inverseJoinColumns = {73 - @JoinColumn(name = "username", referencedColumnName = "username")74 - })75 - private Set<User> users;65 + @JsonIgnore66 + // We don't include the users to limit the size of each row a the listing67 + @ManyToMany(cascade = CascadeType.REMOVE)68 + @JoinTable(name = "user_organization", //69 + joinColumns = { @JoinColumn(name = "organization_id", referencedColumnName = "id") }, //70 + inverseJoinColumns = { @JoinColumn(name = "username", referencedColumnName = "username") })71 + private Set<User> users;76 72 77 - @JsonIgnore78 - // We don't include the users to limit the size of each row a the listing79 - @ManyToOne80 - @JoinColumn(name = "org_parent_id")81 - private Organization parentOrganization;73 + @JsonIgnore74 + // We don't include the users to limit the size of each row a the listing75 + @ManyToOne76 + @JoinColumn(name = "org_parent_id")77 + private Organization parentOrganization;82 78 83 - @JsonIgnore84 - // We don't include the users to limit the size of each row a the listing85 - @OneToMany(fetch = FetchType.LAZY, mappedBy = "parentOrganization")86 - private Set<Organization> childOrganizations;79 + @JsonIgnore80 + // We don't include the users to limit the size of each row a the listing81 + @OneToMany(fetch = FetchType.LAZY, mappedBy = "parentOrganization")82 + private Set<Organization> childOrganizations;87 83 88 - public Integer getId() {89 - return id;90 - }84 + public Integer getId() {85 + return id;86 + }91 87 92 - public void setId(Integer id) {93 - this.id = id;94 - }88 + public void setId(Integer id) {89 + this.id = id;90 + }95 91 96 - public String getName() {97 - return name;98 - }92 + public String getName() {93 + return name;94 + }99 95 100 - public void setName(String name) {101 - this.name = name;102 - }96 + public void setName(String name) {97 + this.name = name;98 + }103 99 104 - public String getDescription() {105 - return description;106 - }100 + public String getDescription() {101 + return description;102 + }107 103 108 - public void setDescription(String description) {109 - this.description = description;110 - }104 + public void setDescription(String description) {105 + this.description = description;106 + }111 107 112 - public String getCode() {113 - return code;114 - }108 + public String getCode() {109 + return code;110 + }115 111 116 - public void setCode(String code) {117 - this.code = code;118 - }112 + public void setCode(String code) {113 + this.code = code;114 + }119 115 120 - public Date getCreationTimestamp() {121 - return creationTimestamp;122 - }116 + public Date getCreationTimestamp() {117 + return creationTimestamp;118 + }123 119 124 - public void setCreationTimestamp(Date creationTimestamp) {125 - this.creationTimestamp = creationTimestamp;126 - }120 + public void setCreationTimestamp(Date creationTimestamp) {121 + this.creationTimestamp = creationTimestamp;122 + }127 123 128 - public Set<User> getUsers() {129 - return users;130 - }124 + public Set<User> getUsers() {125 + return users;126 + }131 127 132 - public void setUsers(Set<User> users) {133 - this.users = users;134 - }128 + public void setUsers(Set<User> users) {129 + this.users = users;130 + }135 131 136 - public Organization getParentOrganization() {137 - return parentOrganization;138 - }132 + public Organization getParentOrganization() {133 + return parentOrganization;134 + }139 135 140 - public void setParentOrganization(Organization parentOrganization) {141 - this.parentOrganization = parentOrganization;142 - }136 + public void setParentOrganization(Organization parentOrganization) {137 + this.parentOrganization = parentOrganization;138 + }143 139 144 - // Roberto: Following methods are necessary to include in the REST list145 - // response146 - // information about the referenced entities.147 - @JsonProperty("org_parent_id")148 - public void setParentOrgId(Integer orgId) {149 - if (orgId != null) {150 - parentOrganization = new Organization();151 - parentOrganization.setId(orgId);152 - } else {153 - parentOrganization = null;154 - }155 - }140 + // Roberto: Following methods are necessary to include in the REST list141 + // response142 + // information about the referenced entities.143 + @JsonProperty("org_parent_id")144 + public void setParentOrgId(Integer orgId) {145 + if (orgId != null) {146 + parentOrganization = new Organization();147 + parentOrganization.setId(orgId);148 + } else {149 + parentOrganization = null;150 + }151 + }156 152 157 - @JsonProperty("org_parent_id")158 - public Integer getParentOrgId() {159 - return parentOrganization == null ? null : parentOrganization.getId();160 - }153 + @JsonProperty("org_parent_id")154 + public Integer getParentOrgId() {155 + return parentOrganization == null ? null : parentOrganization.getId();156 + }161 157 162 - @JsonProperty("org_parent_name")163 - public String getParentOrgName() {164 - return parentOrganization == null ? null : parentOrganization.getName();165 - }158 + @JsonProperty("org_parent_name")159 + public String getParentOrgName() {160 + return parentOrganization == null ? null : parentOrganization.getName();161 + }166 162 167 - @JsonProperty("users_ids")168 - public void setUsersIds(List<String> usersIds) {169 - users = new HashSet<>();170 - if (usersIds != null) {171 - for (String userid : usersIds) {172 - User u = new User();173 - u.setUsername(userid);174 - users.add(u);175 - }176 - }177 - }163 + @JsonProperty("users_ids")164 + public void setUsersIds(List<String> usersIds) {165 + users = new HashSet<>();166 + if (usersIds != null) {167 + for (String userid : usersIds) {168 + User u = new User();169 + u.setUsername(userid);170 + users.add(u);171 + }172 + }173 + }178 174 179 - @JsonProperty("users_ids")180 - public Set<String> getUsersIds() {181 - if (users == null) {182 - return null;183 - }184 - Set<String> ids = new HashSet<>();185 - for (User user : users) {186 - ids.add(user.getUsername());187 - }188 - return ids;189 - }175 + @JsonProperty("users_ids")176 + public Set<String> getUsersIds() {177 + if (users == null) {178 + return null;179 + }180 + Set<String> ids = new HashSet<>();181 + for (User user : users) {182 + ids.add(user.getUsername());183 + }184 + return ids;185 + }190 186 191 - public Set<Organization> getChildOrganizations() {192 - return childOrganizations;193 - }187 + public Set<Organization> getChildOrganizations() {188 + return childOrganizations;189 + }194 190 195 - public void setChildOrganizations(Set<Organization> childOrganizations) {196 - this.childOrganizations = childOrganizations;197 - }191 + public void setChildOrganizations(Set<Organization> childOrganizations) {192 + this.childOrganizations = childOrganizations;193 + }198 194 199 195 } securis/src/main/java/net/curisit/securis/db/PackMetadata.java
.. .. @@ -26,7 +26,7 @@ 26 26 @JsonInclude(Include.NON_NULL) 27 27 @Entity 28 28 @Table(name = "pack_metadata") 29 -@JsonIgnoreProperties(value = { "readonly" })29 +@JsonIgnoreProperties(ignoreUnknown = true)30 30 @NamedQueries({ @NamedQuery(name = "list-pack-metadata", query = "SELECT a FROM PackMetadata a where a.pack.id = :packId") }) 31 31 public class PackMetadata implements Serializable { 32 32 securis/src/main/java/net/curisit/securis/db/User.java
.. .. @@ -19,6 +19,7 @@ 19 19 20 20 import com.fasterxml.jackson.annotation.JsonAutoDetect; 21 21 import com.fasterxml.jackson.annotation.JsonIgnore; 22 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;22 23 import com.fasterxml.jackson.annotation.JsonInclude; 23 24 import com.fasterxml.jackson.annotation.JsonInclude.Include; 24 25 import com.fasterxml.jackson.annotation.JsonProperty; .. .. @@ -29,217 +30,209 @@ 29 30 */ 30 31 @JsonAutoDetect 31 32 @JsonInclude(Include.NON_NULL) 33 +@JsonIgnoreProperties(ignoreUnknown = true)32 34 @Entity 33 35 @Table(name = "user") 34 -@NamedQueries({35 - @NamedQuery(name = "list-users", query = "SELECT u FROM User u"),36 - @NamedQuery(name = "get-user", query = "SELECT u FROM User u where u.username = :username"),37 - @NamedQuery(name = "auth-user", query = "SELECT u FROM User u where u.username = :username and u.password = :password"),38 - @NamedQuery(name = "delete-all-users", query = "delete FROM User u")39 -})36 +@NamedQueries({ @NamedQuery(name = "list-users", query = "SELECT u FROM User u"), @NamedQuery(name = "get-user", query = "SELECT u FROM User u where u.username = :username"),37 + @NamedQuery(name = "auth-user", query = "SELECT u FROM User u where u.username = :username and u.password = :password"),38 + @NamedQuery(name = "delete-all-users", query = "delete FROM User u") })40 39 public class User implements Serializable { 41 40 42 - private static final long serialVersionUID = 1L;41 + private static final long serialVersionUID = 1L;43 42 44 - @Id45 - private String username;43 + @Id44 + private String username;46 45 47 - private String password;46 + private String password;48 47 49 - @JsonProperty(value = "first_name")50 - @Column(name = "first_name")51 - private String firstName;48 + @JsonProperty(value = "first_name")49 + @Column(name = "first_name")50 + private String firstName;52 51 53 - @JsonProperty(value = "last_name")54 - @Column(name = "last_name")55 - private String lastName;52 + @JsonProperty(value = "last_name")53 + @Column(name = "last_name")54 + private String lastName;56 55 57 - private int roles;56 + private int roles;58 57 59 - @Column(name = "last_login")60 - private Date lastLogin;58 + @Column(name = "last_login")59 + private Date lastLogin;61 60 62 - @Column(name = "modification_timestamp")63 - private Date modificationTimestamp;61 + @Column(name = "modification_timestamp")62 + private Date modificationTimestamp;64 63 65 - @Column(name = "creation_timestamp")66 - @JsonProperty("creation_timestamp")67 - private Date creationTimestamp;64 + @Column(name = "creation_timestamp")65 + @JsonProperty("creation_timestamp")66 + private Date creationTimestamp;68 67 69 - private String lang;68 + private String lang;70 69 71 - private String email;70 + private String email;72 71 73 - @JsonIgnore74 - @ManyToMany75 - @JoinTable(name = "user_organization", //76 - joinColumns = {77 - @JoinColumn(name = "username", referencedColumnName = "username")78 - }, //79 - inverseJoinColumns = {80 - @JoinColumn(name = "organization_id", referencedColumnName = "id")81 - } //82 - )83 - private Set<Organization> organizations;72 + @JsonIgnore73 + @ManyToMany74 + @JoinTable(name = "user_organization", //75 + joinColumns = { @JoinColumn(name = "username", referencedColumnName = "username") }, //76 + inverseJoinColumns = { @JoinColumn(name = "organization_id", referencedColumnName = "id") } //77 + )78 + private Set<Organization> organizations;84 79 85 - public String getUsername() {86 - return username;87 - }80 + public String getUsername() {81 + return username;82 + }88 83 89 - public void setUsername(String username) {90 - this.username = username;91 - }84 + public void setUsername(String username) {85 + this.username = username;86 + }92 87 93 - @JsonProperty("password")94 - public String getDummyPassword() {95 - return null;96 - }88 + @JsonProperty("password")89 + public String getDummyPassword() {90 + return null;91 + }97 92 98 - public String getPassword() {99 - return password;100 - }93 + public String getPassword() {94 + return password;95 + }101 96 102 - public void setPassword(String password) {103 - this.password = password;104 - }97 + public void setPassword(String password) {98 + this.password = password;99 + }105 100 106 - public List<Integer> getRoles() {107 - if (roles == 0) {108 - return null;109 - }110 - List<Integer> aux = new ArrayList<>();111 - for (int rol : Rol.ALL) {112 - if ((roles & rol) != 0) { // Each rol is a number with only 1 bit ==113 - // 1 in binary representation114 - aux.add(rol);115 - }116 - }117 - return aux;118 - }101 + public List<Integer> getRoles() {102 + if (roles == 0) {103 + return null;104 + }105 + List<Integer> aux = new ArrayList<>();106 + for (int rol : Rol.ALL) {107 + if ((roles & rol) != 0) { // Each rol is a number with only 1 bit ==108 + // 1 in binary representation109 + aux.add(rol);110 + }111 + }112 + return aux;113 + }119 114 120 - public void setRoles(List<Integer> roles) {121 - this.roles = 0;122 - if (roles != null) {123 - for (Integer rol : roles) {124 - this.roles |= rol;125 - }126 - }127 - }115 + public void setRoles(List<Integer> roles) {116 + this.roles = 0;117 + if (roles != null) {118 + for (Integer rol : roles) {119 + this.roles |= rol;120 + }121 + }122 + }128 123 129 - public String getFirstName() {130 - return firstName;131 - }124 + public String getFirstName() {125 + return firstName;126 + }132 127 133 - public void setFirstName(String firstName) {134 - this.firstName = firstName;135 - }128 + public void setFirstName(String firstName) {129 + this.firstName = firstName;130 + }136 131 137 - public String getLastName() {138 - return lastName;139 - }132 + public String getLastName() {133 + return lastName;134 + }140 135 141 - public void setLastName(String lastName) {142 - this.lastName = lastName;143 - }136 + public void setLastName(String lastName) {137 + this.lastName = lastName;138 + }144 139 145 - public Date getLastLogin() {146 - return lastLogin;147 - }140 + public Date getLastLogin() {141 + return lastLogin;142 + }148 143 149 - public void setLastLogin(Date lastLogin) {150 - this.lastLogin = lastLogin;151 - }144 + public void setLastLogin(Date lastLogin) {145 + this.lastLogin = lastLogin;146 + }152 147 153 - public Date getModificationTimestamp() {154 - return modificationTimestamp;155 - }148 + public Date getModificationTimestamp() {149 + return modificationTimestamp;150 + }156 151 157 - public void setModificationTimestamp(Date modificationTimestamp) {158 - this.modificationTimestamp = modificationTimestamp;159 - }152 + public void setModificationTimestamp(Date modificationTimestamp) {153 + this.modificationTimestamp = modificationTimestamp;154 + }160 155 161 - public Date getCreationTimestamp() {162 - return creationTimestamp;163 - }156 + public Date getCreationTimestamp() {157 + return creationTimestamp;158 + }164 159 165 - public void setCreationTimestamp(Date creationTimestamp) {166 - this.creationTimestamp = creationTimestamp;167 - }160 + public void setCreationTimestamp(Date creationTimestamp) {161 + this.creationTimestamp = creationTimestamp;162 + }168 163 169 - @Override170 - public String toString() {171 - return "{User: " + username + " Name: " + firstName + " " + lastName + ", last login: " + lastLogin + "}";172 - }164 + @Override165 + public String toString() {166 + return "{User: " + username + " Name: " + firstName + " " + lastName + ", last login: " + lastLogin + "}";167 + }173 168 174 - public String getLang() {175 - return lang;176 - }169 + public String getLang() {170 + return lang;171 + }177 172 178 - public void setLang(String lang) {179 - this.lang = lang;180 - }173 + public void setLang(String lang) {174 + this.lang = lang;175 + }181 176 182 - public Set<Organization> getOrganizations() {183 - return organizations;184 - }177 + public Set<Organization> getOrganizations() {178 + return organizations;179 + }185 180 186 - public void setOrganizations(Set<Organization> organizations) {187 - this.organizations = organizations;188 - }181 + public void setOrganizations(Set<Organization> organizations) {182 + this.organizations = organizations;183 + }189 184 190 - @JsonProperty("organizations_ids")191 - public void setOrgsIds(List<Integer> orgsIds) {192 - organizations = new HashSet<>();193 - for (Integer orgid : orgsIds) {194 - Organization o = new Organization();195 - o.setId(orgid);196 - organizations.add(o);197 - }198 - }185 + @JsonProperty("organizations_ids")186 + public void setOrgsIds(List<Integer> orgsIds) {187 + organizations = new HashSet<>();188 + for (Integer orgid : orgsIds) {189 + Organization o = new Organization();190 + o.setId(orgid);191 + organizations.add(o);192 + }193 + }199 194 200 - @JsonProperty("organizations_ids")201 - public Set<Integer> getOrgsIds() {202 - if (organizations == null) {203 - return null;204 - }205 - Set<Integer> ids = new HashSet<>();206 - for (Organization org : organizations) {207 - ids.add(org.getId());208 - }209 - return ids;210 - }195 + @JsonProperty("organizations_ids")196 + public Set<Integer> getOrgsIds() {197 + if (organizations == null) {198 + return null;199 + }200 + Set<Integer> ids = new HashSet<>();201 + for (Organization org : organizations) {202 + ids.add(org.getId());203 + }204 + return ids;205 + }211 206 212 - @JsonIgnore213 - public Set<Integer> getAllOrgsIds() {214 - if (organizations == null) {215 - return null;216 - }217 - Set<Integer> ids = new HashSet<>();218 - includeAllOrgs(this.organizations, ids);219 - return ids;220 - }207 + @JsonIgnore208 + public Set<Integer> getAllOrgsIds() {209 + if (organizations == null) {210 + return null;211 + }212 + Set<Integer> ids = new HashSet<>();213 + includeAllOrgs(this.organizations, ids);214 + return ids;215 + }221 216 222 - private void includeAllOrgs(Set<Organization> list, Set<Integer> orgIds) {223 - for (Organization org : list) {224 - orgIds.add(org.getId());225 - includeAllOrgs(org.getChildOrganizations(), orgIds);226 - }227 - }217 + private void includeAllOrgs(Set<Organization> list, Set<Integer> orgIds) {218 + for (Organization org : list) {219 + orgIds.add(org.getId());220 + includeAllOrgs(org.getChildOrganizations(), orgIds);221 + }222 + }228 223 229 - public String getEmail() {230 - return email;231 - }224 + public String getEmail() {225 + return email;226 + }232 227 233 - public void setEmail(String email) {234 - this.email = email;235 - }228 + public void setEmail(String email) {229 + this.email = email;230 + }236 231 237 - public static class Rol {238 - public static final int ADVANCE = 0x01;239 - public static final int ADMIN = 0x02;240 - public static final int[] ALL = new int[] {241 - ADVANCE, ADMIN242 - };243 - }232 + public static class Rol {233 + public static final int ADVANCE = 0x01;234 + public static final int ADMIN = 0x02;235 + public static final int[] ALL = new int[] { ADVANCE, ADMIN };236 + }244 237 245 238 }