From: sa282w Date: Tue, 1 May 2018 20:45:26 +0000 (-0400) Subject: Changes for 2.4.0-SNAPSHOT X-Git-Tag: 2.4.0~8 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F07%2F45507%2F2;p=portal%2Fsdk.git Changes for 2.4.0-SNAPSHOT Issue-ID: PORTAL-210 Included the pom changes for 2.4.0-SNAPSHOT, music and AAF changes. Change-Id: Ib1e1c2679271aa40eb3b50397724e8cdc5ffe01c Signed-off-by: sa282w --- diff --git a/.gitignore b/.gitignore index dc5e3138..c2996350 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .idea .project +ecomp-sdk/*/.settings /bin/ ecomp-sdk/*/logs/ ecomp-sdk/*/debug-logs/ diff --git a/ecomp-sdk/epsdk-aaf/pom.xml b/ecomp-sdk/epsdk-aaf/pom.xml new file mode 100644 index 00000000..cccfc833 --- /dev/null +++ b/ecomp-sdk/epsdk-aaf/pom.xml @@ -0,0 +1,165 @@ + + 4.0.0 + + + org.onap.portal.sdk + epsdk-project + 2.4.0-SNAPSHOT + + + org.onap.portal.sdk + epsdk-aaf + 2.4.0-SNAPSHOT + jar + + ONAP Portal SDK AAF Authorization + + + UTF-8 + 4.2.0.RELEASE + + + + + org.onap.portal.sdk + epsdk-fw + ${project.version} + + + commons-logging + commons-logging + + + + + + org.onap.portal.sdk + epsdk-core + ${project.version} + + + commons-logging + commons-logging + + + + + com.att.eelf + eelf-core + 1.0.0 + + + + org.springframework + spring-core + ${springframework.version} + + + commons-logging + commons-logging + + + + + org.springframework + spring-web + ${springframework.version} + + + org.springframework + spring-webmvc + ${springframework.version} + + + org.springframework + spring-context-support + ${springframework.version} + + + org.springframework + spring-test + ${springframework.version} + + + org.springframework + spring-aop + ${springframework.version} + + + org.springframework.boot + spring-boot-starter + 1.3.0.RELEASE + + + org.slf4j + log4j-over-slf4j + + + ch.qos.logback + logback-classic + + + + + + com.fasterxml.jackson.core + jackson-annotations + 2.6.3 + + + com.fasterxml.jackson.core + jackson-core + 2.6.3 + + + com.fasterxml.jackson.core + jackson-databind + 2.6.3 + + + junit + junit + 3.8.1 + test + + + + + + doclint-java8-disable + + [1.8,) + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + -Xdoclint:none + + + + + + + + + epsdk-aaf + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.8 + 1.8 + + + + + diff --git a/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalAccessPerms.java b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalAccessPerms.java new file mode 100644 index 00000000..80956e64 --- /dev/null +++ b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalAccessPerms.java @@ -0,0 +1,178 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.external.authorization.domain; + +import java.io.Serializable; + +public class ExternalAccessPerms implements Serializable, Comparable { + + /** + * + */ + private static final long serialVersionUID = -200964838466882602L; + private String type; + private String instance; + private String action; + private String description; + + public ExternalAccessPerms() { + super(); + } + + public ExternalAccessPerms(String type, String instance, String action, String description) { + super(); + this.type = type; + this.instance = instance; + this.action = action; + this.description = description; + } + + public ExternalAccessPerms(String type, String instance, String action) { + super(); + this.type = type; + this.instance = instance; + this.action = action; + } + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @param type + * the type to set + */ + public void setType(String type) { + this.type = type; + } + + /** + * @return the instance + */ + public String getInstance() { + return instance; + } + + /** + * @param instance + * the instance to set + */ + public void setInstance(String instance) { + this.instance = instance; + } + + /** + * @return the action + */ + public String getAction() { + return action; + } + + /** + * @param action + * the action to set + */ + public void setAction(String action) { + this.action = action; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + @Override + public int compareTo(Object obj) { + ExternalAccessPerms other = (ExternalAccessPerms) obj; + + String c1 = getInstance(); + String c2 = other.getInstance(); + + return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((action == null) ? 0 : action.hashCode()); + result = prime * result + ((description == null) ? 0 : description.hashCode()); + result = prime * result + ((instance == null) ? 0 : instance.hashCode()); + result = prime * result + ((type == null) ? 0 : type.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + ExternalAccessPerms other = (ExternalAccessPerms) obj; + if (action == null) { + if (other.action != null) + return false; + } else if (!action.equals(other.action)) + return false; + if (description == null) { + if (other.description != null) + return false; + } else if (!description.equals(other.description)) + return false; + if (instance == null) { + if (other.instance != null) + return false; + } else if (!instance.equals(other.instance)) + return false; + if (type == null) { + if (other.type != null) + return false; + } else if (!type.equals(other.type)) + return false; + return true; + } + +} diff --git a/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalAccessPermsDetail.java b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalAccessPermsDetail.java new file mode 100644 index 00000000..fab7d2c0 --- /dev/null +++ b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalAccessPermsDetail.java @@ -0,0 +1,127 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.external.authorization.domain; + +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonRootName(value="perm") +public class ExternalAccessPermsDetail { + + private String type; + private String instance; + private String action; + private List roles; + private String description; + + + + public ExternalAccessPermsDetail() { + super(); + } + + /** + * @param type + * @param instance + * @param action + * @param roles + * @param description + */ + public ExternalAccessPermsDetail(String type, String instance, String action, List roles, + String description) { + super(); + this.type = type; + this.instance = instance; + this.action = action; + this.roles = roles; + this.description = description; + } + + /** + * @param type + * @param instance + * @param action + * @param description + */ + public ExternalAccessPermsDetail(String type, String instance, String action, + String description) { + super(); + this.type = type; + this.instance = instance; + this.action = action; + this.description = description; + } + + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + public String getInstance() { + return instance; + } + public void setInstance(String instance) { + this.instance = instance; + } + public String getAction() { + return action; + } + public void setAction(String action) { + this.action = action; + } + public List getRoles() { + return roles; + } + + public void setRoles(List roles) { + this.roles = roles; + } + + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + + +} diff --git a/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalAccessRole.java b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalAccessRole.java new file mode 100644 index 00000000..a14a4b5f --- /dev/null +++ b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalAccessRole.java @@ -0,0 +1,76 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.external.authorization.domain; + +import java.io.Serializable; + +public class ExternalAccessRole implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 3439986826362436339L; + public String name; + public String description; + + public ExternalAccessRole() { + + } + + public ExternalAccessRole(String name, String description) { + super(); + this.name = name; + this.description = description; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + +} diff --git a/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalAccessRolePerms.java b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalAccessRolePerms.java new file mode 100644 index 00000000..f38b2f9f --- /dev/null +++ b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalAccessRolePerms.java @@ -0,0 +1,66 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.external.authorization.domain; + +public class ExternalAccessRolePerms { + + private ExternalAccessPerms perm; + private String role; + + + public ExternalAccessRolePerms(ExternalAccessPerms perm, String role) { + super(); + this.perm = perm; + this.role = role; + } + + public ExternalAccessPerms getPerm() { + return perm; + } + public void setPerm(ExternalAccessPerms perm) { + this.perm = perm; + } + public String getRole() { + return role; + } + public void setRole(String role) { + this.role = role; + } + + +} diff --git a/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalAccessUser.java b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalAccessUser.java new file mode 100644 index 00000000..3ca88991 --- /dev/null +++ b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalAccessUser.java @@ -0,0 +1,65 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.external.authorization.domain; + +public class ExternalAccessUser { + + private String user; + private String role; + + public ExternalAccessUser(String user, String role) { + super(); + this.user = user; + this.role = role; + } + + public String getUser() { + return user; + } + public void setUser(String user) { + this.user = user; + } + public String getRole() { + return role; + } + public void setRole(String role) { + this.role = role; + } + + +} diff --git a/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalAccessUserRoleDetail.java b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalAccessUserRoleDetail.java new file mode 100644 index 00000000..5106f387 --- /dev/null +++ b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalAccessUserRoleDetail.java @@ -0,0 +1,104 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.external.authorization.domain; + +public class ExternalAccessUserRoleDetail { + + private String name; + private ExternalRoleDescription description; + + + /** + * + */ + public ExternalAccessUserRoleDetail() { + super(); + } + + public ExternalAccessUserRoleDetail(String name, ExternalRoleDescription description) { + super(); + this.name = name; + this.description = description; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public ExternalRoleDescription getDescription() { + return description; + } + public void setDescription(ExternalRoleDescription description) { + this.description = description; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((description == null) ? 0 : description.hashCode()); + result = prime * result + ((name == null) ? 0 : name.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + ExternalAccessUserRoleDetail other = (ExternalAccessUserRoleDetail) obj; + if (description == null) { + if (other.description != null) + return false; + } else if (!description.equals(other.description)) + return false; + if (name == null) { + if (other.name != null) + return false; + } else if (!name.equals(other.name)) + return false; + return true; + } + + +} diff --git a/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalAuthUserRole.java b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalAuthUserRole.java new file mode 100644 index 00000000..33e21f2c --- /dev/null +++ b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalAuthUserRole.java @@ -0,0 +1,74 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.external.authorization.domain; + +import java.io.Serializable; + +public class ExternalAuthUserRole implements Serializable{ + + /** + * + */ + private static final long serialVersionUID = 5066251837431287376L; + + private String role; + private String user; + private String expiryDate; + + public String getRole() { + return role; + } + public void setRole(String role) { + this.role = role; + } + public String getUser() { + return user; + } + public void setUser(String user) { + this.user = user; + } + public String getExpiryDate() { + return expiryDate; + } + public void setExpiryDate(String expiryDate) { + this.expiryDate = expiryDate; + } + + + +} diff --git a/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalRoleDescription.java b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalRoleDescription.java new file mode 100644 index 00000000..d09db15d --- /dev/null +++ b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/domain/ExternalRoleDescription.java @@ -0,0 +1,150 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.external.authorization.domain; + +import java.util.List; + +public class ExternalRoleDescription { + + private String id; + private String name; + private String active; + private String priority; + private String appId; + private String appRoleId; + private List permissions; + + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getActive() { + return active; + } + public void setActive(String active) { + this.active = active; + } + public String getPriority() { + return priority; + } + public void setPriority(String priority) { + this.priority = priority; + } + public String getAppId() { + return appId; + } + public void setAppId(String appId) { + this.appId = appId; + } + public String getAppRoleId() { + return appRoleId; + } + public void setAppRoleId(String appRoleId) { + this.appRoleId = appRoleId; + } + + public List getPermissions() { + return permissions; + } + public void setPermissions(List permissions) { + this.permissions = permissions; + } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((active == null) ? 0 : active.hashCode()); + result = prime * result + ((appId == null) ? 0 : appId.hashCode()); + result = prime * result + ((appRoleId == null) ? 0 : appRoleId.hashCode()); + result = prime * result + ((id == null) ? 0 : id.hashCode()); + result = prime * result + ((name == null) ? 0 : name.hashCode()); + result = prime * result + ((priority == null) ? 0 : priority.hashCode()); + return result; + } + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + ExternalRoleDescription other = (ExternalRoleDescription) obj; + if (active == null) { + if (other.active != null) + return false; + } else if (!active.equals(other.active)) + return false; + if (appId == null) { + if (other.appId != null) + return false; + } else if (!appId.equals(other.appId)) + return false; + if (appRoleId == null) { + if (other.appRoleId != null) + return false; + } else if (!appRoleId.equals(other.appRoleId)) + return false; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + if (name == null) { + if (other.name != null) + return false; + } else if (!name.equals(other.name)) + return false; + if (priority == null) { + if (other.priority != null) + return false; + } else if (!priority.equals(other.priority)) + return false; + return true; + } + + +} diff --git a/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/exception/UserNotFoundException.java b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/exception/UserNotFoundException.java new file mode 100644 index 00000000..8d15b44c --- /dev/null +++ b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/exception/UserNotFoundException.java @@ -0,0 +1,47 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.external.authorization.exception; + +public class UserNotFoundException extends Exception { + + private static final long serialVersionUID = 1616470595106815228L; + + public UserNotFoundException(String msg) { + super(msg); + } +} diff --git a/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/LoginExternalAuthService.java b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/LoginExternalAuthService.java new file mode 100644 index 00000000..8f387f98 --- /dev/null +++ b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/LoginExternalAuthService.java @@ -0,0 +1,80 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.external.authorization.service; + +import java.io.IOException; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; + +import org.onap.portalsdk.core.command.LoginBean; +import org.onap.portalsdk.core.domain.User; + +public interface LoginExternalAuthService { + + /** + * validate user exists in the system + * @param bean + * @param menuPropertiesFilename + * @param additionalParams + * @return returns login user bean + * @throws IOException + */ + @SuppressWarnings("rawtypes") + LoginBean findUser(LoginBean bean, String menuPropertiesFilename, Map additionalParams, HttpServletRequest request) throws Exception; + + /** + * + * @param bean + * @param menuPropertiesFilename + * @param additionalParams + * @param matchPassword + * @return returns login user bean + * @throws IOException + */ + @SuppressWarnings("rawtypes") + LoginBean findUser(LoginBean bean, String menuPropertiesFilename, Map additionalParams, boolean matchPassword, HttpServletRequest request) + throws Exception; + + /** + * + * @param orgUserId + * @return + */ + User findUserWithoutPwd(String orgUserId); +} diff --git a/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/LoginExternalAuthServiceImpl.java b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/LoginExternalAuthServiceImpl.java new file mode 100644 index 00000000..d2ccfc2e --- /dev/null +++ b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/LoginExternalAuthServiceImpl.java @@ -0,0 +1,252 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.external.authorization.service; + +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.servlet.http.HttpServletRequest; + +import org.onap.portalsdk.core.command.LoginBean; +import org.onap.portalsdk.core.domain.Role; +import org.onap.portalsdk.core.domain.User; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.menu.MenuBuilder; +import org.onap.portalsdk.core.service.DataAccessService; +import org.onap.portalsdk.core.service.LoginServiceCentralizedImpl; +import org.onap.portalsdk.core.util.SystemProperties; +import org.onap.portalsdk.core.web.support.AppUtils; +import org.onap.portalsdk.core.web.support.UserUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service("loginExternalAuthService") +public class LoginExternalAuthServiceImpl implements LoginExternalAuthService { + + private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(LoginServiceCentralizedImpl.class); + + @Autowired + private DataAccessService dataAccessService; + + @Autowired + private UserApiService userApiService; + + @Override + public LoginBean findUser(LoginBean bean, String menuPropertiesFilename, + @SuppressWarnings("rawtypes") Map additionalParams, HttpServletRequest request) throws Exception { + return findUser(bean, menuPropertiesFilename, additionalParams, true, request); + } + + @Override + @SuppressWarnings("rawtypes") + public LoginBean findUser(LoginBean bean, String menuPropertiesFilename, Map additionalParams, + boolean matchPassword, HttpServletRequest request) throws Exception { + + User user; + if (bean.getUserid() != null) { + user = findUser(bean, request); + } else { + if (matchPassword) + user = findUser(bean.getLoginId(), bean.getLoginPwd()); + else + user = findUserWithoutPwd(bean.getLoginId()); + } + + if (user != null) { + if (AppUtils.isApplicationLocked() + && !UserUtils.hasRole(user, SystemProperties.getProperty(SystemProperties.SYS_ADMIN_ROLE_ID))) { + bean.setLoginErrorMessage(SystemProperties.MESSAGE_KEY_LOGIN_ERROR_APPLICATION_LOCKED); + } + + // raise an error if the user is inactive + if (!user.getActive()) { + bean.setLoginErrorMessage(SystemProperties.MESSAGE_KEY_LOGIN_ERROR_USER_INACTIVE); + } + + if (!userHasActiveRoles(user)) { + bean.setLoginErrorMessage(SystemProperties.MESSAGE_KEY_LOGIN_ERROR_USER_INACTIVE); + } + // only login the user if no errors have occurred + if (bean.getLoginErrorMessage() == null) { + + // this will be a snapshot of the user's information as + // retrieved from the database + User userCopy = null; + try { + userCopy = (User) user.clone(); + } catch (CloneNotSupportedException ex) { + // Never happens + logger.error(EELFLoggerDelegate.errorLogger, "findUser failed", ex); + } + + User appuser = findUserWithoutPwd(user.getLoginId()); + + if (appuser == null && userHasRoleFunctions(user)) { + createUserIfNecessary(user); + } else { + appuser.setLastLoginDate(new Date()); + + // update the last logged in date for the user + dataAccessService.saveDomainObject(appuser, additionalParams); + } + // update the audit log of the user + // Check for the client device type and set log attributes + // appropriately + + // save the above changes to the User and their audit trail + + // create the application menu based on the user's privileges + + Set appMenu = getMenuBuilder().getMenu( + SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_SET_NAME), dataAccessService); + bean.setMenu(appMenu != null ? appMenu : new HashSet()); + Set businessDirectMenu = getMenuBuilder().getMenu( + SystemProperties.getProperty(SystemProperties.BUSINESS_DIRECT_MENU_SET_NAME), + dataAccessService); + bean.setBusinessDirectMenu(businessDirectMenu != null ? businessDirectMenu : new HashSet()); + + bean.setUser(userCopy); + } + } + + return bean; + } + + private void createUserIfNecessary(User user) { + logger.debug(EELFLoggerDelegate.debugLogger, "createUser: " + user.getOrgUserId()); + User user1 = new User(); + user1.setEmail(user.getEmail()); + user1.setEmail(user.getEmail()); + user1.setFirstName(user.getFirstName()); + user1.setHrid(user.getHrid()); + user1.setJobTitle(user.getJobTitle()); + user1.setLastName(user.getLastName()); + user1.setLoginId(user.getLoginId()); + user1.setOrgManagerUserId(user.getOrgManagerUserId()); + user1.setMiddleInitial(user.getMiddleInitial()); + user1.setOrgCode(user.getOrgCode()); + user1.setOrgId(user.getOrgId()); + user1.setPhone(user.getPhone()); + user1.setOrgUserId(user.getOrgUserId()); + user1.setActive(user.getActive()); + user1.setLastLoginDate(new Date()); + + try { + dataAccessService.saveDomainObject(user1, null); + logger.debug(EELFLoggerDelegate.debugLogger, "createdUser Successfully: " + user.getOrgUserId()); + } catch (Exception ex) { + logger.error(EELFLoggerDelegate.errorLogger, "createUserIfNecessary failed", ex); + } + + } + + private boolean userHasActiveRoles(User user) { + boolean hasActiveRole = false; + @SuppressWarnings("rawtypes") + Iterator roles = user.getRoles().iterator(); + while (roles.hasNext()) { + Role role = (Role) roles.next(); + if (role.getActive()) { + hasActiveRole = true; + break; + } + } + return hasActiveRole; + } + + private boolean userHasRoleFunctions(User user) { + boolean hasRoleFunctions = false; + @SuppressWarnings("rawtypes") + Iterator roles = user.getRoles().iterator(); + while (roles.hasNext()) { + Role role = (Role) roles.next(); + if (role.getActive() && role.getRoleFunctions() != null && !role.getRoleFunctions().isEmpty()) { + hasRoleFunctions = true; + break; + } + } + return hasRoleFunctions; + } + + private User findUser(LoginBean bean, HttpServletRequest request) throws Exception { + User user = userApiService.getUser(bean.getUserid(), request); + user.setId(getUserIdByOrgUserId(user.getOrgUserId())); + user.setLoginId(bean.getUserid()); + logger.debug(EELFLoggerDelegate.debugLogger, "findUser: Returning final user roles and permissions", user.toString()); + return user; + } + + private Long getUserIdByOrgUserId(String orgUserId) { + Map params = new HashMap<>(); + params.put("orgUserId", orgUserId); + @SuppressWarnings("rawtypes") + List list = dataAccessService.executeNamedQuery("getUserIdByorgUserId", params, null); + Long userId = null; + if (list != null && !list.isEmpty()) + userId = (Long) list.get(0); + return userId; + } + + @SuppressWarnings("rawtypes") + private User findUser(String loginId, String password) { + Map params = new HashMap<>(); + params.put("login_id", loginId); + params.put("login_pwd", password); + List list = dataAccessService.executeNamedQuery("getUserByLoginIdLoginPwd", params, new HashMap()); + return (list == null || list.isEmpty()) ? null : (User) list.get(0); + } + + @SuppressWarnings("rawtypes") + @Override + public User findUserWithoutPwd(String loginId) { + Map params = new HashMap<>(); + params.put("org_user_id", loginId); + List list = dataAccessService.executeNamedQuery("getUserByOrgUserId", params, new HashMap()); + return (list == null || list.isEmpty()) ? null : (User) list.get(0); + } + + private MenuBuilder getMenuBuilder() { + return new MenuBuilder(); + } + +} diff --git a/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/UserApiService.java b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/UserApiService.java new file mode 100644 index 00000000..6eb312b6 --- /dev/null +++ b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/UserApiService.java @@ -0,0 +1,66 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.external.authorization.service; + +import java.util.List; + +import javax.servlet.http.HttpServletRequest; + +import org.onap.portalsdk.core.domain.RoleFunction; +import org.onap.portalsdk.core.domain.User; +import org.onap.portalsdk.external.authorization.exception.UserNotFoundException; + +public interface UserApiService { + + /** + * Gets list of all roles associated to user from external system + * + * @param orgUserId + * @return + * @throws Exception + */ + User getUser(String orgUserId, HttpServletRequest request) throws UserNotFoundException; + + /** + * + * @param OrgUserId + * @return + */ + List getRoleFunctions(String orgUserId) throws Exception; + +} diff --git a/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/UserApiServiceImpl.java b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/UserApiServiceImpl.java new file mode 100644 index 00000000..8425f7da --- /dev/null +++ b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/UserApiServiceImpl.java @@ -0,0 +1,319 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.external.authorization.service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +import javax.naming.NamingException; +import javax.servlet.http.HttpServletRequest; + +import org.json.JSONArray; +import org.json.JSONObject; +import org.onap.portalsdk.core.command.PostSearchBean; +import org.onap.portalsdk.core.command.support.SearchResult; +import org.onap.portalsdk.core.domain.App; +import org.onap.portalsdk.core.domain.Role; +import org.onap.portalsdk.core.domain.RoleFunction; +import org.onap.portalsdk.core.domain.User; +import org.onap.portalsdk.core.domain.UserApp; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.service.AppService; +import org.onap.portalsdk.core.service.DataAccessService; +import org.onap.portalsdk.core.service.LdapService; +import org.onap.portalsdk.core.service.PostSearchService; +import org.onap.portalsdk.external.authorization.domain.ExternalAccessPerms; +import org.onap.portalsdk.external.authorization.domain.ExternalAccessUserRoleDetail; +import org.onap.portalsdk.external.authorization.domain.ExternalRoleDescription; +import org.onap.portalsdk.external.authorization.exception.UserNotFoundException; +import org.onap.portalsdk.external.authorization.util.EcompExternalAuthProperties; +import org.onap.portalsdk.external.authorization.util.EcompExternalAuthUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Service; +import org.springframework.web.client.RestTemplate; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.type.TypeFactory; + +@Service("userApiService") +public class UserApiServiceImpl implements UserApiService { + + private static final String AAF_GET_USER_ROLES_ENDPOINT = "roles/user/"; + + private static final String AAF_GET_USER_PERMS_ENDPOINT = "perms/user/"; + + private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(UserApiServiceImpl.class); + + @Autowired + private LoginExternalAuthService loginAAFService; + + @Autowired + private LdapService ldapService; + + @Autowired + private PostSearchService postSearchService; + + @Autowired + private DataAccessService dataAccessService; + + RestTemplate template = new RestTemplate(); + + @Autowired + private AppService appService; + + @Override + public User getUser(String orgUserId, HttpServletRequest request) + throws UserNotFoundException { + User user = null; + try { + String namespace = EcompExternalAuthProperties.getProperty(EcompExternalAuthProperties.EXTERNAL_AUTH_NAMESPACE); + HttpHeaders headers = EcompExternalAuthUtils.base64encodeKeyForAAFBasicAuth(); + HttpEntity entity = new HttpEntity<>(headers); + logger.debug(EELFLoggerDelegate.debugLogger, "getUserRoles: Connecting to external system for user {}", + orgUserId); + String endPoint = AAF_GET_USER_ROLES_ENDPOINT + orgUserId + + EcompExternalAuthProperties.getProperty(EcompExternalAuthProperties.EXTERNAL_AUTH_USER_DOMAIN); + ResponseEntity getResponse = template.exchange( + EcompExternalAuthProperties.getProperty(EcompExternalAuthProperties.EXTERNAL_AUTH_URL) + endPoint, HttpMethod.GET, entity, + String.class); + if (getResponse.getStatusCode().value() == 200) { + logger.debug(EELFLoggerDelegate.debugLogger, + "getUserRoles: Finished GET unp ser roles from external system and body: {}", + getResponse.getBody()); + } + String userRoles = getResponse.getBody(); + JSONObject userJsonObj = null; + JSONArray userJsonArray = null; + ObjectMapper mapper = new ObjectMapper(); + List userRoleDetailList = new ArrayList<>(); + if (!userRoles.equals(EcompExternalAuthUtils.EXT_EMPTY_JSON_STRING)) { + userJsonObj = new JSONObject(userRoles); + userJsonArray = userJsonObj.getJSONArray(EcompExternalAuthUtils.EXT_ROLE_FIELD); + ExternalAccessUserRoleDetail userRoleDetail = null; + for (int i = 0; i < userJsonArray.length(); i++) { + JSONObject role = userJsonArray.getJSONObject(i); + if (!role.getString(EcompExternalAuthUtils.EXT_ROLE_FIELD_NAME).endsWith(EcompExternalAuthUtils.EXT_ROLE_FIELD_ADMIN) + && !role.getString(EcompExternalAuthUtils.EXT_ROLE_FIELD_NAME) + .endsWith(EcompExternalAuthUtils.EXT_ROLE_FIELD_OWNER) + && EcompExternalAuthUtils.checkNameSpaceMatching(role.getString(EcompExternalAuthUtils.EXT_ROLE_FIELD_NAME), + namespace)) { + ExternalRoleDescription desc = new ExternalRoleDescription(); + if(role.has(EcompExternalAuthUtils.EXT_FIELD_DESCRIPTION) + && EcompExternalAuthUtils + .isJSONValid(role.getString(EcompExternalAuthUtils.EXT_FIELD_DESCRIPTION))) { + desc = mapper.readValue(role.getString(EcompExternalAuthUtils.EXT_FIELD_DESCRIPTION), + ExternalRoleDescription.class); + } + if(role.has(EcompExternalAuthUtils.EXT_FIELD_PERMS)) { + JSONArray perms = role.getJSONArray(EcompExternalAuthUtils.EXT_FIELD_PERMS); + List permsList = mapper.readValue(perms.toString(), TypeFactory + .defaultInstance().constructCollectionType(List.class, ExternalAccessPerms.class)); + desc.setPermissions(permsList); + } + userRoleDetail = new ExternalAccessUserRoleDetail( + role.getString(EcompExternalAuthUtils.EXT_ROLE_FIELD_NAME), desc); + userRoleDetailList.add(userRoleDetail); + } + } + } else { + throw new UserNotFoundException("User roles not found!"); + } + + if (userRoleDetailList.isEmpty()) { + throw new UserNotFoundException("User roles not found!"); + } else { + user = convertAAFUserRolesToEcompSDKUser(userRoleDetailList, orgUserId, namespace, request); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "getUser: Failed! ", e); + } + return user; + + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + private User convertAAFUserRolesToEcompSDKUser(List userRoleDetailList, + String orgUserId, String namespace, HttpServletRequest request) + throws Exception { + User user = loginAAFService.findUserWithoutPwd(orgUserId); + PostSearchBean postSearchBean = new PostSearchBean(); + if (user == null) { + postSearchBean.setOrgUserId(orgUserId); + postSearchService.process(request, postSearchBean); + postSearchBean.setSearchResult(loadSearchResultData(postSearchBean)); + user = (User) postSearchBean.getSearchResult().get(0); + user.setActive(true); + user.setLoginId(orgUserId); + dataAccessService.saveDomainObject(user, null); + } + App app = appService.getApp(1l); + try { + Set userApps = new TreeSet(); + for (ExternalAccessUserRoleDetail userRoleDetail : userRoleDetailList) { + ExternalRoleDescription roleDesc = userRoleDetail.getDescription(); + UserApp userApp = new UserApp(); + Role role = new Role(); + Set roleFunctions = new TreeSet<>(); + if (roleDesc != null) { + if (roleDesc.getName() == null) { + role.setActive(true); + role.setName(userRoleDetail.getName().substring(namespace.length() + 1)); + } else { + role.setActive(Boolean.valueOf(roleDesc.getActive())); + role.setId(Long.valueOf(roleDesc.getAppRoleId())); + role.setName(roleDesc.getName()); + if (!roleDesc.getPriority().equals(EcompExternalAuthUtils.EXT_NULL_VALUE)) { + role.setPriority(Integer.valueOf(roleDesc.getPriority())); + } + } + for (ExternalAccessPerms extPerm : roleDesc.getPermissions()) { + RoleFunction roleFunction = new RoleFunction(); + roleFunction.setCode(extPerm.getInstance()); + roleFunction.setAction(extPerm.getAction()); + if (extPerm.getDescription() != null + && EcompExternalAuthUtils.checkNameSpaceMatching(extPerm.getType(), namespace)) { + roleFunction.setName(extPerm.getDescription()); + } else if (extPerm.getDescription() == null + && EcompExternalAuthUtils.checkNameSpaceMatching(extPerm.getType(), namespace)) { + roleFunction.setName(extPerm.getType().substring(namespace.length() + 1) + "|" + + extPerm.getInstance() + "|" + extPerm.getAction()); + } else if (extPerm.getDescription() == null + && !EcompExternalAuthUtils.checkNameSpaceMatching(extPerm.getType(), namespace)) { + roleFunction.setName( + extPerm.getType() + "|" + extPerm.getInstance() + "|" + extPerm.getAction()); + } + if (EcompExternalAuthUtils.checkNameSpaceMatching(extPerm.getType(), namespace)) { + roleFunction.setType(extPerm.getType().substring(namespace.length() + 1)); + } else { + roleFunction.setType(extPerm.getType()); + } + roleFunctions.add(roleFunction); + } + } + role.setRoleFunctions(roleFunctions); + userApp.setApp(app); + userApp.setRole(role); + userApp.setUserId(user.getId()); + userApps.add(userApp); + } + user.setUserApps(userApps); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "createEPUser: createEPUser failed", e); + throw e; + } + + return user; + } + + @Override + public List getRoleFunctions(String orgUserId) throws Exception { + ObjectMapper mapper = new ObjectMapper(); + HttpHeaders headers = EcompExternalAuthUtils.base64encodeKeyForAAFBasicAuth(); + HttpEntity entity = new HttpEntity<>(headers); + logger.debug(EELFLoggerDelegate.debugLogger, "getRoleFunctions: Connecting to external system for user {}", + orgUserId); + String endPoint = AAF_GET_USER_PERMS_ENDPOINT + orgUserId + + EcompExternalAuthProperties.getProperty(EcompExternalAuthProperties.EXTERNAL_AUTH_USER_DOMAIN); + ResponseEntity getResponse = template.exchange( + EcompExternalAuthProperties.getProperty(EcompExternalAuthProperties.EXTERNAL_AUTH_URL) + endPoint, HttpMethod.GET, entity, + String.class); + if (getResponse.getStatusCode().value() == 200) { + logger.debug(EELFLoggerDelegate.debugLogger, + "getRoleFunctions: Finished GET user perms from external system and body: {}", + getResponse.getBody()); + } + String userPerms = getResponse.getBody(); + JSONObject userPermsJsonObj = null; + JSONArray userPermsJsonArray = null; + List extPermsList = new ArrayList<>(); + if (!userPerms.equals(EcompExternalAuthUtils.EXT_EMPTY_JSON_STRING)) { + userPermsJsonObj = new JSONObject(userPerms); + userPermsJsonArray = userPermsJsonObj.getJSONArray(EcompExternalAuthUtils.EXT_PERM_FIELD); + for (int i = 0; i < userPermsJsonArray.length(); i++) { + JSONObject permJsonObj = userPermsJsonArray.getJSONObject(i); + if (!permJsonObj.getString(EcompExternalAuthUtils.EXT_PERM_FIELD_TYPE).endsWith(EcompExternalAuthUtils.EXT_PERM_ACCESS)) { + ExternalAccessPerms perm = mapper.readValue(permJsonObj.toString(), ExternalAccessPerms.class); + extPermsList.add(perm); + } + } + } + return convertToRoleFunctionList(extPermsList); + } + + private List convertToRoleFunctionList(List extPermsList) { + List roleFunctions = new ArrayList<>(); + String namespace = EcompExternalAuthProperties.getProperty(EcompExternalAuthProperties.EXTERNAL_AUTH_NAMESPACE); + for (ExternalAccessPerms extPerm : extPermsList) { + RoleFunction roleFunction = new RoleFunction(); + roleFunction.setCode(extPerm.getInstance()); + roleFunction.setAction(extPerm.getAction()); + if (extPerm.getDescription() != null + && EcompExternalAuthUtils.checkNameSpaceMatching(extPerm.getType(), namespace)) { + roleFunction.setName(extPerm.getDescription()); + } else if (extPerm.getDescription() == null + && EcompExternalAuthUtils.checkNameSpaceMatching(extPerm.getType(), namespace)) { + roleFunction.setName(extPerm.getType().substring(namespace.length() + 1) + "|" + extPerm.getInstance() + + "|" + extPerm.getAction()); + } else if (extPerm.getDescription() == null + && !EcompExternalAuthUtils.checkNameSpaceMatching(extPerm.getType(), namespace)) { + roleFunction.setName(extPerm.getType() + "|" + extPerm.getInstance() + "|" + extPerm.getAction()); + } + if (EcompExternalAuthUtils.checkNameSpaceMatching(extPerm.getType(), namespace)) { + roleFunction.setType(extPerm.getType().substring(namespace.length() + 1)); + } else { + roleFunction.setType(extPerm.getType()); + } + roleFunctions.add(roleFunction); + } + return roleFunctions; + } + + private SearchResult loadSearchResultData(PostSearchBean searchCriteria) + throws NamingException { + return ldapService.searchPost(searchCriteria.getUser(), searchCriteria.getSortBy1(), + searchCriteria.getSortBy2(), searchCriteria.getSortBy3(), searchCriteria.getPageNo(), + searchCriteria.getNewDataSize(), 1); + } + +} diff --git a/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/util/EcompExternalAuthProperties.java b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/util/EcompExternalAuthProperties.java new file mode 100644 index 00000000..a680a672 --- /dev/null +++ b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/util/EcompExternalAuthProperties.java @@ -0,0 +1,123 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.external.authorization.util; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; + +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; + + +public class EcompExternalAuthProperties { + + public static final String EXTERNAL_AUTH_USER_NAME = "extern_auth_user_name"; + + public static final String EXTERNAL_AUTH_PASSWORD = "extern_auth_password"; + + public static final String EXTERNAL_AUTH_URL = "extern_auth_url"; + + public static final String EXTERNAL_AUTH_USER_DOMAIN = "extern_auth_user_domain"; + + public static final String EXTERNAL_AUTH_NAMESPACE = "extern_auth_namespace"; + + private EcompExternalAuthProperties(){} + + private static Properties properties; + + private static String propertyFileName = "external-auth.properties"; + + private static final Object lockObject = new Object(); + + private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EcompExternalAuthProperties.class); + + /** + * Gets the property value for the specified key. If a value is found, leading + * and trailing space is trimmed. + * + * @param property + * Property key + * @return Value for the named property; null if the property file was not + * loaded or the key was not found. + */ + public static String getProperty(String property) { + if (properties == null) { + synchronized (lockObject) { + try { + if (!initialize()) { + logger.error(EELFLoggerDelegate.errorLogger,"Failed to read property file " + propertyFileName); + return null; + } + } catch (IOException e) { + logger.error(EELFLoggerDelegate.errorLogger,"Failed to read property file " + propertyFileName ,e); + return null; + } + } + } + String value = properties.getProperty(property); + if (value != null) + value = value.trim(); + return value; + } + + /** + * Reads properties from a portal.properties file on the classpath. + * + * Clients do NOT need to call this method. Clients MAY call this method to test + * whether the properties file can be loaded successfully. + * + * @return True if properties were successfully loaded, else false. + * @throws IOException + * On failure + */ + private static boolean initialize() throws IOException { + if (properties != null) + return true; + InputStream in = EcompExternalAuthProperties.class.getClassLoader().getResourceAsStream(propertyFileName); + if (in == null) + return false; + properties = new Properties(); + try { + properties.load(in); + } finally { + in.close(); + } + return true; + } + +} diff --git a/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/util/EcompExternalAuthUtils.java b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/util/EcompExternalAuthUtils.java new file mode 100644 index 00000000..56b1527e --- /dev/null +++ b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/util/EcompExternalAuthUtils.java @@ -0,0 +1,139 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.external.authorization.util; + +import java.io.IOException; + +import javax.xml.bind.DatatypeConverter; + +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.util.SystemProperties; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; + +import com.fasterxml.jackson.databind.ObjectMapper; + +public class EcompExternalAuthUtils { + + private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EcompExternalAuthUtils.class); + + @Autowired + CipherUtil cipherUtil; + + public static final String EXT_EMPTY_JSON_STRING = "{}"; + public static final String EXT_ROLE_FIELD = "role"; + public static final String EXT_PERM_FIELD = "perm"; + public static final String EXT_PERM_FIELD_TYPE = "type"; + public static final String EXT_PERM_ACCESS = ".access"; + public static final String EXT_ROLE_FIELD_NAME = "name"; + public static final String EXT_NULL_VALUE = "null"; + public static final String EXT_FIELD_DESCRIPTION = "description"; + public static final String EXT_FIELD_PERMS = "perms"; + public static final String EXT_ROLE_FIELD_OWNER = ".owner"; + public static final String EXT_ROLE_FIELD_ADMIN = ".admin"; + + public static HttpHeaders base64encodeKeyForAAFBasicAuth() throws Exception { + String userName = EcompExternalAuthProperties.getProperty(EcompExternalAuthProperties.EXTERNAL_AUTH_USER_NAME); + String encryptedPass = EcompExternalAuthProperties.getProperty(EcompExternalAuthProperties.EXTERNAL_AUTH_PASSWORD); + String decryptedPass = decryptPass(encryptedPass); + String usernamePass = userName + ":" + decryptedPass; + String encToBase64 = String.valueOf((DatatypeConverter.printBase64Binary(usernamePass.getBytes()))); + HttpHeaders headers = new HttpHeaders(); + headers.add("Authorization", "Basic " + encToBase64); + headers.setContentType(MediaType.APPLICATION_JSON); + return headers; + } + + private static String decryptPass(String encrypted) throws Exception { + String result = ""; + if (encrypted != null && encrypted.length() > 0) { + try { + result = CipherUtil.decryptPKC(encrypted, + SystemProperties.getProperty(SystemProperties.Decryption_Key)); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger,"decryptedPassword failed", e); + throw e; + } + } + return result; + } + + /** + * + * It checks whether the namespace is matching or not + * + * @param permTypeVal + * @param appNamespaceVal + * @return true or false + */ + public static boolean checkNameSpaceMatching(String permTypeVal, String appNamespaceVal) { + String[] typeNamespace = permTypeVal.split("\\."); + String[] appNamespace = appNamespaceVal.split("\\."); + boolean isNamespaceMatching = true; + if (appNamespace.length <= typeNamespace.length) { + for (int k = 0; k < appNamespace.length; k++) { + if (!appNamespace[k].equals(typeNamespace[k])) + isNamespaceMatching = false; + } + + } else { + isNamespaceMatching = false; + } + return isNamespaceMatching; + } + + /** + * + * It validates whether given string is JSON or not + * + * @param jsonInString + * @return true or false + */ + public static boolean isJSONValid(String jsonInString ) { + try { + final ObjectMapper mapper = new ObjectMapper(); + mapper.readTree(jsonInString); + return true; + } catch (IOException e) { + logger.error(EELFLoggerDelegate.errorLogger, "Failed to parse Json!", e); + return false; + } + } +} diff --git a/ecomp-sdk/epsdk-analytics/pom.xml b/ecomp-sdk/epsdk-analytics/pom.xml index 2b79d543..bcf202d5 100644 --- a/ecomp-sdk/epsdk-analytics/pom.xml +++ b/ecomp-sdk/epsdk-analytics/pom.xml @@ -5,7 +5,7 @@ org.onap.portal.sdk epsdk-project - 2.2.0-SNAPSHOT + 2.4.0-SNAPSHOT diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/fusion/adapter/DateUtils.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/fusion/adapter/DateUtils.java index 1d62a94a..c0f25892 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/fusion/adapter/DateUtils.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/fusion/adapter/DateUtils.java @@ -45,7 +45,7 @@ import java.util.Date; import java.util.List; import java.util.TimeZone; -import org.onap.portalsdk.core.FusionObject; +import org.onap.portalsdk.core.domain.FusionObject; import org.onap.portalsdk.core.domain.User; import org.onap.portalsdk.core.service.DataAccessService; import org.onap.portalsdk.core.util.SystemProperties; diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/fusion/adapter/FusionAdapter.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/fusion/adapter/FusionAdapter.java index d339a2a0..fac2d483 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/fusion/adapter/FusionAdapter.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/fusion/adapter/FusionAdapter.java @@ -42,8 +42,7 @@ import java.util.Map; import javax.servlet.ServletContext; -import org.onap.portalsdk.analytics.model.runtime.FormField; -import org.onap.portalsdk.core.FusionObject; +import org.onap.portalsdk.core.domain.FusionObject; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.springframework.beans.factory.annotation.Autowired; diff --git a/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/controller/WizardProcessorTest.java b/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/controller/WizardProcessorTest.java index a704d9a0..52e0b1a1 100644 --- a/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/controller/WizardProcessorTest.java +++ b/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/controller/WizardProcessorTest.java @@ -39,15 +39,16 @@ package org.onap.portalsdk.analytics.controller; -import static org.junit.Assert.*; +import static org.junit.Assert.assertNotNull; + import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.util.ArrayList; import java.util.List; + import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; -import org.onap.portalsdk.analytics.system.fusion.AppUtils; import org.junit.Before; import org.junit.Test; @@ -64,6 +65,7 @@ import org.onap.portalsdk.analytics.model.runtime.ReportRuntime; import org.onap.portalsdk.analytics.system.DbUtils; import org.onap.portalsdk.analytics.system.Globals; import org.onap.portalsdk.analytics.system.IAppUtils; +import org.onap.portalsdk.analytics.system.fusion.AppUtils; import org.onap.portalsdk.analytics.util.AppConstants; import org.onap.portalsdk.analytics.util.DataSet; import org.onap.portalsdk.analytics.xmlobj.ChartAdditionalOptions; diff --git a/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/model/runtime/RaptorControllerAsyncTest.java b/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/model/runtime/RaptorControllerAsyncTest.java index fe5d4a45..07e1745b 100644 --- a/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/model/runtime/RaptorControllerAsyncTest.java +++ b/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/model/runtime/RaptorControllerAsyncTest.java @@ -54,7 +54,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; @@ -74,9 +73,6 @@ import org.onap.portalsdk.analytics.model.base.ReportWrapper; import org.onap.portalsdk.analytics.model.definition.ReportDefinition; import org.onap.portalsdk.analytics.model.definition.wizard.ColumnJSON; import org.onap.portalsdk.analytics.model.definition.wizard.DefinitionJSON; -import org.onap.portalsdk.analytics.model.definition.wizard.ImportJSON; -import org.onap.portalsdk.analytics.model.definition.wizard.MessageJSON; -import org.onap.portalsdk.analytics.model.definition.wizard.QueryJSON; import org.onap.portalsdk.analytics.system.AppUtils; import org.onap.portalsdk.analytics.system.ConnectionUtils; import org.onap.portalsdk.analytics.system.DbUtils; @@ -87,12 +83,9 @@ import org.onap.portalsdk.analytics.util.DataSet; import org.onap.portalsdk.analytics.util.Utils; import org.onap.portalsdk.analytics.util.XSSFilter; import org.onap.portalsdk.analytics.view.ReportData; -import org.onap.portalsdk.analytics.xmlobj.ChartAdditionalOptions; import org.onap.portalsdk.analytics.xmlobj.CustomReportType; -import org.onap.portalsdk.analytics.xmlobj.DataColumnList; import org.onap.portalsdk.analytics.xmlobj.DataColumnType; import org.onap.portalsdk.analytics.xmlobj.DataSourceList; -import org.onap.portalsdk.analytics.xmlobj.DataSourceType; import org.onap.portalsdk.analytics.xmlobj.FormFieldList; import org.onap.portalsdk.analytics.xmlobj.FormFieldType; import org.onap.portalsdk.analytics.xmlobj.MockRunTimeReport; @@ -102,7 +95,6 @@ import org.onap.portalsdk.core.service.DataAccessService; import org.onap.portalsdk.core.util.SecurityCodecUtil; import org.onap.portalsdk.core.web.support.UserUtils; import org.owasp.esapi.ESAPI; -import org.owasp.esapi.Encoder; import org.owasp.esapi.codecs.Codec; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; diff --git a/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/xmlobj/ChartJSONHelperTest.java b/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/xmlobj/ChartJSONHelperTest.java index 4938d777..f69c5dae 100644 --- a/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/xmlobj/ChartJSONHelperTest.java +++ b/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/xmlobj/ChartJSONHelperTest.java @@ -37,33 +37,30 @@ */ package org.onap.portalsdk.analytics.xmlobj; -import static org.junit.Assert.*; -import javax.xml.namespace.QName; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; -import java.io.IOException; import java.io.InputStream; -import java.io.OutputStream; -import java.io.Reader; import java.io.StringReader; -import java.io.Writer; -import java.sql.Clob; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.ResultSetMetaData; -import java.sql.SQLException; -import java.util.*; +import java.util.ArrayList; +import java.util.Date; +import java.util.Enumeration; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBElement; -import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; import javax.xml.bind.Unmarshaller; +import javax.xml.namespace.QName; -import org.hibernate.Session; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -76,15 +73,12 @@ import org.onap.portalsdk.analytics.error.RaptorException; import org.onap.portalsdk.analytics.model.ReportLoader; import org.onap.portalsdk.analytics.model.base.ReportWrapper; import org.onap.portalsdk.analytics.model.runtime.ChartJSONHelper; -import org.onap.portalsdk.analytics.model.runtime.FormField; -import org.onap.portalsdk.analytics.model.runtime.ReportFormFields; import org.onap.portalsdk.analytics.model.runtime.ReportRuntime; import org.onap.portalsdk.analytics.system.AppUtils; import org.onap.portalsdk.analytics.system.DbUtils; import org.onap.portalsdk.analytics.system.Globals; import org.onap.portalsdk.analytics.util.AppConstants; import org.onap.portalsdk.analytics.util.DataSet; -import org.onap.portalsdk.analytics.xmlobj.CustomReportType; import org.onap.portalsdk.core.domain.User; import org.onap.portalsdk.core.restful.domain.EcompRole; import org.onap.portalsdk.core.web.support.UserUtils; diff --git a/ecomp-sdk/epsdk-app-common/pom.xml b/ecomp-sdk/epsdk-app-common/pom.xml index f31aa797..2d38b6a5 100644 --- a/ecomp-sdk/epsdk-app-common/pom.xml +++ b/ecomp-sdk/epsdk-app-common/pom.xml @@ -5,7 +5,7 @@ org.onap.portal.sdk epsdk-project - 2.2.0-SNAPSHOT + 2.4.0-SNAPSHOT @@ -251,13 +251,13 @@ commons-httpclient commons-httpclient - - xerces - xercesImpl - - - commons-collections - commons-collections + + xerces + xercesImpl + + + commons-collections + commons-collections org.beanshell @@ -277,11 +277,6 @@ xstream 1.4.10 - - org.apache.wicket - wicket-core - 1.5.16 - ch.qos.logback logback-core @@ -302,7 +297,6 @@ commons-beanutils 1.9.3 - org.apache.httpcomponents httpclient @@ -314,15 +308,14 @@ 2.7.2 - - xerces - xercesImpl - 2.11.0.SP5 - - - commons-collections - commons-collections - 3.2.2 + xerces + xercesImpl + 2.11.0.SP5 + + + commons-collections + commons-collections + 3.2.2 diff --git a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/FavoritesController.java b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/FavoritesController.java index d73759a5..fbb9cc5d 100644 --- a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/FavoritesController.java +++ b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/FavoritesController.java @@ -49,7 +49,6 @@ import org.onap.portalsdk.core.controller.RestrictedBaseController; import org.onap.portalsdk.core.domain.App; import org.onap.portalsdk.core.domain.User; import org.onap.portalsdk.core.logging.aspect.AuditLog; -import org.onap.portalsdk.core.logging.format.AlarmSeverityEnum; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.onboarding.rest.FavoritesClient; import org.onap.portalsdk.core.onboarding.util.CipherUtil; diff --git a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/FuncMenuController.java b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/FuncMenuController.java index 1cf68547..fa88c5c9 100644 --- a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/FuncMenuController.java +++ b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/FuncMenuController.java @@ -50,7 +50,6 @@ import org.onap.portalsdk.core.controller.RestrictedBaseController; import org.onap.portalsdk.core.domain.App; import org.onap.portalsdk.core.domain.User; import org.onap.portalsdk.core.logging.aspect.AuditLog; -import org.onap.portalsdk.core.logging.format.AlarmSeverityEnum; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.onboarding.rest.FunctionalMenuClient; import org.onap.portalsdk.core.onboarding.ueb.UebException; diff --git a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/LogoutController.java b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/LogoutController.java index 1dd84208..bbd08c45 100644 --- a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/LogoutController.java +++ b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/LogoutController.java @@ -41,6 +41,7 @@ import javax.servlet.http.HttpServletRequest; import org.onap.portalsdk.core.controller.UnRestrictedBaseController; import org.onap.portalsdk.core.domain.User; +import org.onap.portalsdk.core.logging.aspect.MetricsLog; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.onboarding.util.PortalApiConstants; import org.onap.portalsdk.core.onboarding.util.PortalApiProperties; @@ -51,7 +52,6 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.servlet.ModelAndView; -import org.onap.portalsdk.core.logging.aspect.MetricsLog; @Controller @RequestMapping("/") diff --git a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/BroadcastController.java b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/BroadcastController.java index 03ec7b72..ec300780 100644 --- a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/BroadcastController.java +++ b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/BroadcastController.java @@ -45,7 +45,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.json.JSONObject; -import org.onap.portalapp.util.SecurityXssValidator; import org.onap.portalsdk.core.controller.RestrictedBaseController; import org.onap.portalsdk.core.domain.BroadcastMessage; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; diff --git a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/service/OnBoardingApiServiceImpl.java b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/service/OnBoardingApiServiceImpl.java index d766015a..46306817 100644 --- a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/service/OnBoardingApiServiceImpl.java +++ b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/service/OnBoardingApiServiceImpl.java @@ -37,7 +37,6 @@ */ package org.onap.portalapp.service; -import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; @@ -67,7 +66,6 @@ import org.onap.portalsdk.core.onboarding.util.PortalApiProperties; import org.onap.portalsdk.core.restful.domain.EcompRole; import org.onap.portalsdk.core.restful.domain.EcompUser; import org.onap.portalsdk.core.service.AppService; -import org.onap.portalsdk.core.service.AppServiceImpl; import org.onap.portalsdk.core.service.RestApiRequestBuilder; import org.onap.portalsdk.core.service.RoleService; import org.onap.portalsdk.core.service.UserProfileService; diff --git a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/AngularAdminControllerTest.java b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/AngularAdminControllerTest.java index e4facb1e..6568f93e 100644 --- a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/AngularAdminControllerTest.java +++ b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/AngularAdminControllerTest.java @@ -37,10 +37,8 @@ */ package org.onap.portalapp.controller.core; -import static org.junit.Assert.*; - -import java.util.HashMap; -import java.util.Map; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -50,7 +48,6 @@ import org.junit.Test; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.onap.portalapp.controller.core.AngularAdminController; import org.onap.portalapp.framework.MockitoTestSuite; import org.onap.portalsdk.core.domain.User; import org.onap.portalsdk.core.web.support.UserUtils; diff --git a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/FnMenuControllerTest.java b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/FnMenuControllerTest.java index 348263e5..96286dde 100644 --- a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/FnMenuControllerTest.java +++ b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/FnMenuControllerTest.java @@ -76,7 +76,6 @@ import org.onap.portalsdk.core.web.support.UserUtils; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; -import org.springframework.mock.web.MockHttpServletRequest; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/MenuListControllerTest.java b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/MenuListControllerTest.java index daee544f..2d6c0cd1 100644 --- a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/MenuListControllerTest.java +++ b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/MenuListControllerTest.java @@ -38,7 +38,6 @@ package org.onap.portalapp.controller.core; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; import java.io.IOException; import java.io.PrintWriter; diff --git a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/ProfileSearchControllerTest.java b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/ProfileSearchControllerTest.java index fabcd162..c9bdc896 100644 --- a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/ProfileSearchControllerTest.java +++ b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/ProfileSearchControllerTest.java @@ -37,7 +37,7 @@ */ package org.onap.portalapp.controller.core; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; import java.io.IOException; import java.io.PrintWriter; @@ -48,7 +48,6 @@ import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.drools.core.command.assertion.AssertEquals; import org.junit.Before; import org.junit.Test; import org.mockito.InjectMocks; diff --git a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/RoleControllerTest.java b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/RoleControllerTest.java index 1df1513a..9dee09fe 100644 --- a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/RoleControllerTest.java +++ b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/RoleControllerTest.java @@ -37,7 +37,8 @@ */ package org.onap.portalapp.controller.core; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; import java.io.BufferedReader; import java.io.IOException; diff --git a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/RoleFunctionListControllerTest.java b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/RoleFunctionListControllerTest.java index 016f9bef..ffbb283d 100644 --- a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/RoleFunctionListControllerTest.java +++ b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/RoleFunctionListControllerTest.java @@ -37,7 +37,8 @@ */ package org.onap.portalapp.controller.core; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; import java.io.IOException; import java.io.PrintWriter; diff --git a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/RoleListControllerTest.java b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/RoleListControllerTest.java index 19d6da1a..593a9e7c 100644 --- a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/RoleListControllerTest.java +++ b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/RoleListControllerTest.java @@ -38,7 +38,8 @@ package org.onap.portalapp.controller.core; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; import java.io.BufferedReader; import java.io.IOException; @@ -64,7 +65,6 @@ import org.onap.portalsdk.core.service.RoleService; import org.onap.portalsdk.core.web.support.UserUtils; import org.springframework.web.bind.ServletRequestUtils; import org.springframework.web.servlet.ModelAndView; -import org.onap.portalapp.controller.core.RoleListController; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/UserProfileControllerTest.java b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/UserProfileControllerTest.java index 4046c6a7..00536e77 100644 --- a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/UserProfileControllerTest.java +++ b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/UserProfileControllerTest.java @@ -37,7 +37,7 @@ */ package org.onap.portalapp.controller.core; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; import java.io.IOException; import java.util.ArrayList; diff --git a/ecomp-sdk/epsdk-app-os/README.md b/ecomp-sdk/epsdk-app-os/README.md index 6a94530e..c61ebe63 100644 --- a/ecomp-sdk/epsdk-app-os/README.md +++ b/ecomp-sdk/epsdk-app-os/README.md @@ -12,12 +12,15 @@ like Apache Tomcat. Eclipse users must install the M2E-WTP connector, see https://www.eclipse.org/m2e-wtp/ ## Release Notes +Version 2.3.0 +- PORTAL 254 ECOMP AAF jar + Version 2.2.0 - PORTAL 136 Junits for SDK - PORTAL 87 hibernate mapping in epsdk-overlay forces use of analytics dependency jar - PORTAL 155 Review security issues: portal -- PORTAL 202 Remove files that have GPL or other license issues -- PORTAL 210 Music library update +- PORTAL-202 Remove files that have GPL or other license issues + Version 2.1.0 - PORTAL 161 Refer epsdk-app-common - PORTAL 160 Refer epsdk-app-common diff --git a/ecomp-sdk/epsdk-app-os/pom.xml b/ecomp-sdk/epsdk-app-os/pom.xml index 2daad9a9..733a1798 100644 --- a/ecomp-sdk/epsdk-app-os/pom.xml +++ b/ecomp-sdk/epsdk-app-os/pom.xml @@ -10,7 +10,7 @@ org.onap.portal.sdk epsdk-project - 2.2.0-SNAPSHOT + 2.4.0-SNAPSHOT diff --git a/ecomp-sdk/epsdk-app-os/src/main/resources/music.properties b/ecomp-sdk/epsdk-app-os/src/main/resources/music.properties index 635ccb50..fdf6e499 100644 --- a/ecomp-sdk/epsdk-app-os/src/main/resources/music.properties +++ b/ecomp-sdk/epsdk-app-os/src/main/resources/music.properties @@ -1,24 +1,30 @@ -music.endpoint = http://vm-ep-dev4.research.att.com/MUSIC/rest/ -music.version = v2 -music.keyspace = keyspaces music.session.keyspace = test_session music.session.attr.tables = spring_session_attributes music.session.meta.tables = spring_session -music.x.minor.version = 3 -music.x.patch.version = 0 -music.ns = com.att.ecomp.portal.demeter -music.user.id = m00468@portal.ecomp.att.com -music.password = friedG33nS- -music.consistency.info = type -music.consistency.info.value = eventual -music.cache = false +#music.cache = false music.serialize.compress = true music.session.max.inactive.interval.seconds = 1800 +music.exclude.api = /portalApi/healthCheck,/portalApi/healthCheckSuspend,/portalApi/healthCheckResume #By default it's eventual music.atomic.get = false music.atomic.put = false - +#how often the session clean up would happen (hour) +music.cleanup.frequency = 6 +#how old of session need to be cleaned up (hour) +music.cleanup.threshold = 10 cassandra.host=135.197.226.103 zookeeper.host=135.197.226.103, 135.197.226.108, 135.197.226.119 cassandra.user=cassandra -cassandra.password=cassandra \ No newline at end of file +cassandra.password=cassandra + +#Music API +#music.endpoint = http://vm-ep-dev4.research.att.com/MUSIC/rest/ +#music.version = v2 +#music.keyspace = keyspaces +#music.x.minor.version = 3 +#music.x.patch.version = 0 +#music.ns = com.att.ecomp.portal.demeter +#music.user.id = m00468@portal.ecomp.att.com +#music.password = friedG33nS- +#music.consistency.info = type +#music.consistency.info.value = eventual \ No newline at end of file diff --git a/ecomp-sdk/epsdk-app-os/src/main/webapp/WEB-INF/web.xml b/ecomp-sdk/epsdk-app-os/src/main/webapp/WEB-INF/web.xml index b5963e64..8392e8d4 100644 --- a/ecomp-sdk/epsdk-app-os/src/main/webapp/WEB-INF/web.xml +++ b/ecomp-sdk/epsdk-app-os/src/main/webapp/WEB-INF/web.xml @@ -23,7 +23,7 @@ springSessionRepositoryFilter - org.springframework.web.filter.DelegatingFilterProxy + org.onap.portalapp.music.filter.MusicSessionRepositoryFilter springSessionRepositoryFilter diff --git a/ecomp-sdk/epsdk-app-overlay/pom.xml b/ecomp-sdk/epsdk-app-overlay/pom.xml index 53147a81..f0d15a73 100644 --- a/ecomp-sdk/epsdk-app-overlay/pom.xml +++ b/ecomp-sdk/epsdk-app-overlay/pom.xml @@ -5,7 +5,7 @@ org.onap.portal.sdk epsdk-project - 2.2.0-SNAPSHOT + 2.4.0-SNAPSHOT diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/WEB-INF/fusion/defs/definitions.xml b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/WEB-INF/fusion/defs/definitions.xml index 49064879..05556d27 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/WEB-INF/fusion/defs/definitions.xml +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/WEB-INF/fusion/defs/definitions.xml @@ -47,8 +47,9 @@ - - + + + diff --git a/ecomp-sdk/epsdk-core/pom.xml b/ecomp-sdk/epsdk-core/pom.xml index 1bdb1490..d15b18ff 100644 --- a/ecomp-sdk/epsdk-core/pom.xml +++ b/ecomp-sdk/epsdk-core/pom.xml @@ -1,11 +1,12 @@ - + 4.0.0 - + org.onap.portal.sdk epsdk-project - 2.2.0-SNAPSHOT + 2.4.0-SNAPSHOT @@ -20,7 +21,7 @@ 6.4.0.Final - + @@ -42,13 +43,13 @@ - + - + org.onap.portal.sdk epsdk-fw @@ -61,6 +62,18 @@ + + + org.onap.portal.sdk + epsdk-domain + ${project.version} + + + commons-logging + commons-logging + + + org.drools @@ -111,9 +124,9 @@ ${springframework.version} - org.springframework - spring-aop - ${springframework.version} + org.springframework + spring-aop + ${springframework.version} org.springframework.boot @@ -126,19 +139,19 @@ - + - org.aspectj - aspectjrt - 1.8.9 + org.aspectj + aspectjrt + 1.8.9 - + org.aspectj aspectjweaver 1.8.9 - + @@ -163,29 +176,29 @@ 2.3.1 - org.apache.taglibs - taglibs-standard-spec - 1.2.5 + org.apache.taglibs + taglibs-standard-spec + 1.2.5 - org.apache.taglibs - taglibs-standard-impl - 1.2.5 + org.apache.taglibs + taglibs-standard-impl + 1.2.5 - org.apache.taglibs - taglibs-standard-spec - 1.2.5 + org.apache.taglibs + taglibs-standard-spec + 1.2.5 - org.apache.taglibs - taglibs-standard-impl - 1.2.5 + org.apache.taglibs + taglibs-standard-impl + 1.2.5 - org.apache.taglibs - taglibs-standard-jstlel - 1.2.5 + org.apache.taglibs + taglibs-standard-jstlel + 1.2.5 @@ -337,37 +350,38 @@ - + - com.att.eelf - eelf-core - 1.0.0 + com.att.eelf + eelf-core + 1.0.0 org.owasp.esapi esapi 2.1.0.1 - - - commons-beanutils - commons-beanutils-core - - - commons-httpclient - commons-httpclient - - - xerces - xercesImpl + + + commons-beanutils + commons-beanutils-core + + + commons-httpclient + commons-httpclient + + + xerces + xercesImpl - - org.beanshell - bsh-core - - + + org.beanshell + bsh-core + + + com.att.nsa @@ -400,14 +414,19 @@ runtime - com.thoughtworks.xstream - xstream - 1.4.10 + org.apache.lucene + lucene-queryparser + 7.2.1 - org.apache.wicket - wicket-core - 1.5.16 + com.thoughtworks.xstream + xstream + 1.4.10 + + + org.apache.wicket + wicket-core + 1.5.16 ch.qos.logback @@ -425,9 +444,69 @@ 1.3.3 - commons-beanutils - commons-beanutils - 1.9.3 + commons-beanutils + commons-beanutils + 1.9.2 + + + org.apache.poi + poi + 3.17 + + + commons-logging + commons-logging + + + log4j + log4j + + + + + org.apache.poi + poi-ooxml + 3.17 + + + commons-logging + commons-logging + + + log4j + log4j + + + + + org.apache.poi + poi-scratchpad + 3.17 + + + commons-logging + commons-logging + + + log4j + log4j + + + + + org.apache.poi + poi-contrib + 3.5-FINAL + + + commons-logging + commons-logging + + + log4j + log4j + + org.apache.httpcomponents @@ -435,15 +514,10 @@ 4.5.3 - xalan - xalan - 2.7.2 + xalan + xalan + 2.7.2 - - xerces - xercesImpl - 2.11.0.SP5 - - + diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/LoginBean.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/LoginBean.java index 9514d135..761e3449 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/LoginBean.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/LoginBean.java @@ -215,4 +215,13 @@ public class LoginBean extends FusionCommand { this.userid = userid; } + @Override + public String toString() { + return "LoginBean [loginId=" + loginId + ", loginPwd=" + loginPwd + ", hrid=" + hrid + ", userid=" + userid + + ", siteAccess=" + siteAccess + ", loginErrorMessage=" + loginErrorMessage + ", user=" + user + + ", menu=" + menu + ", businessDirectMenu=" + businessDirectMenu + "]"; + } + + + } diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/PostSearchBean.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/PostSearchBean.java index b333dc1b..2bdb68fa 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/PostSearchBean.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/PostSearchBean.java @@ -41,6 +41,7 @@ import java.util.List; import org.onap.portalsdk.core.command.support.SearchBase; import org.onap.portalsdk.core.domain.User; +import org.onap.portalsdk.core.domain.FusionObject.Utilities; import com.fasterxml.jackson.databind.annotation.JsonSerialize; diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/support/FusionDao.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/support/FusionDao.java index 32235819..845d8d45 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/support/FusionDao.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/support/FusionDao.java @@ -38,7 +38,7 @@ package org.onap.portalsdk.core.dao.support; import org.hibernate.SessionFactory; -import org.onap.portalsdk.core.FusionObject; +import org.onap.portalsdk.core.domain.FusionObject; public class FusionDao implements FusionObject { private SessionFactory sessionFactory; diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/exception/support/FusionException.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/exception/support/FusionException.java index 8add192a..16d4e539 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/exception/support/FusionException.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/exception/support/FusionException.java @@ -37,7 +37,7 @@ */ package org.onap.portalsdk.core.exception.support; -import org.onap.portalsdk.core.FusionObject; +import org.onap.portalsdk.core.domain.FusionObject; public interface FusionException extends FusionObject { } diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/interceptor/ResourceInterceptor.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/interceptor/ResourceInterceptor.java index a8115314..58c6cd62 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/interceptor/ResourceInterceptor.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/interceptor/ResourceInterceptor.java @@ -42,7 +42,6 @@ import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; import org.onap.portalsdk.core.controller.FusionBaseController; import org.onap.portalsdk.core.domain.App; diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/aspect/EELFLoggerAspect.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/aspect/EELFLoggerAspect.java index 23ac3b93..d7b734ce 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/aspect/EELFLoggerAspect.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/aspect/EELFLoggerAspect.java @@ -41,9 +41,9 @@ import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; -import org.onap.portalsdk.core.util.SystemProperties.SecurityEventTypeEnum; import org.springframework.beans.factory.annotation.Autowired; import org.onap.portalsdk.core.logging.aspect.MetricsLog; +import org.onap.portalsdk.core.util.SystemProperties.SecurityEventTypeEnum; @Aspect @org.springframework.context.annotation.Configuration diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/menu/MenuBuilder.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/menu/MenuBuilder.java index 8a5bfbaa..86992751 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/menu/MenuBuilder.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/menu/MenuBuilder.java @@ -44,7 +44,7 @@ import java.util.Set; import javax.servlet.http.HttpServletRequest; -import org.onap.portalsdk.core.FusionObject; +import org.onap.portalsdk.core.domain.FusionObject; import org.onap.portalsdk.core.domain.MenuData; import org.onap.portalsdk.core.service.DataAccessService; import org.onap.portalsdk.core.util.SystemProperties; diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/objectcache/support/FusionCacheManager.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/objectcache/support/FusionCacheManager.java index 60da36a2..58e77afb 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/objectcache/support/FusionCacheManager.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/objectcache/support/FusionCacheManager.java @@ -39,7 +39,7 @@ package org.onap.portalsdk.core.objectcache.support; import java.io.IOException; -import org.onap.portalsdk.core.FusionObject; +import org.onap.portalsdk.core.domain.FusionObject; public interface FusionCacheManager extends FusionObject { diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/AuditServiceImpl.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/AuditServiceImpl.java index 1917ce1b..c4dadc9a 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/AuditServiceImpl.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/AuditServiceImpl.java @@ -40,10 +40,10 @@ package org.onap.portalsdk.core.service; import java.util.Map; import org.onap.portalsdk.core.domain.AuditLog; +import org.onap.portalsdk.core.logging.aspect.MetricsLog; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.onap.portalsdk.core.logging.aspect.MetricsLog; @Service("auditService") @Transactional diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/DataAccessServiceImpl.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/DataAccessServiceImpl.java index a4386b04..7a2cdd12 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/DataAccessServiceImpl.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/DataAccessServiceImpl.java @@ -65,6 +65,7 @@ import org.springframework.transaction.annotation.Transactional; /** * Provides implementations of methods in {@link DataAccessService}. */ +@SuppressWarnings("deprecation") @Transactional public class DataAccessServiceImpl extends FusionService implements DataAccessService { diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LdapServiceImpl.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LdapServiceImpl.java index d859ec82..e0acdbfe 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LdapServiceImpl.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LdapServiceImpl.java @@ -51,6 +51,7 @@ import javax.naming.directory.SearchControls; import org.onap.portalsdk.core.command.support.SearchResult; import org.onap.portalsdk.core.domain.User; import org.onap.portalsdk.core.domain.support.DomainVo; +import org.onap.portalsdk.core.logging.aspect.MetricsLog; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.service.support.FusionService; import org.onap.portalsdk.core.service.support.ServiceLocator; @@ -58,7 +59,6 @@ import org.onap.portalsdk.core.util.SystemProperties; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.onap.portalsdk.core.logging.aspect.MetricsLog; @Service("ldapService") @Transactional diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LoginServiceCentralizedImpl.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LoginServiceCentralizedImpl.java index 9c54f8e9..8b7d7fcb 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LoginServiceCentralizedImpl.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LoginServiceCentralizedImpl.java @@ -71,7 +71,7 @@ public class LoginServiceCentralizedImpl extends FusionService implements LoginS @Autowired private UserService userService; - + private static String portalApiVersion = "/v1"; @Override @@ -159,7 +159,6 @@ public class LoginServiceCentralizedImpl extends FusionService implements LoginS logger.debug(EELFLoggerDelegate.debugLogger, "createUser: " + user.getOrgUserId()); User user1 = new User(); user1.setEmail(user.getEmail()); - user1.setEmail(user.getEmail()); user1.setFirstName(user.getFirstName()); user1.setHrid(user.getHrid()); user1.setJobTitle(user.getJobTitle()); @@ -212,7 +211,8 @@ public class LoginServiceCentralizedImpl extends FusionService implements LoginS } private User findUser(LoginBean bean) throws IOException { - String repsonse = restApiRequestBuilder.getViaREST(portalApiVersion+"/user/" + bean.getUserid(), true, bean.getUserid()); + String repsonse = restApiRequestBuilder.getViaREST(portalApiVersion + "/user/" + bean.getUserid(), true, + bean.getUserid()); User user = userService.userMapper(repsonse); user.setId(getUserIdByOrgUserId(user.getOrgUserId())); return user; diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LoginServiceImpl.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LoginServiceImpl.java index e86ec555..95e1c501 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LoginServiceImpl.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LoginServiceImpl.java @@ -48,6 +48,7 @@ import java.util.Set; import org.onap.portalsdk.core.command.LoginBean; import org.onap.portalsdk.core.domain.Role; import org.onap.portalsdk.core.domain.User; +import org.onap.portalsdk.core.logging.aspect.MetricsLog; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.menu.MenuBuilder; import org.onap.portalsdk.core.service.support.FusionService; @@ -56,7 +57,6 @@ import org.onap.portalsdk.core.web.support.AppUtils; import org.onap.portalsdk.core.web.support.UserUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; -import org.onap.portalsdk.core.logging.aspect.MetricsLog; @Transactional @MetricsLog diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/PostSearchServiceImpl.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/PostSearchServiceImpl.java index de5864fb..b21476d5 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/PostSearchServiceImpl.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/PostSearchServiceImpl.java @@ -43,11 +43,11 @@ import java.util.List; import javax.servlet.http.HttpServletRequest; -import org.onap.portalsdk.core.FusionObject.Parameters; import org.onap.portalsdk.core.command.PostSearchBean; import org.onap.portalsdk.core.domain.Lookup; import org.onap.portalsdk.core.domain.Role; import org.onap.portalsdk.core.domain.User; +import org.onap.portalsdk.core.domain.FusionObject.Parameters; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.util.SystemProperties; import org.springframework.beans.factory.annotation.Autowired; diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/ProfileServiceImpl.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/ProfileServiceImpl.java index a670d1a4..fd9aeb2d 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/ProfileServiceImpl.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/ProfileServiceImpl.java @@ -42,9 +42,9 @@ import java.util.List; import org.onap.portalsdk.core.dao.ProfileDao; import org.onap.portalsdk.core.domain.Profile; import org.onap.portalsdk.core.domain.User; +import org.onap.portalsdk.core.logging.aspect.MetricsLog; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; -import org.onap.portalsdk.core.logging.aspect.MetricsLog; @Transactional @MetricsLog diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/RoleServiceImpl.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/RoleServiceImpl.java index 8002ef2f..43cac076 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/RoleServiceImpl.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/RoleServiceImpl.java @@ -49,10 +49,10 @@ import javax.sql.DataSource; import org.onap.portalsdk.core.domain.Role; import org.onap.portalsdk.core.domain.RoleFunction; +import org.onap.portalsdk.core.logging.aspect.MetricsLog; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; -import org.onap.portalsdk.core.logging.aspect.MetricsLog; @Transactional @MetricsLog diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UserServiceCentalizedImpl.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UserServiceCentalizedImpl.java index 2747566c..45ef1557 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UserServiceCentalizedImpl.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UserServiceCentalizedImpl.java @@ -51,7 +51,6 @@ import org.onap.portalsdk.core.domain.Role; import org.onap.portalsdk.core.domain.RoleFunction; import org.onap.portalsdk.core.domain.User; import org.onap.portalsdk.core.domain.UserApp; -import org.onap.portalsdk.core.web.support.UserUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/support/FusionService.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/support/FusionService.java index a603b2e3..0648787c 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/support/FusionService.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/support/FusionService.java @@ -37,7 +37,7 @@ */ package org.onap.portalsdk.core.service.support; -import org.onap.portalsdk.core.FusionObject; +import org.onap.portalsdk.core.domain.FusionObject; public class FusionService implements FusionObject { /** Logger for this class and subclasses */ diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/util/SystemProperties.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/util/SystemProperties.java index fa11c09f..ad2e7b89 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/util/SystemProperties.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/util/SystemProperties.java @@ -264,6 +264,10 @@ public class SystemProperties { public static final String LEFT_MENU_PARENT = "parentList"; public static final String LEFT_MENU_CHILDREND = "childItemList"; public static final String COOKIE_DOMAIN = "cookie_domain"; + + // eCOMP Portal host name + public static final String ECOMP_PORTAL_HOST_NAME = "ecomp_portal_host_name"; + public static final String ECOMP_PORTAL_SERVER_PORT = "ecomp_portal_server_port"; public enum RESULT_ENUM { diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/web/support/AppUtils.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/web/support/AppUtils.java index dec6fb79..ab866aa4 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/web/support/AppUtils.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/web/support/AppUtils.java @@ -45,6 +45,7 @@ import javax.servlet.http.HttpSession; import javax.sql.DataSource; import org.hibernate.Session; +import org.onap.portalsdk.core.domain.Lookup; import org.onap.portalsdk.core.exception.SessionExpiredException; import org.onap.portalsdk.core.objectcache.AbstractCacheManager; import org.onap.portalsdk.core.service.DataAccessService; @@ -160,13 +161,13 @@ public class AppUtils { return ""; } - List lstResult = getLookupListNoCache(dbTable, dbValueCol, dbLabelCol, + List lstResult = getLookupListNoCache(dbTable, dbValueCol, dbLabelCol, dbLabelCol + "='" + label.replaceAll("'", "''") + "'", ""); if (lstResult == null) { return ""; } if (!lstResult.isEmpty()) { - return ((org.onap.portalsdk.core.domain.Lookup) lstResult.toArray()[0]).getValue(); + return ((Lookup) lstResult.toArray()[0]).getValue(); } else { return ""; } @@ -180,7 +181,7 @@ public class AppUtils { Iterator i = lookupList.iterator(); while (i.hasNext()) { - org.onap.portalsdk.core.domain.Lookup lookup = (org.onap.portalsdk.core.domain.Lookup) i.next(); + Lookup lookup = (Lookup) i.next(); if (lookup.getLabel().equals(label)) { return lookup.getValue(); } diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/dao/ProfileDaoImplTest.java b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/dao/ProfileDaoImplTest.java index 2c476f68..16c6d5be 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/dao/ProfileDaoImplTest.java +++ b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/dao/ProfileDaoImplTest.java @@ -43,7 +43,6 @@ import java.util.List; import org.hibernate.Criteria; import org.hibernate.Session; import org.hibernate.SessionFactory; -import org.hibernate.criterion.Restrictions; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/sessionmgt/TimeoutVOTest.java b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/sessionmgt/TimeoutVOTest.java index 70e51963..cac61159 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/sessionmgt/TimeoutVOTest.java +++ b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/sessionmgt/TimeoutVOTest.java @@ -37,10 +37,9 @@ */ package org.onap.portalsdk.core.domain.sessionmgt; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; import org.junit.Test; -import org.onap.portalsdk.core.domain.support.DomainVo; public class TimeoutVOTest { diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/restful/client/PortalRestClientBaseTest.java b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/restful/client/PortalRestClientBaseTest.java index 20e3d8ab..0f6c24f0 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/restful/client/PortalRestClientBaseTest.java +++ b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/restful/client/PortalRestClientBaseTest.java @@ -54,7 +54,6 @@ import org.onap.portalsdk.core.domain.App; import org.onap.portalsdk.core.onboarding.util.CipherUtil; import org.onap.portalsdk.core.onboarding.util.PortalApiConstants; import org.onap.portalsdk.core.onboarding.util.PortalApiProperties; -import org.onap.portalsdk.core.restful.client.PortalRestClientBase; import org.onap.portalsdk.core.service.AppService; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/restful/client/SharedContextRestClientTest.java b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/restful/client/SharedContextRestClientTest.java index 2e0b4c4c..19d97862 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/restful/client/SharedContextRestClientTest.java +++ b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/restful/client/SharedContextRestClientTest.java @@ -56,7 +56,6 @@ import org.onap.portalsdk.core.onboarding.util.CipherUtil; import org.onap.portalsdk.core.onboarding.util.PortalApiConstants; import org.onap.portalsdk.core.onboarding.util.PortalApiProperties; import org.onap.portalsdk.core.restful.domain.SharedContext; -import org.onap.portalsdk.core.scheduler.CoreRegister; import org.onap.portalsdk.core.service.AppService; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/DataAccessServiceImplTest.java b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/DataAccessServiceImplTest.java index af804c72..9a0003d4 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/DataAccessServiceImplTest.java +++ b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/DataAccessServiceImplTest.java @@ -56,7 +56,7 @@ import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; -import org.onap.portalsdk.core.FusionObject.Parameters; +import org.onap.portalsdk.core.domain.FusionObject.Parameters; import org.onap.portalsdk.core.domain.support.DomainVo; import org.onap.portalsdk.core.util.SystemProperties; import org.powermock.api.mockito.PowerMockito; diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/UrlAccessImplTest.java b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/UrlAccessImplTest.java index 8da4ee31..2460eb59 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/UrlAccessImplTest.java +++ b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/UrlAccessImplTest.java @@ -40,8 +40,6 @@ package org.onap.portalsdk.core.service; import java.util.ArrayList; import java.util.List; -import org.hibernate.criterion.Criterion; -import org.hibernate.criterion.Restrictions; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/UserProfileServiceImplTest.java b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/UserProfileServiceImplTest.java index c08af92d..a03dee81 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/UserProfileServiceImplTest.java +++ b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/UserProfileServiceImplTest.java @@ -37,19 +37,12 @@ */ package org.onap.portalsdk.core.service; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; -import org.mockito.Mockito; import org.onap.portalsdk.core.domain.User; -import org.onap.portalsdk.core.domain.support.CollaborateList; import org.powermock.modules.junit4.PowerMockRunner; diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/UserServiceCentalizedImplTest.java b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/UserServiceCentalizedImplTest.java index 11c593d4..6feb5fe6 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/UserServiceCentalizedImplTest.java +++ b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/UserServiceCentalizedImplTest.java @@ -43,7 +43,6 @@ import java.util.List; import java.util.Map; import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; diff --git a/ecomp-sdk/epsdk-domain/.gitignore b/ecomp-sdk/epsdk-domain/.gitignore new file mode 100644 index 00000000..b83d2226 --- /dev/null +++ b/ecomp-sdk/epsdk-domain/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/ecomp-sdk/epsdk-domain/pom.xml b/ecomp-sdk/epsdk-domain/pom.xml new file mode 100644 index 00000000..34a55ac4 --- /dev/null +++ b/ecomp-sdk/epsdk-domain/pom.xml @@ -0,0 +1,95 @@ + + 4.0.0 + + + org.onap.portal.sdk + epsdk-project + 2.4.0-SNAPSHOT + + + org.onap.portal.sdk + epsdk-domain + 2.4.0-SNAPSHOT + jar + ONAP Portal SDK Domain + + + UTF-8 + + + + + org.onap.portal.sdk + epsdk-fw + ${project.version} + + + + com.fasterxml.jackson.core + jackson-annotations + 2.8.10 + + + com.fasterxml.jackson.core + jackson-core + 2.8.10 + + + com.fasterxml.jackson.core + jackson-databind + 2.8.10 + + + org.mockito + mockito-core + 1.10.19 + test + + + + org.jacoco + org.jacoco.agent + ${jacoco.version} + runtime + + + junit + junit + 4.12 + test + + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.6 + + + + ${project.version} + ${sdk-internal.version} + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + 1.8 + 1.8 + + + + + + + diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/App.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/App.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/App.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/App.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/AuditLog.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/AuditLog.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/AuditLog.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/AuditLog.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/BroadcastMessage.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/BroadcastMessage.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/BroadcastMessage.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/BroadcastMessage.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/DomainVo.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/DomainVo.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/DomainVo.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/DomainVo.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/FnMenu.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/FnMenu.java similarity index 98% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/FnMenu.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/FnMenu.java index 8746786f..f940aa4a 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/FnMenu.java +++ b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/FnMenu.java @@ -37,8 +37,6 @@ */ package org.onap.portalsdk.core.domain; -import org.onap.portalsdk.core.domain.support.DomainVo; - /** *

* RoleFunction.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/FusionObject.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/FusionObject.java similarity index 99% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/FusionObject.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/FusionObject.java index 9928b65f..820bc180 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/FusionObject.java +++ b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/FusionObject.java @@ -35,7 +35,7 @@ * * */ -package org.onap.portalsdk.core; +package org.onap.portalsdk.core.domain; /** *

diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/FusionVo.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/FusionVo.java similarity index 97% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/FusionVo.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/FusionVo.java index 2ff3729a..21bf5151 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/FusionVo.java +++ b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/FusionVo.java @@ -37,8 +37,6 @@ */ package org.onap.portalsdk.core.domain; -import org.onap.portalsdk.core.FusionObject; - public class FusionVo implements FusionObject { public FusionVo() { // No-argument constructor diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/LoginBean.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/LoginBean.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/LoginBean.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/LoginBean.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/Lookup.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/Lookup.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/Lookup.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/Lookup.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/LuCountry.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/LuCountry.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/LuCountry.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/LuCountry.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/LuState.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/LuState.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/LuState.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/LuState.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/LuTimeZone.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/LuTimeZone.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/LuTimeZone.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/LuTimeZone.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/Menu.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/Menu.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/Menu.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/Menu.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/MenuData.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/MenuData.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/MenuData.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/MenuData.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/Profile.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/Profile.java similarity index 98% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/Profile.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/Profile.java index c01a6fa9..20200ce8 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/Profile.java +++ b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/Profile.java @@ -37,8 +37,6 @@ */ package org.onap.portalsdk.core.domain; -import org.onap.portalsdk.core.domain.support.DomainVo; - public class Profile extends DomainVo { private static final long serialVersionUID = 3409056457412656883L; diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/Role.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/Role.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/Role.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/Role.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/RoleFunction.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/RoleFunction.java similarity index 95% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/RoleFunction.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/RoleFunction.java index 6f89f6e2..98da488f 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/RoleFunction.java +++ b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/RoleFunction.java @@ -40,7 +40,6 @@ package org.onap.portalsdk.core.domain; import org.onap.portalsdk.core.domain.support.DomainVo; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; /** *

@@ -105,4 +104,10 @@ public class RoleFunction extends DomainVo { return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2); } + @Override + public String toString() { + return "RoleFunction [code=" + code + ", name=" + name + ", type=" + type + ", action=" + action + "]"; + } + + } diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/UrlsAccessible.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/UrlsAccessible.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/UrlsAccessible.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/UrlsAccessible.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/UrlsAccessibleKey.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/UrlsAccessibleKey.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/UrlsAccessibleKey.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/UrlsAccessibleKey.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/User.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/User.java similarity index 98% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/User.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/User.java index f79f1f03..3fb5e205 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/User.java +++ b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/User.java @@ -591,4 +591,11 @@ public class User extends DomainVo { return c1.compareTo(c2); } + @Override + public String toString() { + return "User [orgUserId=" + orgUserId + ", userApps=" + userApps + ", pseudoRoles=" + pseudoRoles + "]"; + } + + + } diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/UserApp.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/UserApp.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/UserApp.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/UserApp.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/UserAppId.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/UserAppId.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/UserAppId.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/UserAppId.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/Attribute.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Attribute.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/Attribute.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Attribute.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/CollaborateList.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/CollaborateList.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/CollaborateList.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/CollaborateList.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/Container.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Container.java similarity index 98% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/Container.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Container.java index 5865fe38..3d9ee77a 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/Container.java +++ b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Container.java @@ -40,12 +40,8 @@ package org.onap.portalsdk.core.domain.support; import java.util.List; import java.util.Map; -import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; - public class Container { - private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(Container.class); - String id; String name; @@ -172,7 +168,6 @@ public class Container { } public Size computeSize() { - logger.debug("computeSize: name is {}", getName()); Size size = new Size(); double width = 0; double height = 0; diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/Domain.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Domain.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/Domain.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Domain.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/DomainVo.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/DomainVo.java similarity index 94% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/DomainVo.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/DomainVo.java index c615eb8d..d2f41c90 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/DomainVo.java +++ b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/DomainVo.java @@ -46,12 +46,13 @@ import java.util.Date; import java.util.Set; import org.onap.portalsdk.core.domain.FusionVo; -import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; /* Super class from which all data objects descend */ +@SuppressWarnings("rawtypes") public class DomainVo extends FusionVo implements Serializable, Cloneable, Comparable { - private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(DomainVo.class); +// TODO: Remove after the EELFLoggerImpl +// private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(DomainVo.class); private static final long serialVersionUID = 1L; protected Long id; @@ -157,7 +158,9 @@ public class DomainVo extends FusionVo implements Serializable, Cloneable, Compa } } catch (Exception e) { - logger.error(EELFLoggerDelegate.errorLogger, "copy failed", e); + +// TODO: Remove after the EELFLoggerImpl logger.error(EELFLoggerDelegate.errorLogger, "copy failed", e); + e.printStackTrace(); } return newVo; diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/Element.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Element.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/Element.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Element.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/ElementDetails.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/ElementDetails.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/ElementDetails.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/ElementDetails.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/FusionCommand.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/FusionCommand.java similarity index 97% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/FusionCommand.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/FusionCommand.java index 00edc836..b79dc064 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/FusionCommand.java +++ b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/FusionCommand.java @@ -37,7 +37,7 @@ */ package org.onap.portalsdk.core.domain.support; -import org.onap.portalsdk.core.FusionObject; +import org.onap.portalsdk.core.domain.FusionObject; public class FusionCommand implements FusionObject { diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/Layout.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Layout.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/Layout.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Layout.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/NameValueId.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/NameValueId.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/NameValueId.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/NameValueId.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/Position.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Position.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/Position.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Position.java diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/Size.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Size.java similarity index 100% rename from ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/Size.java rename to ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/support/Size.java diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/AppTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/AppTest.java similarity index 98% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/AppTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/AppTest.java index 5f43ea2d..d54a314b 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/AppTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/AppTest.java @@ -37,9 +37,10 @@ */ package org.onap.portalsdk.core.domain; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; import org.junit.Test; +import org.onap.portalsdk.core.domain.App; public class AppTest { diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/AuditLogTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/AuditLogTest.java similarity index 98% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/AuditLogTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/AuditLogTest.java index f5924ab3..d293797c 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/AuditLogTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/AuditLogTest.java @@ -40,6 +40,7 @@ package org.onap.portalsdk.core.domain; import static org.junit.Assert.*; import org.junit.Test; +import org.onap.portalsdk.core.domain.AuditLog; public class AuditLogTest { diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/BroadcastMessageTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/BroadcastMessageTest.java similarity index 98% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/BroadcastMessageTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/BroadcastMessageTest.java index 03dd3eec..85250421 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/BroadcastMessageTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/BroadcastMessageTest.java @@ -40,6 +40,7 @@ package org.onap.portalsdk.core.domain; import static org.junit.Assert.*; import org.junit.Test; +import org.onap.portalsdk.core.domain.BroadcastMessage; public class BroadcastMessageTest { diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/FnMenuTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/FnMenuTest.java similarity index 98% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/FnMenuTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/FnMenuTest.java index 1caeae2b..cc66d694 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/FnMenuTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/FnMenuTest.java @@ -40,6 +40,7 @@ package org.onap.portalsdk.core.domain; import static org.junit.Assert.*; import org.junit.Test; +import org.onap.portalsdk.core.domain.FnMenu; public class FnMenuTest { diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/LoginBeanTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/LoginBeanTest.java similarity index 98% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/LoginBeanTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/LoginBeanTest.java index 77b0a456..b6f625f2 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/LoginBeanTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/LoginBeanTest.java @@ -40,6 +40,7 @@ package org.onap.portalsdk.core.domain; import static org.junit.Assert.*; import org.junit.Test; +import org.onap.portalsdk.core.domain.LoginBean; public class LoginBeanTest { diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/LookupTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/LookupTest.java similarity index 92% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/LookupTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/LookupTest.java index 0495055d..60e01d04 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/LookupTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/LookupTest.java @@ -37,9 +37,13 @@ */ package org.onap.portalsdk.core.domain; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import org.junit.Test; +import org.onap.portalsdk.core.domain.Lookup; import org.onap.portalsdk.core.domain.support.NameValueId; public class LookupTest { diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/LuCountryTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/LuCountryTest.java similarity index 98% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/LuCountryTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/LuCountryTest.java index e75ca276..92df23a3 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/LuCountryTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/LuCountryTest.java @@ -40,6 +40,7 @@ package org.onap.portalsdk.core.domain; import static org.junit.Assert.assertEquals; import org.junit.Test; +import org.onap.portalsdk.core.domain.LuCountry; public class LuCountryTest { diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/LuStateTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/LuStateTest.java similarity index 98% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/LuStateTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/LuStateTest.java index d42b66c4..011a076d 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/LuStateTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/LuStateTest.java @@ -40,6 +40,7 @@ package org.onap.portalsdk.core.domain; import static org.junit.Assert.*; import org.junit.Test; +import org.onap.portalsdk.core.domain.LuState; public class LuStateTest { diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/LuTimeZoneTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/LuTimeZoneTest.java similarity index 98% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/LuTimeZoneTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/LuTimeZoneTest.java index f02bda92..a36bf0ac 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/LuTimeZoneTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/LuTimeZoneTest.java @@ -41,6 +41,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import org.junit.Test; +import org.onap.portalsdk.core.domain.LuTimeZone; public class LuTimeZoneTest { diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/MenuDataTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/MenuDataTest.java similarity index 98% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/MenuDataTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/MenuDataTest.java index f161efb3..878d3e69 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/MenuDataTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/MenuDataTest.java @@ -40,6 +40,7 @@ package org.onap.portalsdk.core.domain; import static org.junit.Assert.*; import org.junit.Test; +import org.onap.portalsdk.core.domain.MenuData; public class MenuDataTest { diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/MenuTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/MenuTest.java similarity index 98% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/MenuTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/MenuTest.java index a1344bf9..ab1f62a6 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/MenuTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/MenuTest.java @@ -40,6 +40,7 @@ package org.onap.portalsdk.core.domain; import static org.junit.Assert.*; import org.junit.Test; +import org.onap.portalsdk.core.domain.Menu; public class MenuTest { diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/ProfileTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/ProfileTest.java similarity index 98% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/ProfileTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/ProfileTest.java index 89d09ca4..7a85a839 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/ProfileTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/ProfileTest.java @@ -40,6 +40,7 @@ package org.onap.portalsdk.core.domain; import static org.junit.Assert.*; import org.junit.Test; +import org.onap.portalsdk.core.domain.Profile; public class ProfileTest { diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/RoleFunctionTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/RoleFunctionTest.java similarity index 98% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/RoleFunctionTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/RoleFunctionTest.java index e207c8ee..bb29443f 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/RoleFunctionTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/RoleFunctionTest.java @@ -40,6 +40,7 @@ package org.onap.portalsdk.core.domain; import static org.junit.Assert.*; import org.junit.Test; +import org.onap.portalsdk.core.domain.RoleFunction; public class RoleFunctionTest { diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/RoleTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/RoleTest.java similarity index 97% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/RoleTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/RoleTest.java index 5459079f..dd1e1b1f 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/RoleTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/RoleTest.java @@ -44,6 +44,8 @@ import java.util.Set; import java.util.TreeSet; import org.junit.Test; +import org.onap.portalsdk.core.domain.Role; +import org.onap.portalsdk.core.domain.RoleFunction; public class RoleTest { diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/UrlsAccessibleKeyTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/UrlsAccessibleKeyTest.java similarity index 97% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/UrlsAccessibleKeyTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/UrlsAccessibleKeyTest.java index 2f9fac3b..a1540f2c 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/UrlsAccessibleKeyTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/UrlsAccessibleKeyTest.java @@ -40,6 +40,8 @@ package org.onap.portalsdk.core.domain; import static org.junit.Assert.*; import org.junit.Test; +import org.onap.portalsdk.core.domain.UrlsAccessibleKey; +import org.onap.portalsdk.core.domain.User; public class UrlsAccessibleKeyTest { diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/UrlsAccessibleTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/UrlsAccessibleTest.java similarity index 95% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/UrlsAccessibleTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/UrlsAccessibleTest.java index 22d006b2..dfe76e1f 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/UrlsAccessibleTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/UrlsAccessibleTest.java @@ -40,6 +40,9 @@ package org.onap.portalsdk.core.domain; import static org.junit.Assert.*; import org.junit.Test; +import org.onap.portalsdk.core.domain.UrlsAccessible; +import org.onap.portalsdk.core.domain.UrlsAccessibleKey; +import org.onap.portalsdk.core.domain.User; public class UrlsAccessibleTest { diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/UserAppIdTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/UserAppIdTest.java similarity index 94% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/UserAppIdTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/UserAppIdTest.java index 0290932c..00b05bed 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/UserAppIdTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/UserAppIdTest.java @@ -40,6 +40,10 @@ package org.onap.portalsdk.core.domain; import static org.junit.Assert.*; import org.junit.Test; +import org.onap.portalsdk.core.domain.App; +import org.onap.portalsdk.core.domain.Role; +import org.onap.portalsdk.core.domain.User; +import org.onap.portalsdk.core.domain.UserAppId; public class UserAppIdTest { diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/UserAppTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/UserAppTest.java similarity index 94% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/UserAppTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/UserAppTest.java index ce2c08ad..2433d93b 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/UserAppTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/UserAppTest.java @@ -40,6 +40,10 @@ package org.onap.portalsdk.core.domain; import static org.junit.Assert.*; import org.junit.Test; +import org.onap.portalsdk.core.domain.App; +import org.onap.portalsdk.core.domain.Role; +import org.onap.portalsdk.core.domain.User; +import org.onap.portalsdk.core.domain.UserApp; public class UserAppTest { diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/UserTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/UserTest.java similarity index 97% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/UserTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/UserTest.java index 60b6c6dd..598ee900 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/domain/UserTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/UserTest.java @@ -44,6 +44,10 @@ import java.util.SortedSet; import java.util.TreeSet; import org.junit.Test; +import org.onap.portalsdk.core.domain.App; +import org.onap.portalsdk.core.domain.Role; +import org.onap.portalsdk.core.domain.User; +import org.onap.portalsdk.core.domain.UserApp; public class UserTest { diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/AttributeTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/AttributeTest.java similarity index 98% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/AttributeTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/AttributeTest.java index a2209bac..d86163b5 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/AttributeTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/AttributeTest.java @@ -35,7 +35,7 @@ * * */ -package org.onap.portalsdk.domain.support; +package org.onap.portalsdk.core.domain.support; import static org.junit.Assert.assertEquals; diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/CollaborateListTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/CollaborateListTest.java similarity index 97% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/CollaborateListTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/CollaborateListTest.java index 88ae4cc1..a1dc2e02 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/CollaborateListTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/CollaborateListTest.java @@ -35,7 +35,7 @@ * * */ -package org.onap.portalsdk.domain.support; +package org.onap.portalsdk.core.domain.support; import static org.junit.Assert.assertEquals; diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/ContainerTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/ContainerTest.java similarity index 95% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/ContainerTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/ContainerTest.java index bfb99589..c468bec6 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/ContainerTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/ContainerTest.java @@ -35,7 +35,7 @@ * * */ -package org.onap.portalsdk.domain.support; +package org.onap.portalsdk.core.domain.support; import static org.junit.Assert.assertEquals; @@ -47,23 +47,18 @@ import java.util.Map; import org.junit.Before; import org.junit.Test; import org.mockito.InjectMocks; -import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.onap.portalsdk.core.domain.User; import org.onap.portalsdk.core.domain.support.Container; import org.onap.portalsdk.core.domain.support.Element; import org.onap.portalsdk.core.domain.support.Position; import org.onap.portalsdk.core.domain.support.Size; -import org.onap.portalsdk.core.restful.client.SharedContextRestClient; -import org.onap.portalsdk.core.web.support.UserUtils; public class ContainerTest { @InjectMocks Container container = new Container(); - @Mock - private SharedContextRestClient sharedContextRestClient; @Before public void setup() { @@ -76,9 +71,6 @@ public class ContainerTest { User user = new User(); - @Mock - UserUtils userUtils = new UserUtils(); - private static final double DELTA = 1e-15; public Container mockContainer(){ diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/DomainTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/DomainTest.java similarity index 99% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/DomainTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/DomainTest.java index b085e03d..ec455b43 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/DomainTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/DomainTest.java @@ -35,7 +35,7 @@ * * */ -package org.onap.portalsdk.domain.support; +package org.onap.portalsdk.core.domain.support; import static org.junit.Assert.assertEquals; diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/DomainVOTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/DomainVOTest.java similarity index 98% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/DomainVOTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/DomainVOTest.java index 57237d67..93678128 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/DomainVOTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/DomainVOTest.java @@ -35,7 +35,7 @@ * * */ -package org.onap.portalsdk.domain.support; +package org.onap.portalsdk.core.domain.support; import static org.junit.Assert.assertEquals; diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/ElementDetailsTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/ElementDetailsTest.java similarity index 98% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/ElementDetailsTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/ElementDetailsTest.java index c543a8f3..d6b9c11b 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/ElementDetailsTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/ElementDetailsTest.java @@ -35,7 +35,7 @@ * * */ -package org.onap.portalsdk.domain.support; +package org.onap.portalsdk.core.domain.support; import static org.junit.Assert.assertEquals; diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/ElementTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/ElementTest.java similarity index 98% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/ElementTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/ElementTest.java index e40bedd8..6eec6f00 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/ElementTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/ElementTest.java @@ -35,7 +35,7 @@ * * */ -package org.onap.portalsdk.domain.support; +package org.onap.portalsdk.core.domain.support; import static org.junit.Assert.assertEquals; diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/FusionCommandTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/FusionCommandTest.java similarity index 95% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/FusionCommandTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/FusionCommandTest.java index fa30f35c..f54bacbe 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/FusionCommandTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/FusionCommandTest.java @@ -35,9 +35,9 @@ * * */ -package org.onap.portalsdk.domain.support; +package org.onap.portalsdk.core.domain.support; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; import org.junit.Test; import org.onap.portalsdk.core.domain.support.FusionCommand; diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/LayoutTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/LayoutTest.java similarity index 99% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/LayoutTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/LayoutTest.java index a738440b..c7038144 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/LayoutTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/LayoutTest.java @@ -35,7 +35,7 @@ * * */ -package org.onap.portalsdk.domain.support; +package org.onap.portalsdk.core.domain.support; import static org.junit.Assert.assertEquals; diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/NameValueIdTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/NameValueIdTest.java similarity index 96% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/NameValueIdTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/NameValueIdTest.java index 6181a728..087079b7 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/NameValueIdTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/NameValueIdTest.java @@ -35,13 +35,12 @@ * * */ -package org.onap.portalsdk.domain.support; +package org.onap.portalsdk.core.domain.support; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import org.junit.Test; -import org.onap.portalsdk.core.domain.support.DomainVo; import org.onap.portalsdk.core.domain.support.NameValueId; public class NameValueIdTest { diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/PositionTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/PositionTest.java similarity index 97% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/PositionTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/PositionTest.java index d68a2cf2..57508c30 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/PositionTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/PositionTest.java @@ -35,7 +35,7 @@ * * */ -package org.onap.portalsdk.domain.support; +package org.onap.portalsdk.core.domain.support; import static org.junit.Assert.assertEquals; diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/SizeTest.java b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/SizeTest.java similarity index 97% rename from ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/SizeTest.java rename to ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/SizeTest.java index b6c4c89d..f993db20 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/domain/support/SizeTest.java +++ b/ecomp-sdk/epsdk-domain/src/test/java/org/onap/portalsdk/core/domain/support/SizeTest.java @@ -35,7 +35,7 @@ * * */ -package org.onap.portalsdk.domain.support; +package org.onap.portalsdk.core.domain.support; import static org.junit.Assert.assertEquals; diff --git a/ecomp-sdk/epsdk-fw/pom.xml b/ecomp-sdk/epsdk-fw/pom.xml index 55f68744..91487ad8 100644 --- a/ecomp-sdk/epsdk-fw/pom.xml +++ b/ecomp-sdk/epsdk-fw/pom.xml @@ -6,7 +6,7 @@ org.onap.portal.sdk epsdk-project - 2.2.0-SNAPSHOT + 2.4.0-SNAPSHOT @@ -92,20 +92,20 @@ log4j - xerces - xercesImpl + xerces + xercesImpl - xalan - xalan + xalan + xalan - commons-beanutils - commons-beanutils-core + commons-beanutils + commons-beanutils-core - commons-httpclient - commons-httpclient + commons-httpclient + commons-httpclient org.beanshell diff --git a/ecomp-sdk/epsdk-music/pom.xml b/ecomp-sdk/epsdk-music/pom.xml index d1b6ef27..44970e13 100644 --- a/ecomp-sdk/epsdk-music/pom.xml +++ b/ecomp-sdk/epsdk-music/pom.xml @@ -5,12 +5,12 @@ org.onap.portal.sdk epsdk-project - 2.2.0-SNAPSHOT + 2.4.0-SNAPSHOT - + org.onap.portal.sdk epsdk-music - 2.2.0-SNAPSHOT + 2.4.0-SNAPSHOT jar ONAP Portal SDK Music @@ -114,13 +114,20 @@ + + javax.servlet + javax.servlet-api + 3.0.1 + provided + + org.onap.music MUSIC 2.5.3 - - + + com.fasterxml.jackson.core diff --git a/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/conf/MusicSessionRepositoryHandler.java b/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/conf/MusicSessionRepositoryHandler.java index ad90d4ec..7d2e51ff 100644 --- a/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/conf/MusicSessionRepositoryHandler.java +++ b/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/conf/MusicSessionRepositoryHandler.java @@ -85,6 +85,7 @@ public class MusicSessionRepositoryHandler { sessions.put(id, musicSession); try { MusicService.setMetaAttribute(musicSession); + MusicService.cleanUpMusic(); } catch (Exception e) { logger.error(EELFLoggerDelegate.errorLogger, "setMetaAttribute failed with id " + id, e); } diff --git a/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/filter/MusicSessionRepositoryFilter.java b/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/filter/MusicSessionRepositoryFilter.java new file mode 100644 index 00000000..aa9e2e3e --- /dev/null +++ b/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/filter/MusicSessionRepositoryFilter.java @@ -0,0 +1,70 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + *. + */ + +package org.onap.portalapp.music.filter; + +import java.io.IOException; + +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; + +import org.onap.music.eelf.logging.EELFLoggerDelegate; +import org.onap.portalapp.music.util.MusicUtil; +import org.springframework.web.filter.DelegatingFilterProxy; + +public class MusicSessionRepositoryFilter extends DelegatingFilterProxy{ + private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MusicUtil.class); + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) + throws ServletException, IOException { + try{ + if (request instanceof HttpServletRequest) { + String path = ((HttpServletRequest)request).getRequestURI().substring(((HttpServletRequest) request).getContextPath().length()); + if(MusicUtil.isExcludedApi(path)) + request.setAttribute("org.springframework.session.web.http.SessionRepositoryFilter.FILTERED", Boolean.TRUE); + } + }catch(Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, "Failed to check the exclude apis ", e); + } + super.doFilter(request, response, filterChain); + } +} diff --git a/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/service/MusicService.java b/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/service/MusicService.java index 4ceac22c..801e9c03 100644 --- a/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/service/MusicService.java +++ b/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/service/MusicService.java @@ -38,7 +38,12 @@ package org.onap.portalapp.music.service; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; import java.util.HashMap; +import java.util.List; import java.util.Map; import org.onap.music.datastore.PreparedQueryObject; @@ -61,6 +66,7 @@ import org.springframework.session.Session; import org.springframework.web.client.RestTemplate; import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.Row; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @@ -539,5 +545,108 @@ public class MusicService { path.append("/"); return path.toString(); } + + /** + * Get a list of sessions that need to be cleaned up + * + * @return List + */ + private static List getSessionToBeDeleted(){ + logger.debug(EELFLoggerDelegate.debugLogger, "initial getSessionToBeDeleted ..."); + + PreparedQueryObject queryObject = new PreparedQueryObject(); + ResultSet result = null; + List sessionIDList = new ArrayList<>(); + DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); + StringBuilder querySB = new StringBuilder(); + String cleanUpThreshold = MusicProperties.getProperty(MusicProperties.MUSIC_CLEAN_UP_THRESHOLD); //Clean up sessions that's cleanUpThreshold hours ago + Date dateForCleanup = new Date(System.currentTimeMillis() - 3600 * 1000 * Integer.valueOf(cleanUpThreshold)); // Get the threshold date that needs to be clean up + String dateForCleanupCondition = dateFormat.format(dateForCleanup); + querySB.append("SELECT ").append(MusicProperties.PRIMARY_ID).append(" FROM ").append(musicKeySpace) + .append(".").append(getTableName(true)).append(" WHERE ").append(MusicProperties.LAST_ACCESS_TIME) + .append("< ? ").append(" ALLOW FILTERING"); + queryObject.appendQueryString(querySB.toString()); + queryObject.addValue(dateForCleanupCondition); + + try{ + if (isAtomicGet) + result = MusicCore.atomicGet(musicKeySpace, musicMetaTable, null, queryObject); + else + result = MusicCore.get(queryObject); + Row row = result.one(); + while(row!=null){ + sessionIDList.add(row.get(MusicProperties.PRIMARY_ID, String.class)); + row = result.one(); + } + }catch(Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, "Error while cleaning up music tables" , e); + } + return sessionIDList; + } + + /** + * Remove session data in music base on the defined frequency + * + * @return List + */ + public static void cleanUpMusic() { + boolean timeToCleanUp = MusicUtil.cleanUp(); // Decide whether to clean up or not + ReturnType result = null; + if(timeToCleanUp){ + /**Getting a list of sessions that need to be cleaned up*/ + List sessionIDList = getSessionToBeDeleted(); + if(sessionIDList!=null || sessionIDList.size()!=0){ + StringBuilder sessionIDListCondition = new StringBuilder(); + sessionIDListCondition.append("('"); + for(String s : sessionIDList){ + sessionIDListCondition.append(s); + sessionIDListCondition.append("','"); + } + sessionIDListCondition.deleteCharAt(sessionIDListCondition.length()-1); + sessionIDListCondition.deleteCharAt(sessionIDListCondition.length()-1); + sessionIDListCondition.append(")"); + StringBuilder querySB = new StringBuilder(); + PreparedQueryObject queryObject = new PreparedQueryObject(); + /**Deleting attributes table**/ + querySB = new StringBuilder(); + queryObject = new PreparedQueryObject(); + querySB.append("DELETE FROM ").append(musicKeySpace) + .append(".").append(getTableName(false)).append(" WHERE ").append(MusicProperties.PRIMARY_ID) + .append(" in ").append(sessionIDListCondition); + queryObject.appendQueryString(querySB.toString()); + try{ + if (isAtomicPut) + result = MusicCore.atomicPut(musicKeySpace, null, null, queryObject, null); + else + result = MusicCore.eventualPut(queryObject); + }catch(Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, "Error while cleaning up music attributes tables" , e); + } + logger.debug(EELFLoggerDelegate.debugLogger, "Music sessions have been cleaned up !"); + + /**Deleting meta table**/ + logger.debug(EELFLoggerDelegate.debugLogger, "Cleaning up meta table ..."); + querySB = new StringBuilder(); + queryObject = new PreparedQueryObject(); + querySB.append("DELETE FROM ").append(musicKeySpace) + .append(".").append(getTableName(true)).append(" WHERE ").append(MusicProperties.PRIMARY_ID) + .append(" in ").append(sessionIDListCondition); + queryObject.appendQueryString(querySB.toString()); + try{ + if (isAtomicPut) + result = MusicCore.atomicPut(musicKeySpace, null, null, queryObject, null); + else + result = MusicCore.eventualPut(queryObject); + }catch(Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, "Error while cleaning up music meta tables" , e); + } + + logger.debug(EELFLoggerDelegate.debugLogger, "Cleaned up attributes table ... "); + }else{ + logger.debug(EELFLoggerDelegate.debugLogger, "No Session needs to be cleaned up"); + } + + } + } } diff --git a/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/util/MusicCleanUp.java b/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/util/MusicCleanUp.java new file mode 100644 index 00000000..aab04eaf --- /dev/null +++ b/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/util/MusicCleanUp.java @@ -0,0 +1,62 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + *. + */ + +package org.onap.portalapp.music.util; + +import java.util.Date; + +public class MusicCleanUp { + private static volatile MusicCleanUp musicCleanUp = new MusicCleanUp(); + // private constructor restricted to this class itself + private MusicCleanUp(){ + } + + private Date lastCleanUpTime = new Date(); + + public static MusicCleanUp getInstance(){ + return musicCleanUp; + } + + public Date getLastCleanUpTime(){ + return lastCleanUpTime; + } + + public synchronized void updateLastCleanUpTimeToCurrent() { + lastCleanUpTime = new Date(); + } +} diff --git a/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/util/MusicProperties.java b/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/util/MusicProperties.java index bdc9c543..802634b6 100644 --- a/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/util/MusicProperties.java +++ b/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/util/MusicProperties.java @@ -93,6 +93,12 @@ public class MusicProperties { public static final String MUSIC_ATOMIC_POST = "music.atomic.post"; + public static final String MUSIC_EXCLUDE_API = "music.exclude.api"; + + public static final String MUSIC_CLEAN_UP_FREQUENCY = "music.cleanup.frequency"; + + public static final String MUSIC_CLEAN_UP_THRESHOLD = "music.cleanup.threshold"; + public static final String SESSION_MAX_INACTIVE_INTERVAL_SECONDS = "music.session.max.inactive.interval.seconds"; public static final String ATTRIBUTE_NAME = "ATTRIBUTE_NAME"; diff --git a/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/util/MusicUtil.java b/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/util/MusicUtil.java index 2744796e..ff1edb74 100644 --- a/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/util/MusicUtil.java +++ b/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/util/MusicUtil.java @@ -46,6 +46,7 @@ import java.nio.ByteBuffer; import java.time.Duration; import java.time.Instant; import java.util.Arrays; +import java.util.Date; import java.util.HashSet; import java.util.Set; import java.util.zip.GZIPInputStream; @@ -64,6 +65,7 @@ public class MusicUtil { private static String atomicPut = MusicProperties.getProperty(MusicProperties.MUSIC_ATOMIC_PUT); private static String atomicGet = MusicProperties.getProperty(MusicProperties.MUSIC_ATOMIC_GET); private static String cached = MusicProperties.getProperty(MusicProperties.MUSIC_CACHE); + private static String cleanUpFreq = MusicProperties.getProperty(MusicProperties.MUSIC_CLEAN_UP_FREQUENCY); private static String musicSerializeCompress = MusicProperties.getProperty(MusicProperties.MUSIC_SERIALIZE_COMPRESS); public static boolean isSessionMetaAttr(String key){ return sessionAttrNameSet.contains(key); @@ -127,6 +129,23 @@ public class MusicUtil { musicSession.setMaxInactiveInterval(Duration.parse(row.getString("max_inactive_interval"))); return musicSession; } + + public static Set getMusicExcludedAPI(){ + Set excludedApiSet = new HashSet<>(); + String musicExcludedApi = MusicProperties.getProperty(MusicProperties.MUSIC_EXCLUDE_API); + String[] musicExcludedApiArray = musicExcludedApi.split(","); + if(musicExcludedApiArray.length>0){ + for(String str : musicExcludedApiArray){ + excludedApiSet.add(str.trim()); + } + } + return excludedApiSet; + } + + public static boolean isExcludedApi(String api){ + Set excludedApiSet = getMusicExcludedAPI(); + return excludedApiSet.contains(api); + } public static boolean isMusicSerializeCompress(){ if(musicSerializeCompress==null){ @@ -159,4 +178,25 @@ public class MusicUtil { } return cached.trim().equalsIgnoreCase("true"); } + + public static int convertHoursToMillSec(int hour){ + return hour*3600000; + } + + public static boolean cleanUp(){ + Date lastCleanUpDate = MusicCleanUp.getInstance().getLastCleanUpTime(); + if(lastCleanUpDate==null) + return false; + else{ + int cleanUpDurationMili = convertHoursToMillSec(Integer.valueOf(cleanUpFreq)); + Date currentTime = new Date(); + long diffInMillies = Math.abs(currentTime.getTime() - lastCleanUpDate.getTime()); + if(diffInMillies > cleanUpDurationMili){ + MusicCleanUp.getInstance().updateLastCleanUpTimeToCurrent(); + return true; + } + else + return false; + } + } } diff --git a/ecomp-sdk/epsdk-workflow/pom.xml b/ecomp-sdk/epsdk-workflow/pom.xml index 0a817850..eaac5a44 100644 --- a/ecomp-sdk/epsdk-workflow/pom.xml +++ b/ecomp-sdk/epsdk-workflow/pom.xml @@ -5,7 +5,7 @@ org.onap.portal.sdk epsdk-project - 2.2.0-SNAPSHOT + 2.4.0-SNAPSHOT diff --git a/ecomp-sdk/epsdk-workflow/src/test/java/org/onap/portalsdk/workflow/models/WorkflowTest.java b/ecomp-sdk/epsdk-workflow/src/test/java/org/onap/portalsdk/workflow/models/WorkflowTest.java index 414007f7..53896038 100644 --- a/ecomp-sdk/epsdk-workflow/src/test/java/org/onap/portalsdk/workflow/models/WorkflowTest.java +++ b/ecomp-sdk/epsdk-workflow/src/test/java/org/onap/portalsdk/workflow/models/WorkflowTest.java @@ -37,10 +37,10 @@ */ package org.onap.portalsdk.workflow.models; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import org.junit.Test; -import org.onap.portalsdk.core.domain.support.NameValueId; public class WorkflowTest { diff --git a/ecomp-sdk/pom.xml b/ecomp-sdk/pom.xml index e3db8a97..8acbdac6 100644 --- a/ecomp-sdk/pom.xml +++ b/ecomp-sdk/pom.xml @@ -14,7 +14,7 @@ org.onap.portal.sdk epsdk-project - 2.2.0-SNAPSHOT + 2.4.0-SNAPSHOT pom portal-sdk https://wiki.onap.org/display/DW/Portal @@ -23,6 +23,8 @@ epsdk-fw epsdk-core epsdk-analytics + epsdk-domain + epsdk-aaf epsdk-music epsdk-workflow epsdk-app-common