summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-fw
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-sdk/epsdk-fw')
-rw-r--r--ecomp-sdk/epsdk-fw/pom.xml16
-rw-r--r--ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/crossapi/PortalRestAPICentralServiceImpl.java2
-rw-r--r--ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/crossapi/PortalRestAPIProxy.java6
-rw-r--r--ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/restful/domain/EcompRole.java9
-rw-r--r--ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/restful/domain/EcompRoleFunction.java21
5 files changed, 33 insertions, 21 deletions
diff --git a/ecomp-sdk/epsdk-fw/pom.xml b/ecomp-sdk/epsdk-fw/pom.xml
index 15424eee..5529a082 100644
--- a/ecomp-sdk/epsdk-fw/pom.xml
+++ b/ecomp-sdk/epsdk-fw/pom.xml
@@ -75,12 +75,12 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
- <version>2.6.3</version>
+ <version>2.9.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
- <version>2.6.3</version>
+ <version>2.9.2</version>
</dependency>
<dependency>
<groupId>org.owasp.esapi</groupId>
@@ -115,7 +115,7 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
- <version>1.1.1</version>
+ <version>1.2.3</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -161,6 +161,16 @@
<scope>test</scope>
<version>${jacoco.version}</version>
</dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <version>1.3.3</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.9.2</version>
+ </dependency>
</dependencies>
</project>
diff --git a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/crossapi/PortalRestAPICentralServiceImpl.java b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/crossapi/PortalRestAPICentralServiceImpl.java
index 42dac01a..b9b970e8 100644
--- a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/crossapi/PortalRestAPICentralServiceImpl.java
+++ b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/crossapi/PortalRestAPICentralServiceImpl.java
@@ -143,7 +143,7 @@ public class PortalRestAPICentralServiceImpl implements IPortalRestAPIService {
TypeFactory.defaultInstance().constructCollectionType(List.class, EcompRole.class));
} catch (IOException e) {
- String response = "PortalRestAPICentralServiceImpl.getUsers failed";
+ String response = "PortalRestAPICentralServiceImpl.getRoles failed";
logger.error(response, e);
throw new PortalAPIException(response, e);
}
diff --git a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/crossapi/PortalRestAPIProxy.java b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/crossapi/PortalRestAPIProxy.java
index 810771bd..8669b414 100644
--- a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/crossapi/PortalRestAPIProxy.java
+++ b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/crossapi/PortalRestAPIProxy.java
@@ -251,7 +251,7 @@ public class PortalRestAPIProxy extends HttpServlet implements IPortalRestAPISer
pushUser(user);
if (logger.isDebugEnabled())
logger.debug("doPost: pushUser: success");
- responseJson = buildJsonResponse(true, null);
+ responseJson = buildJsonResponse(true, "user saved successfully");
response.setStatus(HttpServletResponse.SC_OK);
} catch (Exception ex) {
responseJson = buildJsonResponse(ex);
@@ -267,7 +267,7 @@ public class PortalRestAPIProxy extends HttpServlet implements IPortalRestAPISer
editUser(loginId, user);
if (logger.isDebugEnabled())
logger.debug("doPost: editUser: success");
- responseJson = buildJsonResponse(true, null);
+ responseJson = buildJsonResponse(true, "user saved successfully");
response.setStatus(HttpServletResponse.SC_OK);
} catch (Exception ex) {
responseJson = buildJsonResponse(ex);
@@ -290,7 +290,7 @@ public class PortalRestAPIProxy extends HttpServlet implements IPortalRestAPISer
pushUserRole(loginId, roles);
if (logger.isDebugEnabled())
logger.debug("doPost: pushUserRole: success");
- responseJson = buildJsonResponse(true, null);
+ responseJson = buildJsonResponse(true, "saveRoles is successful");
response.setStatus(HttpServletResponse.SC_OK);
}
} catch (Exception ex) {
diff --git a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/restful/domain/EcompRole.java b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/restful/domain/EcompRole.java
index f0447142..a7b8fc05 100644
--- a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/restful/domain/EcompRole.java
+++ b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/restful/domain/EcompRole.java
@@ -46,14 +46,12 @@ import com.fasterxml.jackson.annotation.JsonInclude;
* This bean holds the information for a role in the role and user management
* REST API.
*/
-@JsonIgnoreProperties(ignoreUnknown = true)
public class EcompRole implements Comparable<EcompRole> {
protected Long id;
private String name;
- @JsonInclude(JsonInclude.Include.NON_NULL)
private Set roleFunctions;
-
+
public Set getRoleFunctions() {
return roleFunctions;
}
@@ -103,10 +101,11 @@ public class EcompRole implements Comparable<EcompRole> {
return true;
}
+
+
@Override
public String toString() {
- String s = "@EcompRole[id: " + id + "; name: " + name + "]";
- return s;
+ return "EcompRole [id=" + id + ", name=" + name + ", roleFunctions=" + roleFunctions + "]";
}
@Override
diff --git a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/restful/domain/EcompRoleFunction.java b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/restful/domain/EcompRoleFunction.java
index 6e108a02..f0ad43e0 100644
--- a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/restful/domain/EcompRoleFunction.java
+++ b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/restful/domain/EcompRoleFunction.java
@@ -37,17 +37,11 @@
*/
package org.onap.portalsdk.core.restful.domain;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonInclude;
-
-@JsonIgnoreProperties(ignoreUnknown = true)
public class EcompRoleFunction implements Comparable<EcompRoleFunction>{
private String name;
private String code;
- @JsonInclude(JsonInclude.Include.NON_NULL)
private String type;
- @JsonInclude(JsonInclude.Include.NON_NULL)
private String action;
@@ -75,10 +69,19 @@ public class EcompRoleFunction implements Comparable<EcompRoleFunction>{
public void setAction(String action) {
this.action = action;
}
+
@Override
public int compareTo(EcompRoleFunction arg0) {
- return this.getCode().compareTo(arg0.getCode());
+ int result = this.code.compareTo(arg0.getCode());
+ if (result == 0) {
+ result = this.name.compareTo(arg0.getName());
+ }
+ if (result == 0) {
+ result = this.type.compareTo(arg0.getType());
+ }
+ if (result == 0) {
+ result = this.action.compareTo(arg0.getAction());
+ }
+ return result;
}
-
}
-