summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-widget-ms/widget-ms/src/main
diff options
context:
space:
mode:
authorDominik Mizyn <d.mizyn@samsung.com>2019-06-14 11:36:33 +0200
committerDominik Mizyn <d.mizyn@samsung.com>2019-06-14 11:36:36 +0200
commit080b554615fb6d67de14bc3ee2a80145e6fe99ef (patch)
treeaa7f356ac02f3194f30a224026589b1fd47b1480 /ecomp-portal-widget-ms/widget-ms/src/main
parent4491bf16d2ecf2a413b7417ed82929e5f77d2528 (diff)
MicroserviceDataApp class DB constraints
Java Bean Validation SR 380 annotations added to classes Issue-ID: PORTAL-634 Change-Id: Ife3b0116b986d52fd17612937b2a74fa76062ed9 Signed-off-by: Dominik Mizyn <d.mizyn@samsung.com>
Diffstat (limited to 'ecomp-portal-widget-ms/widget-ms/src/main')
-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