summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-widget-ms
diff options
context:
space:
mode:
authorSunder Tattavarada <statta@research.att.com>2019-06-17 21:24:30 +0000
committerGerrit Code Review <gerrit@onap.org>2019-06-17 21:24:30 +0000
commite42eae64a6ed2dbdf9dd1112bb31633faf60e0a3 (patch)
tree50655854f6c58f79a2ed419bae9464aad3a8168b /ecomp-portal-widget-ms
parent4d0b6c18868e0a5fdbd876d4e0fdb18ae5b4573e (diff)
parent080b554615fb6d67de14bc3ee2a80145e6fe99ef (diff)
Merge "MicroserviceDataApp class DB constraints"
Diffstat (limited to 'ecomp-portal-widget-ms')
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceData.java98
1 files changed, 26 insertions, 72 deletions
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceData.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceData.java
index 7d45a112..43e7b2b0 100644
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceData.java
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceData.java
@@ -6,6 +6,12 @@ import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.Getter;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
/**
* TODO: moved all microservice-related code (domain, controller, service)
@@ -13,109 +19,57 @@ import javax.persistence.Table;
*/
@Entity
@Table(name="EP_MICROSERVICE")
+@Getter
+@Setter
public class MicroserviceData {
@Id
@Column(name = "id")
+ @Digits(integer = 11, fraction = 0)
@GeneratedValue(strategy=GenerationType.AUTO)
private Long id;
@Column(name = "name")
+ @Size(max = 50)
+ @SafeHtml
private String name;
@Column(name = "description")
+ @Size(max = 50)
+ @SafeHtml
private String desc;
@Column(name = "appId")
+ @Digits(integer = 11, fraction = 0)
private long appId;
@Column(name = "endpoint_url")
+ @Size(max = 200)
+ @SafeHtml
private String url;
@Column(name = "security_type")
+ @Size(max = 50)
+ @SafeHtml
private String securityType;
@Column(name = "username")
+ @Size(max = 50)
+ @SafeHtml
private String username;
@Column(name = "password")
+ @Size(max = 50)
+ @SafeHtml
+ @NotNull
private String password;
@Column(name = "active")
+ @Size(max = 1)
+ @SafeHtml
+ @NotNull
private String active;
- public Long getId() {
- return id;
- }
-
- public void setId(Long id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getDesc() {
- return desc;
- }
-
- public void setDesc(String desc) {
- this.desc = desc;
- }
-
- public long getAppId() {
- return appId;
- }
-
- public void setAppId(long appId) {
- this.appId = appId;
- }
-
- public String getUrl() {
- return url;
- }
-
- public void setUrl(String url) {
- this.url = url;
- }
-
- public String getSecurityType() {
- return securityType;
- }
-
- public void setSecurityType(String securityType) {
- this.securityType = securityType;
- }
-
- public String getUsername() {
- return username;
- }
-
- public void setUsername(String username) {
- this.username = username;
- }
-
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- public String getActive() {
- return active;
- }
-
- public void setActive(String active) {
- this.active = active;
- }
-
@Override
public String toString() {
return "MicroserviceData [name=" + name + ", desc=" + desc + ", appId=" + appId + ", url=" + url