From 45029ab3bc4f6c293f3a59af233f015b71cc0c09 Mon Sep 17 00:00:00 2001
From: rsanchez <rsanchez@curisit.net>
Date: Tue, 21 Mar 2017 09:30:03 +0000
Subject: [PATCH] #3527 fix - Ignoring unknown properties for unmarshall
---
securis/src/main/java/net/curisit/securis/db/User.java | 329 ++++++++++++------------
securis/src/main/java/net/curisit/securis/db/Application.java | 174 ++++++------
securis/src/main/java/net/curisit/securis/db/Organization.java | 250 +++++++++---------
securis/src/main/java/net/curisit/securis/db/LicenseTypeMetadata.java | 2
securis/src/main/java/net/curisit/securis/db/ApplicationMetadata.java | 2
securis/src/main/java/net/curisit/securis/db/PackMetadata.java | 2
6 files changed, 374 insertions(+), 385 deletions(-)
diff --git a/securis/src/main/java/net/curisit/securis/db/Application.java b/securis/src/main/java/net/curisit/securis/db/Application.java
index f7f546d..508175a 100644
--- a/securis/src/main/java/net/curisit/securis/db/Application.java
+++ b/securis/src/main/java/net/curisit/securis/db/Application.java
@@ -20,6 +20,7 @@
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonManagedReference;
@@ -31,121 +32,120 @@
*/
@JsonAutoDetect
@JsonInclude(Include.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
@Entity
@Table(name = "application")
-@NamedQueries({
- @NamedQuery(name = "list-applications", query = "SELECT a FROM Application a")
-})
+@NamedQueries({ @NamedQuery(name = "list-applications", query = "SELECT a FROM Application a") })
public class Application implements Serializable {
- private static final Logger LOG = LogManager.getLogger(Application.class);
+ private static final Logger LOG = LogManager.getLogger(Application.class);
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
- @Id
- @GeneratedValue
- private Integer id;
+ @Id
+ @GeneratedValue
+ private Integer id;
- private String code;
- private String name;
- private String description;
+ private String code;
+ private String name;
+ private String description;
- @Column(name = "license_filename")
- @JsonProperty("license_filename")
- private String licenseFilename;
+ @Column(name = "license_filename")
+ @JsonProperty("license_filename")
+ private String licenseFilename;
- @Column(name = "creation_timestamp")
- @JsonProperty("creation_timestamp")
- private Date creationTimestamp;
+ @Column(name = "creation_timestamp")
+ @JsonProperty("creation_timestamp")
+ private Date creationTimestamp;
- // We don't include the referenced entities to limit the size of each row at
- // // the listing
- @JsonIgnore
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "application")
- private Set<LicenseType> licenseTypes;
+ // We don't include the referenced entities to limit the size of each row at
+ // // the listing
+ @JsonIgnore
+ @OneToMany(fetch = FetchType.LAZY, mappedBy = "application")
+ private Set<LicenseType> licenseTypes;
- @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "application")
- @JsonManagedReference
- private Set<ApplicationMetadata> metadata;
+ @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "application")
+ @JsonManagedReference
+ private Set<ApplicationMetadata> metadata;
- public Integer getId() {
- return id;
- }
+ public Integer getId() {
+ return id;
+ }
- public void setId(Integer id) {
- this.id = id;
- }
+ public void setId(Integer id) {
+ this.id = id;
+ }
- public String getName() {
- return name;
- }
+ public String getName() {
+ return name;
+ }
- public void setName(String name) {
- this.name = name;
- }
+ public void setName(String name) {
+ this.name = name;
+ }
- public String getDescription() {
- return description;
- }
+ public String getDescription() {
+ return description;
+ }
- public void setDescription(String description) {
- this.description = description;
- }
+ public void setDescription(String description) {
+ this.description = description;
+ }
- public Date getCreationTimestamp() {
- return creationTimestamp;
- }
+ public Date getCreationTimestamp() {
+ return creationTimestamp;
+ }
- public void setCreationTimestamp(Date creationTimestamp) {
- this.creationTimestamp = creationTimestamp;
- }
+ public void setCreationTimestamp(Date creationTimestamp) {
+ this.creationTimestamp = creationTimestamp;
+ }
- @JsonProperty("metadata")
- public Set<ApplicationMetadata> getApplicationMetadata() {
- return metadata;
- }
+ @JsonProperty("metadata")
+ public Set<ApplicationMetadata> getApplicationMetadata() {
+ return metadata;
+ }
- @JsonProperty("metadata")
- public void setApplicationMetadata(Set<ApplicationMetadata> metadata) {
- this.metadata = metadata;
- }
+ @JsonProperty("metadata")
+ public void setApplicationMetadata(Set<ApplicationMetadata> metadata) {
+ this.metadata = metadata;
+ }
- @Override
- public boolean equals(Object obj) {
- if (!(obj instanceof Application))
- return false;
- Application other = (Application) obj;
- return id.equals(other.id);
- }
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof Application))
+ return false;
+ Application other = (Application) obj;
+ return id.equals(other.id);
+ }
- @Override
- public int hashCode() {
+ @Override
+ public int hashCode() {
- return (id == null ? 0 : id.hashCode());
- }
+ return (id == null ? 0 : id.hashCode());
+ }
- public String getLicenseFilename() {
- return licenseFilename;
- }
+ public String getLicenseFilename() {
+ return licenseFilename;
+ }
- public void setLicenseFilename(String licenseFilename) {
- this.licenseFilename = licenseFilename;
- }
+ public void setLicenseFilename(String licenseFilename) {
+ this.licenseFilename = licenseFilename;
+ }
- public Set<LicenseType> getLicenseTypes() {
- LOG.info("Getting list license types!!!!");
- return licenseTypes;
- }
+ public Set<LicenseType> getLicenseTypes() {
+ LOG.info("Getting list license types!!!!");
+ return licenseTypes;
+ }
- public void setLicenseTypes(Set<LicenseType> licenseTypes) {
- this.licenseTypes = licenseTypes;
- }
+ public void setLicenseTypes(Set<LicenseType> licenseTypes) {
+ this.licenseTypes = licenseTypes;
+ }
- public String getCode() {
- return code;
- }
+ public String getCode() {
+ return code;
+ }
- public void setCode(String code) {
- this.code = code;
- }
+ public void setCode(String code) {
+ this.code = code;
+ }
}
diff --git a/securis/src/main/java/net/curisit/securis/db/ApplicationMetadata.java b/securis/src/main/java/net/curisit/securis/db/ApplicationMetadata.java
index 4b81924..78acf4c 100644
--- a/securis/src/main/java/net/curisit/securis/db/ApplicationMetadata.java
+++ b/securis/src/main/java/net/curisit/securis/db/ApplicationMetadata.java
@@ -30,7 +30,7 @@
@JsonInclude(Include.NON_NULL)
@Entity
@Table(name = "application_metadata")
-@JsonIgnoreProperties(value = { "readonly" })
+@JsonIgnoreProperties(ignoreUnknown = true)
@NamedQueries({ @NamedQuery(name = "list-application-metadata", query = "SELECT a FROM ApplicationMetadata a where a.application.id = :applicationId") })
public class ApplicationMetadata implements Serializable {
diff --git a/securis/src/main/java/net/curisit/securis/db/LicenseTypeMetadata.java b/securis/src/main/java/net/curisit/securis/db/LicenseTypeMetadata.java
index c88e894..08c5fc1 100644
--- a/securis/src/main/java/net/curisit/securis/db/LicenseTypeMetadata.java
+++ b/securis/src/main/java/net/curisit/securis/db/LicenseTypeMetadata.java
@@ -25,7 +25,7 @@
@JsonInclude(Include.NON_NULL)
@Entity
@Table(name = "licensetype_metadata")
-@JsonIgnoreProperties(value = { "readonly" })
+@JsonIgnoreProperties(ignoreUnknown = true)
@NamedQueries({ @NamedQuery(name = "list-licensetype-metadata", query = "SELECT a FROM LicenseTypeMetadata a where a.licenseType.id = :licenseTypeId") })
public class LicenseTypeMetadata implements Serializable {
diff --git a/securis/src/main/java/net/curisit/securis/db/Organization.java b/securis/src/main/java/net/curisit/securis/db/Organization.java
index 78c8ced..4084245 100644
--- a/securis/src/main/java/net/curisit/securis/db/Organization.java
+++ b/securis/src/main/java/net/curisit/securis/db/Organization.java
@@ -26,6 +26,7 @@
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -36,164 +37,159 @@
*/
@JsonAutoDetect
@JsonInclude(Include.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
@Entity
@Table(name = "organization")
-@NamedQueries({
- @NamedQuery(name = "list-organizations", query = "SELECT o FROM Organization o"),
- @NamedQuery(name = "list-organizations-by-ids", query = "SELECT o FROM Organization o where id in :list_ids"),
- @NamedQuery(name = "find-children-org", query = "SELECT o FROM Organization o where o.parentOrganization = :parentOrganization")
-})
+@NamedQueries({ @NamedQuery(name = "list-organizations", query = "SELECT o FROM Organization o"),
+ @NamedQuery(name = "list-organizations-by-ids", query = "SELECT o FROM Organization o where id in :list_ids"),
+ @NamedQuery(name = "find-children-org", query = "SELECT o FROM Organization o where o.parentOrganization = :parentOrganization") })
public class Organization implements Serializable {
- @SuppressWarnings("unused")
- private static final Logger LOG = LogManager.getLogger(Organization.class);
+ @SuppressWarnings("unused")
+ private static final Logger LOG = LogManager.getLogger(Organization.class);
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
- @Id
- @GeneratedValue
- private Integer id;
+ @Id
+ @GeneratedValue
+ private Integer id;
- private String code;
- private String name;
- private String description;
+ private String code;
+ private String name;
+ private String description;
- @Column(name = "creation_timestamp")
- @JsonProperty("creation_timestamp")
- private Date creationTimestamp;
+ @Column(name = "creation_timestamp")
+ @JsonProperty("creation_timestamp")
+ private Date creationTimestamp;
- @JsonIgnore
- // We don't include the users to limit the size of each row a the listing
- @ManyToMany(cascade = CascadeType.REMOVE)
- @JoinTable(name = "user_organization", //
- joinColumns = {
- @JoinColumn(name = "organization_id", referencedColumnName = "id")
- }, //
- inverseJoinColumns = {
- @JoinColumn(name = "username", referencedColumnName = "username")
- })
- private Set<User> users;
+ @JsonIgnore
+ // We don't include the users to limit the size of each row a the listing
+ @ManyToMany(cascade = CascadeType.REMOVE)
+ @JoinTable(name = "user_organization", //
+ joinColumns = { @JoinColumn(name = "organization_id", referencedColumnName = "id") }, //
+ inverseJoinColumns = { @JoinColumn(name = "username", referencedColumnName = "username") })
+ private Set<User> users;
- @JsonIgnore
- // We don't include the users to limit the size of each row a the listing
- @ManyToOne
- @JoinColumn(name = "org_parent_id")
- private Organization parentOrganization;
+ @JsonIgnore
+ // We don't include the users to limit the size of each row a the listing
+ @ManyToOne
+ @JoinColumn(name = "org_parent_id")
+ private Organization parentOrganization;
- @JsonIgnore
- // We don't include the users to limit the size of each row a the listing
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "parentOrganization")
- private Set<Organization> childOrganizations;
+ @JsonIgnore
+ // We don't include the users to limit the size of each row a the listing
+ @OneToMany(fetch = FetchType.LAZY, mappedBy = "parentOrganization")
+ private Set<Organization> childOrganizations;
- public Integer getId() {
- return id;
- }
+ public Integer getId() {
+ return id;
+ }
- public void setId(Integer id) {
- this.id = id;
- }
+ public void setId(Integer id) {
+ this.id = id;
+ }
- public String getName() {
- return name;
- }
+ public String getName() {
+ return name;
+ }
- public void setName(String name) {
- this.name = name;
- }
+ public void setName(String name) {
+ this.name = name;
+ }
- public String getDescription() {
- return description;
- }
+ public String getDescription() {
+ return description;
+ }
- public void setDescription(String description) {
- this.description = description;
- }
+ public void setDescription(String description) {
+ this.description = description;
+ }
- public String getCode() {
- return code;
- }
+ public String getCode() {
+ return code;
+ }
- public void setCode(String code) {
- this.code = code;
- }
+ public void setCode(String code) {
+ this.code = code;
+ }
- public Date getCreationTimestamp() {
- return creationTimestamp;
- }
+ public Date getCreationTimestamp() {
+ return creationTimestamp;
+ }
- public void setCreationTimestamp(Date creationTimestamp) {
- this.creationTimestamp = creationTimestamp;
- }
+ public void setCreationTimestamp(Date creationTimestamp) {
+ this.creationTimestamp = creationTimestamp;
+ }
- public Set<User> getUsers() {
- return users;
- }
+ public Set<User> getUsers() {
+ return users;
+ }
- public void setUsers(Set<User> users) {
- this.users = users;
- }
+ public void setUsers(Set<User> users) {
+ this.users = users;
+ }
- public Organization getParentOrganization() {
- return parentOrganization;
- }
+ public Organization getParentOrganization() {
+ return parentOrganization;
+ }
- public void setParentOrganization(Organization parentOrganization) {
- this.parentOrganization = parentOrganization;
- }
+ public void setParentOrganization(Organization parentOrganization) {
+ this.parentOrganization = parentOrganization;
+ }
- // Roberto: Following methods are necessary to include in the REST list
- // response
- // information about the referenced entities.
- @JsonProperty("org_parent_id")
- public void setParentOrgId(Integer orgId) {
- if (orgId != null) {
- parentOrganization = new Organization();
- parentOrganization.setId(orgId);
- } else {
- parentOrganization = null;
- }
- }
+ // Roberto: Following methods are necessary to include in the REST list
+ // response
+ // information about the referenced entities.
+ @JsonProperty("org_parent_id")
+ public void setParentOrgId(Integer orgId) {
+ if (orgId != null) {
+ parentOrganization = new Organization();
+ parentOrganization.setId(orgId);
+ } else {
+ parentOrganization = null;
+ }
+ }
- @JsonProperty("org_parent_id")
- public Integer getParentOrgId() {
- return parentOrganization == null ? null : parentOrganization.getId();
- }
+ @JsonProperty("org_parent_id")
+ public Integer getParentOrgId() {
+ return parentOrganization == null ? null : parentOrganization.getId();
+ }
- @JsonProperty("org_parent_name")
- public String getParentOrgName() {
- return parentOrganization == null ? null : parentOrganization.getName();
- }
+ @JsonProperty("org_parent_name")
+ public String getParentOrgName() {
+ return parentOrganization == null ? null : parentOrganization.getName();
+ }
- @JsonProperty("users_ids")
- public void setUsersIds(List<String> usersIds) {
- users = new HashSet<>();
- if (usersIds != null) {
- for (String userid : usersIds) {
- User u = new User();
- u.setUsername(userid);
- users.add(u);
- }
- }
- }
+ @JsonProperty("users_ids")
+ public void setUsersIds(List<String> usersIds) {
+ users = new HashSet<>();
+ if (usersIds != null) {
+ for (String userid : usersIds) {
+ User u = new User();
+ u.setUsername(userid);
+ users.add(u);
+ }
+ }
+ }
- @JsonProperty("users_ids")
- public Set<String> getUsersIds() {
- if (users == null) {
- return null;
- }
- Set<String> ids = new HashSet<>();
- for (User user : users) {
- ids.add(user.getUsername());
- }
- return ids;
- }
+ @JsonProperty("users_ids")
+ public Set<String> getUsersIds() {
+ if (users == null) {
+ return null;
+ }
+ Set<String> ids = new HashSet<>();
+ for (User user : users) {
+ ids.add(user.getUsername());
+ }
+ return ids;
+ }
- public Set<Organization> getChildOrganizations() {
- return childOrganizations;
- }
+ public Set<Organization> getChildOrganizations() {
+ return childOrganizations;
+ }
- public void setChildOrganizations(Set<Organization> childOrganizations) {
- this.childOrganizations = childOrganizations;
- }
+ public void setChildOrganizations(Set<Organization> childOrganizations) {
+ this.childOrganizations = childOrganizations;
+ }
}
diff --git a/securis/src/main/java/net/curisit/securis/db/PackMetadata.java b/securis/src/main/java/net/curisit/securis/db/PackMetadata.java
index 8a73abe..5267635 100644
--- a/securis/src/main/java/net/curisit/securis/db/PackMetadata.java
+++ b/securis/src/main/java/net/curisit/securis/db/PackMetadata.java
@@ -26,7 +26,7 @@
@JsonInclude(Include.NON_NULL)
@Entity
@Table(name = "pack_metadata")
-@JsonIgnoreProperties(value = { "readonly" })
+@JsonIgnoreProperties(ignoreUnknown = true)
@NamedQueries({ @NamedQuery(name = "list-pack-metadata", query = "SELECT a FROM PackMetadata a where a.pack.id = :packId") })
public class PackMetadata implements Serializable {
diff --git a/securis/src/main/java/net/curisit/securis/db/User.java b/securis/src/main/java/net/curisit/securis/db/User.java
index e8b643b..e1e7396 100644
--- a/securis/src/main/java/net/curisit/securis/db/User.java
+++ b/securis/src/main/java/net/curisit/securis/db/User.java
@@ -19,6 +19,7 @@
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -29,217 +30,209 @@
*/
@JsonAutoDetect
@JsonInclude(Include.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
@Entity
@Table(name = "user")
-@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"),
- @NamedQuery(name = "auth-user", query = "SELECT u FROM User u where u.username = :username and u.password = :password"),
- @NamedQuery(name = "delete-all-users", query = "delete FROM User u")
-})
+@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"),
+ @NamedQuery(name = "auth-user", query = "SELECT u FROM User u where u.username = :username and u.password = :password"),
+ @NamedQuery(name = "delete-all-users", query = "delete FROM User u") })
public class User implements Serializable {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
- @Id
- private String username;
+ @Id
+ private String username;
- private String password;
+ private String password;
- @JsonProperty(value = "first_name")
- @Column(name = "first_name")
- private String firstName;
+ @JsonProperty(value = "first_name")
+ @Column(name = "first_name")
+ private String firstName;
- @JsonProperty(value = "last_name")
- @Column(name = "last_name")
- private String lastName;
+ @JsonProperty(value = "last_name")
+ @Column(name = "last_name")
+ private String lastName;
- private int roles;
+ private int roles;
- @Column(name = "last_login")
- private Date lastLogin;
+ @Column(name = "last_login")
+ private Date lastLogin;
- @Column(name = "modification_timestamp")
- private Date modificationTimestamp;
+ @Column(name = "modification_timestamp")
+ private Date modificationTimestamp;
- @Column(name = "creation_timestamp")
- @JsonProperty("creation_timestamp")
- private Date creationTimestamp;
+ @Column(name = "creation_timestamp")
+ @JsonProperty("creation_timestamp")
+ private Date creationTimestamp;
- private String lang;
+ private String lang;
- private String email;
+ private String email;
- @JsonIgnore
- @ManyToMany
- @JoinTable(name = "user_organization", //
- joinColumns = {
- @JoinColumn(name = "username", referencedColumnName = "username")
- }, //
- inverseJoinColumns = {
- @JoinColumn(name = "organization_id", referencedColumnName = "id")
- } //
- )
- private Set<Organization> organizations;
+ @JsonIgnore
+ @ManyToMany
+ @JoinTable(name = "user_organization", //
+ joinColumns = { @JoinColumn(name = "username", referencedColumnName = "username") }, //
+ inverseJoinColumns = { @JoinColumn(name = "organization_id", referencedColumnName = "id") } //
+ )
+ private Set<Organization> organizations;
- public String getUsername() {
- return username;
- }
+ public String getUsername() {
+ return username;
+ }
- public void setUsername(String username) {
- this.username = username;
- }
+ public void setUsername(String username) {
+ this.username = username;
+ }
- @JsonProperty("password")
- public String getDummyPassword() {
- return null;
- }
+ @JsonProperty("password")
+ public String getDummyPassword() {
+ return null;
+ }
- public String getPassword() {
- return password;
- }
+ public String getPassword() {
+ return password;
+ }
- public void setPassword(String password) {
- this.password = password;
- }
+ public void setPassword(String password) {
+ this.password = password;
+ }
- public List<Integer> getRoles() {
- if (roles == 0) {
- return null;
- }
- List<Integer> aux = new ArrayList<>();
- for (int rol : Rol.ALL) {
- if ((roles & rol) != 0) { // Each rol is a number with only 1 bit ==
- // 1 in binary representation
- aux.add(rol);
- }
- }
- return aux;
- }
+ public List<Integer> getRoles() {
+ if (roles == 0) {
+ return null;
+ }
+ List<Integer> aux = new ArrayList<>();
+ for (int rol : Rol.ALL) {
+ if ((roles & rol) != 0) { // Each rol is a number with only 1 bit ==
+ // 1 in binary representation
+ aux.add(rol);
+ }
+ }
+ return aux;
+ }
- public void setRoles(List<Integer> roles) {
- this.roles = 0;
- if (roles != null) {
- for (Integer rol : roles) {
- this.roles |= rol;
- }
- }
- }
+ public void setRoles(List<Integer> roles) {
+ this.roles = 0;
+ if (roles != null) {
+ for (Integer rol : roles) {
+ this.roles |= rol;
+ }
+ }
+ }
- public String getFirstName() {
- return firstName;
- }
+ public String getFirstName() {
+ return firstName;
+ }
- public void setFirstName(String firstName) {
- this.firstName = firstName;
- }
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
- public String getLastName() {
- return lastName;
- }
+ public String getLastName() {
+ return lastName;
+ }
- public void setLastName(String lastName) {
- this.lastName = lastName;
- }
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
- public Date getLastLogin() {
- return lastLogin;
- }
+ public Date getLastLogin() {
+ return lastLogin;
+ }
- public void setLastLogin(Date lastLogin) {
- this.lastLogin = lastLogin;
- }
+ public void setLastLogin(Date lastLogin) {
+ this.lastLogin = lastLogin;
+ }
- public Date getModificationTimestamp() {
- return modificationTimestamp;
- }
+ public Date getModificationTimestamp() {
+ return modificationTimestamp;
+ }
- public void setModificationTimestamp(Date modificationTimestamp) {
- this.modificationTimestamp = modificationTimestamp;
- }
+ public void setModificationTimestamp(Date modificationTimestamp) {
+ this.modificationTimestamp = modificationTimestamp;
+ }
- public Date getCreationTimestamp() {
- return creationTimestamp;
- }
+ public Date getCreationTimestamp() {
+ return creationTimestamp;
+ }
- public void setCreationTimestamp(Date creationTimestamp) {
- this.creationTimestamp = creationTimestamp;
- }
+ public void setCreationTimestamp(Date creationTimestamp) {
+ this.creationTimestamp = creationTimestamp;
+ }
- @Override
- public String toString() {
- return "{User: " + username + " Name: " + firstName + " " + lastName + ", last login: " + lastLogin + "}";
- }
+ @Override
+ public String toString() {
+ return "{User: " + username + " Name: " + firstName + " " + lastName + ", last login: " + lastLogin + "}";
+ }
- public String getLang() {
- return lang;
- }
+ public String getLang() {
+ return lang;
+ }
- public void setLang(String lang) {
- this.lang = lang;
- }
+ public void setLang(String lang) {
+ this.lang = lang;
+ }
- public Set<Organization> getOrganizations() {
- return organizations;
- }
+ public Set<Organization> getOrganizations() {
+ return organizations;
+ }
- public void setOrganizations(Set<Organization> organizations) {
- this.organizations = organizations;
- }
+ public void setOrganizations(Set<Organization> organizations) {
+ this.organizations = organizations;
+ }
- @JsonProperty("organizations_ids")
- public void setOrgsIds(List<Integer> orgsIds) {
- organizations = new HashSet<>();
- for (Integer orgid : orgsIds) {
- Organization o = new Organization();
- o.setId(orgid);
- organizations.add(o);
- }
- }
+ @JsonProperty("organizations_ids")
+ public void setOrgsIds(List<Integer> orgsIds) {
+ organizations = new HashSet<>();
+ for (Integer orgid : orgsIds) {
+ Organization o = new Organization();
+ o.setId(orgid);
+ organizations.add(o);
+ }
+ }
- @JsonProperty("organizations_ids")
- public Set<Integer> getOrgsIds() {
- if (organizations == null) {
- return null;
- }
- Set<Integer> ids = new HashSet<>();
- for (Organization org : organizations) {
- ids.add(org.getId());
- }
- return ids;
- }
+ @JsonProperty("organizations_ids")
+ public Set<Integer> getOrgsIds() {
+ if (organizations == null) {
+ return null;
+ }
+ Set<Integer> ids = new HashSet<>();
+ for (Organization org : organizations) {
+ ids.add(org.getId());
+ }
+ return ids;
+ }
- @JsonIgnore
- public Set<Integer> getAllOrgsIds() {
- if (organizations == null) {
- return null;
- }
- Set<Integer> ids = new HashSet<>();
- includeAllOrgs(this.organizations, ids);
- return ids;
- }
+ @JsonIgnore
+ public Set<Integer> getAllOrgsIds() {
+ if (organizations == null) {
+ return null;
+ }
+ Set<Integer> ids = new HashSet<>();
+ includeAllOrgs(this.organizations, ids);
+ return ids;
+ }
- private void includeAllOrgs(Set<Organization> list, Set<Integer> orgIds) {
- for (Organization org : list) {
- orgIds.add(org.getId());
- includeAllOrgs(org.getChildOrganizations(), orgIds);
- }
- }
+ private void includeAllOrgs(Set<Organization> list, Set<Integer> orgIds) {
+ for (Organization org : list) {
+ orgIds.add(org.getId());
+ includeAllOrgs(org.getChildOrganizations(), orgIds);
+ }
+ }
- public String getEmail() {
- return email;
- }
+ public String getEmail() {
+ return email;
+ }
- public void setEmail(String email) {
- this.email = email;
- }
+ public void setEmail(String email) {
+ this.email = email;
+ }
- public static class Rol {
- public static final int ADVANCE = 0x01;
- public static final int ADMIN = 0x02;
- public static final int[] ALL = new int[] {
- ADVANCE, ADMIN
- };
- }
+ public static class Rol {
+ public static final int ADVANCE = 0x01;
+ public static final int ADMIN = 0x02;
+ public static final int[] ALL = new int[] { ADVANCE, ADMIN };
+ }
}
--
Gitblit v1.3.2