summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain')
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AdminUserApp.java88
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AdminUserApplications.java96
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/App.java62
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AppContactUs.java86
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AppIdAndNameTransportModel.java63
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AppsResponse.java76
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/BEProperty.java43
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/BasicAuthCredentials.java95
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPApp.java292
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPEndpoint.java37
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPEndpointAccount.java46
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPRole.java202
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUser.java650
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserApp.java119
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppCatalogRoles.java92
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppRolesRequest.java87
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppRolesRequestDetail.java52
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppsManualSortPreference.java50
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppsSortPreference.java44
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserNotification.java57
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPWidgetsManualSortPreference.java70
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompApp.java146
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompAppRole.java80
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompAppRoleId.java83
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompAuditLog.java61
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EpUserAppRoles.java63
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/ExternalSystemAccess.java49
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/FunctionalMenuItemWithAppID.java96
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/GetAccessResult.java114
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/GetAccessResultId.java64
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/MicroserviceData.java146
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/MicroserviceParameter.java82
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/PersUserAppSelection.java78
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/PersUserWidgetSelection.java81
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/RoleApp.java114
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/SharedContext.java161
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/UserIdRoleId.java77
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/UserRole.java91
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/UserRoles.java113
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/Widget.java105
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetCatalog.java109
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetCatalogParameter.java90
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetParameterResult.java70
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetServiceHeaders.java54
44 files changed, 4534 insertions, 0 deletions
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AdminUserApp.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AdminUserApp.java
new file mode 100644
index 00000000..ecf0b684
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AdminUserApp.java
@@ -0,0 +1,88 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class AdminUserApp implements Serializable{
+ private static final long serialVersionUID = 1L;
+
+ @Id
+ @Column(name="USER_ID")
+ private Long user_Id;
+
+ @Column(name="FIRST_NAME")
+ private String firstName;
+
+ @Column(name="LAST_NAME")
+ private String lastName;
+
+ @Column(name="ORG_USER_ID")
+ private String orgUserId;
+
+ @Id
+ @Column(name="APP_ID")
+ private Long appId;
+
+ @Column(name="APP_NAME")
+ private String appName;
+
+ public Long getAppId() {
+ return appId;
+ }
+ public void setAppId(Long appId) {
+ this.appId = appId;
+ }
+ public Long getUser_Id() {
+ return user_Id;
+ }
+ public void setUserId(Long user_Id) {
+ this.user_Id = user_Id;
+ }
+ public String getFirstName() {
+ return firstName;
+ }
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+ public String getLastName() {
+ return lastName;
+ }
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+ public String getOrgUserId() {
+ return orgUserId;
+ }
+ public void setOrgUserId(String orgUserId) {
+ this.orgUserId = orgUserId;
+ }
+ public String getAppName() {
+ return appName;
+ }
+ public void setAppName(String appName) {
+ this.appName = appName;
+ }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AdminUserApplications.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AdminUserApplications.java
new file mode 100644
index 00000000..c90be671
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AdminUserApplications.java
@@ -0,0 +1,96 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class AdminUserApplications {
+ private List<Application> apps = new ArrayList<Application>();
+
+ private Long user_Id;
+ private String firstName;
+ private String lastName;
+ private String orgUserId;
+
+ public AdminUserApplications(AdminUserApp app) {
+ setUser_Id(app.getUser_Id());
+ setOrgUserId(app.getOrgUserId());
+ setFirstName(app.getFirstName());
+ setLastName(app.getLastName());
+
+ addApp(app.getAppId(), app.getAppName());
+ }
+ public Long getUser_Id() {
+ return user_Id;
+ }
+ public void setUser_Id(Long user_Id) {
+ this.user_Id = user_Id;
+ }
+ public String getFirstName() {
+ return firstName;
+ }
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+ public String getLastName() {
+ return lastName;
+ }
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+ public String getOrgUserId() {
+ return orgUserId;
+ }
+ public void setOrgUserId(String orgUserId) {
+ this.orgUserId = orgUserId;
+ }
+ public List<Application> getApps() {
+ return apps;
+ }
+ public void setApps(List<Application> apps) {
+ this.apps = apps;
+ }
+ public void addApp(Long otherAppId, String otherAppName) {
+ apps.add(new Application(otherAppId, otherAppName));
+ }
+
+ public class Application {
+ private Long appId;
+ private String appName;
+
+ public Application(Long otherAppId, String otherAppName) {
+ setAppId(otherAppId);
+ setAppName(otherAppName);
+ }
+ public Long getAppId() {
+ return appId;
+ }
+ public void setAppId(Long appId) {
+ this.appId = appId;
+ }
+ public String getAppName() {
+ return appName;
+ }
+ public void setAppName(String appName) {
+ this.appName = appName;
+ }
+ }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/App.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/App.java
new file mode 100644
index 00000000..21068513
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/App.java
@@ -0,0 +1,62 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+
+//@Entity
+//@Table(name = "FN_APP")
+public class App implements Serializable{
+
+ private static final long serialVersionUID = 1L;
+
+ //@Id
+ //@Column(name = "APP_ID")
+ //@GeneratedValue(strategy=GenerationType.AUTO)
+ private Long appId;
+
+ //@Column(name = "APP_Name")
+ private String appName;
+
+ public Long getAppId() {
+ return appId;
+ }
+
+ public void setAppId(Long appId) {
+ this.appId = appId;
+ }
+
+ public String getAppName() {
+ return appName;
+ }
+
+ public void setAppName(String appName) {
+ this.appName = appName;
+ }
+
+
+
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AppContactUs.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AppContactUs.java
new file mode 100644
index 00000000..d399c825
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AppContactUs.java
@@ -0,0 +1,86 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+/**
+ * Models rows in the fn_app_contact_us table added for 1610.1.
+ */
+public class AppContactUs extends DomainVo {
+
+ private static final long serialVersionUID = -2742197830465055134L;
+
+ private EPApp app;
+ private String description;
+ private String contactEmail;
+ private String contactName;
+ private String url;
+ private String activeYN;
+
+ public EPApp getApp() {
+ return app;
+ }
+
+ public void setApp(EPApp app) {
+ this.app = app;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getContactEmail() {
+ return contactEmail;
+ }
+
+ public void setContactEmail(String contactEmail) {
+ this.contactEmail = contactEmail;
+ }
+
+ public String getContactName() {
+ return contactName;
+ }
+
+ public void setContactName(String contactName) {
+ this.contactName = contactName;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public String getActiveYN() {
+ return activeYN;
+ }
+
+ public void setActiveYN(String activeYN) {
+ this.activeYN = activeYN;
+ }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AppIdAndNameTransportModel.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AppIdAndNameTransportModel.java
new file mode 100644
index 00000000..1440973e
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AppIdAndNameTransportModel.java
@@ -0,0 +1,63 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class AppIdAndNameTransportModel implements Serializable{
+ private static final long serialVersionUID = 1L;
+
+ @Id
+ @Column(name="APP_ID")
+ private Long id;
+
+ @Column(name="APP_NAME")
+ private String name;
+
+ @Column(name="APP_TYPE")
+ private Integer appType;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Boolean isRestrictedApp() {
+ return (this.appType == 2 ? true : false);
+ }
+
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AppsResponse.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AppsResponse.java
new file mode 100644
index 00000000..4935a22c
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AppsResponse.java
@@ -0,0 +1,76 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+public class AppsResponse {
+
+ public AppsResponse(Long id, String name, Boolean restrictedApp, Boolean enabled) {
+ this.index = id;
+ this.title = this.value = name;
+ this.restrictedApp = restrictedApp;
+ this.enabled = enabled;
+ }
+
+ public Long getIndex() {
+ return index;
+ }
+
+ public void setIndex(Long index) {
+ this.index = index;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ // Hide the implementation of restricted and normal app from the front end.
+ // The json sent and received will include restrictedApp but not appType.
+
+ public void setRestrictedApp(Boolean restrictedApp) {
+ this.restrictedApp = restrictedApp;
+ }
+
+ public Boolean getEnabled() {
+ return enabled;
+ }
+
+ public void setEnabled(Boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ private Long index;
+ private String title;
+ private String value;
+ public Boolean restrictedApp;
+ public Boolean enabled;
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/BEProperty.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/BEProperty.java
new file mode 100644
index 00000000..e877641b
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/BEProperty.java
@@ -0,0 +1,43 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+public class BEProperty {
+ private String key;
+ private String value;
+
+ public BEProperty(String key, String value){
+ this.key = key;
+ this.value = value;
+ }
+
+ public String getKey() {
+ return key;
+ }
+ public void setKey(String key) {
+ this.key = key;
+ }
+ public String getValue() {
+ return value;
+ }
+ public void setValue(String value) {
+ this.value = value;
+ }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/BasicAuthCredentials.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/BasicAuthCredentials.java
new file mode 100644
index 00000000..359945ce
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/BasicAuthCredentials.java
@@ -0,0 +1,95 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import java.util.List;
+
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+public class BasicAuthCredentials extends DomainVo {
+
+ private static final long serialVersionUID = 1L;
+
+ public BasicAuthCredentials() {
+
+ }
+
+ private Long id;
+ private String applicationName;
+ private String username;
+ private String password;
+ private String isActive;
+ private List<EPEndpoint> endpoints;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getApplicationName() {
+ return applicationName;
+ }
+
+ public void setApplicationName(String applicationName) {
+ this.applicationName = applicationName;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public String getIsActive() {
+ return isActive;
+ }
+
+ public void setIsActive(String isActive) {
+ this.isActive = isActive;
+ }
+
+ public List<EPEndpoint> getEndpoints() {
+ return endpoints;
+ }
+
+ public void setEndpoints(List<EPEndpoint> endpoints) {
+ this.endpoints = endpoints;
+ }
+
+ @Override
+ public String toString() {
+ return "BasicAuthCredentials [id=" + id + ", applicationName=" + applicationName + ", username=" + username
+ + ", password=" + password + ", isActive=" + isActive + "]";
+ }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPApp.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPApp.java
new file mode 100644
index 00000000..1ba9e2d7
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPApp.java
@@ -0,0 +1,292 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import javax.persistence.Lob;
+
+import org.apache.commons.lang.StringUtils;
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+/**
+ * Model for all columns in the fn_app table.
+ */
+public class EPApp extends DomainVo {
+
+ private static final long serialVersionUID = 1L;
+
+ private String name;
+ private String imageUrl;
+ private String description;
+ private String notes;
+ private String url;
+ private String alternateUrl;
+ private String appRestEndpoint;
+ private String mlAppName;
+ private String mlAppAdminId;
+ private Long motsId;
+ private String username;
+ private String appPassword;
+ @Lob
+ private byte[] thumbnail;
+ private Boolean open;
+ private Boolean enabled;
+ private String uebTopicName;
+ private String uebKey;
+ private String uebSecret;
+ private Integer appType;
+
+ private AppContactUs contactUs;
+
+ public EPApp() {
+ // Attention!!!
+ // We set here all default values. We also place protection
+ // into setters for fields with default values.
+ // If we don't use such protection we are able to place null
+ // to these fields and save such fields into DB even if DB has
+ // default values for these fields.
+ this.name = "";
+ this.mlAppName = "";
+ this.mlAppAdminId = "";
+ this.username = "";
+ this.appPassword = "";
+ this.open = new Boolean(false);
+ this.enabled = new Boolean(true);
+ this.uebTopicName = "";
+ this.uebKey = "";
+ this.uebSecret = "";
+ this.appType = 1;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ if (StringUtils.isEmpty(name)) {
+ name = "";
+ }
+ this.name = name;
+ }
+
+ public String getImageUrl() {
+ return imageUrl;
+ }
+
+ public void setImageUrl(String imageUrl) {
+ this.imageUrl = imageUrl;
+ }
+
+ public byte[] getThumbnail() {
+ return this.thumbnail;
+ }
+
+ public void setThumbnail(byte[] thumbnail) {
+ this.thumbnail = thumbnail;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getNotes() {
+ return notes;
+ }
+
+ public void setNotes(String notes) {
+ this.notes = notes;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public String getAlternateUrl() {
+ return alternateUrl;
+ }
+
+ public void setAlternateUrl(String alternateUrl) {
+ this.alternateUrl = alternateUrl;
+ }
+
+ public String getAppRestEndpoint() {
+ return appRestEndpoint;
+ }
+
+ public void setAppRestEndpoint(String appRestEndpoint) {
+ this.appRestEndpoint = appRestEndpoint;
+ }
+
+ public String getMlAppName() {
+ return mlAppName;
+ }
+
+ public void setMlAppName(String mlAppName) {
+ if (StringUtils.isEmpty(mlAppName)) {
+ mlAppName = "";
+ }
+ this.mlAppName = mlAppName;
+ }
+
+ public String getMlAppAdminId() {
+ return mlAppAdminId;
+ }
+
+ public void setMlAppAdminId(String mlAppAdminId) {
+ if (StringUtils.isEmpty(mlAppAdminId)) {
+ mlAppAdminId = "";
+ }
+ this.mlAppAdminId = mlAppAdminId;
+ }
+
+ public Long getMotsId() {
+ return motsId;
+ }
+
+ public void setMotsId(Long motsId) {
+ this.motsId = motsId;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getAppPassword() {
+ return appPassword;
+ }
+
+ public void setAppPassword(String appPassword) {
+ if (StringUtils.isEmpty(appPassword)) {
+ appPassword = "";
+ }
+ this.appPassword = appPassword;
+ }
+
+ public Boolean getOpen() {
+ return open;
+ }
+
+ public void setOpen(Boolean open) {
+ if (open == null) {
+ open = new Boolean(false);
+ }
+ this.open = open;
+ }
+
+ public Boolean getEnabled() {
+ return enabled;
+ }
+
+ public void setEnabled(Boolean enabled) {
+ if (enabled == null) {
+ enabled = new Boolean(true);
+ }
+ this.enabled = enabled;
+ }
+
+ public Integer getAppType() {
+ return appType;
+ }
+
+ public void setAppType(Integer appType) {
+ if (appType == null) {
+ appType = new Integer(1);
+ }
+ this.appType = appType;
+ }
+
+ public void setRestrictedApp(Boolean restrictedApp) {
+ Integer result = 1;
+ if (restrictedApp) {
+ result = 2;
+ }
+ this.appType = result;
+ }
+
+ public Boolean isRestrictedApp() {
+ return (this.appType == 2 ? true : false);
+ }
+
+ public int compareTo(Object obj) {
+ Long c1 = getId();
+ Long c2 = ((EPApp) obj).getId();
+
+ return c1.compareTo(c2);
+ }
+
+ public String getUebTopicName() {
+ return this.uebTopicName;
+ }
+
+ public void setUebTopicName(String topicName) {
+ if (StringUtils.isEmpty(topicName)) {
+ this.uebTopicName = "";
+ }
+ this.uebTopicName = topicName;
+ }
+
+ public String getUebKey() {
+ return this.uebKey;
+ }
+
+ public void setUebKey(String uebKey) {
+ if (StringUtils.isEmpty(uebKey)) {
+ this.uebKey = "";
+ }
+ this.uebKey = uebKey;
+ }
+
+ public String getUebSecret() {
+ return this.uebSecret;
+ }
+
+ public void setUebSecret(String uebSecret) {
+ if (StringUtils.isEmpty(uebSecret)) {
+ this.uebSecret = "";
+ }
+ this.uebSecret = uebSecret;
+ }
+
+ public AppContactUs getContactUs() {
+ return contactUs;
+ }
+
+ public void setContactUs(AppContactUs contactUs) {
+ this.contactUs = contactUs;
+ }
+
+ @Override
+ public String toString() {
+ String str = "[" + getId() + ":" + getName() + "]";
+ return str;
+ }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPEndpoint.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPEndpoint.java
new file mode 100644
index 00000000..85e390e6
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPEndpoint.java
@@ -0,0 +1,37 @@
+package org.openecomp.portalapp.portal.domain;
+
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+public class EPEndpoint extends DomainVo {
+
+ private static final long serialVersionUID = 1L;
+
+ public EPEndpoint() {
+
+ }
+
+ private Long id;
+ private String name;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String toString() {
+ return "EPEndpoint [id=" + id + ", name=" + name + "]";
+ }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPEndpointAccount.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPEndpointAccount.java
new file mode 100644
index 00000000..3d7dbd1f
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPEndpointAccount.java
@@ -0,0 +1,46 @@
+package org.openecomp.portalapp.portal.domain;
+
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+public class EPEndpointAccount extends DomainVo {
+
+ private static final long serialVersionUID = 1L;
+
+ public EPEndpointAccount() {
+
+ }
+
+ private Long id;
+ private Long ep_id;
+ private Long account_id;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Long getEp_id() {
+ return ep_id;
+ }
+
+ public void setEp_id(Long ep_id) {
+ this.ep_id = ep_id;
+ }
+
+ public Long getAccount_id() {
+ return account_id;
+ }
+
+ public void setAccount_id(Long account_id) {
+ this.account_id = account_id;
+ }
+
+ @Override
+ public String toString() {
+ return "EPEndpointAccount [id=" + id + ", ep_id=" + ep_id + ", account_id=" + account_id + "]";
+ }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPRole.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPRole.java
new file mode 100644
index 00000000..ea70982a
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPRole.java
@@ -0,0 +1,202 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import java.util.Iterator;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import org.openecomp.portalsdk.core.domain.RoleFunction;
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public class EPRole extends DomainVo {
+
+ private static final long serialVersionUID = 1L;
+ private String name;
+ private boolean active;
+ private Integer priority;
+
+ // ECOMP will identify the specific remote application role id by appID;appRoleId among all the application roles it persists.
+ private Long appId; // used by ECOMP only
+ private Long appRoleId; // used by ECOMP only
+
+ private SortedSet<RoleFunction> roleFunctions = new TreeSet<RoleFunction>();
+
+ private SortedSet<EPRole> childRoles = new TreeSet<EPRole>();
+
+ @JsonIgnore
+ private SortedSet<EPRole> parentRoles = new TreeSet<EPRole>();
+
+ public EPRole() {}
+
+ public String getName() {
+ return name;
+ }
+
+ public boolean getActive() {
+ return active;
+ }
+
+ public SortedSet<RoleFunction> getRoleFunctions() {
+ return roleFunctions;
+ }
+
+ public Integer getPriority() {
+ return priority;
+ }
+
+ public SortedSet<EPRole> getChildRoles() {
+ return childRoles;
+ }
+
+ public SortedSet<EPRole> getParentRoles() {
+ return parentRoles;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setActive(boolean active) {
+ this.active = active;
+ }
+
+ public void setRoleFunctions(SortedSet<RoleFunction> roleFunctions) {
+ this.roleFunctions = roleFunctions;
+ }
+
+ public void setPriority(Integer priority) {
+ this.priority = priority;
+ }
+
+ public void setChildRoles(SortedSet<EPRole> childRoles) {
+ this.childRoles = childRoles;
+ }
+
+ public void setParentRoles(SortedSet<EPRole> parentRoles) {
+ this.parentRoles = parentRoles;
+ }
+
+ public void addRoleFunction(RoleFunction roleFunction) {
+ this.roleFunctions.add(roleFunction);
+ }
+
+ public void addChildRole(EPRole role) {
+ this.childRoles.add(role);
+ }
+
+ public void addParentRole(EPRole role) {
+ this.parentRoles.add(role);
+ }
+
+ public String getEditUrl() {
+ return "/role.htm?role_id=" + getId();
+ }
+
+ public String getToggleActiveImage() {
+ return "/static/fusion/images/" + (getActive() ? "active.png" : "inactive.png" );
+ }
+
+ public String getToggleActiveAltText() {
+ return getActive() ? "Click to Deactivate Role" : "Click to Activate Role";
+ }
+
+ public void removeChildRole(Long roleId) {
+ Iterator<EPRole> i = this.childRoles.iterator();
+
+ while (i.hasNext()) {
+ EPRole childRole = (EPRole)i.next();
+ if (childRole.getId().equals(roleId)) {
+ this.childRoles.remove(childRole);
+ break;
+ }
+ }
+ }
+
+ public void removeParentRole(Long roleId) {
+ Iterator<EPRole> i = this.parentRoles.iterator();
+
+ while (i.hasNext()) {
+ EPRole parentRole = (EPRole)i.next();
+ if (parentRole.getId().equals(roleId)) {
+ this.parentRoles.remove(parentRole);
+ break;
+ }
+ }
+ }
+
+ public void removeRoleFunction(String roleFunctionCd) {
+ Iterator<RoleFunction> i = this.roleFunctions.iterator();
+
+ while (i.hasNext()) {
+ RoleFunction roleFunction = (RoleFunction)i.next();
+ if (roleFunction.getCode().equals(roleFunctionCd)) {
+ this.roleFunctions.remove(roleFunction);
+ break;
+ }
+ }
+ }
+
+ public int compareTo(Object obj){
+ EPRole other = (EPRole)obj;
+
+ if(this.appId == null)
+ if(other.getAppId() == null)
+ return compareByName(other); //equal
+ else
+ return -1;
+ else // this.appId != null
+ if(other.getAppId() == null)
+ return 1; // appId != null, but others is null
+ else{
+ int appIdCompareResult = appId.compareTo(other.getAppId());
+ return appIdCompareResult == 0? compareByName(other) : appIdCompareResult;
+ }
+ }
+
+ private int compareByName(EPRole other) {
+ String c1 = getName();
+ String c2 = other.getName();
+
+ return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
+ }
+
+ public Long getAppId() {
+ return appId;
+ }
+
+ public void setAppId(Long appId) {
+ this.appId = appId;
+ }
+
+ public Long getAppRoleId() {
+ return appRoleId;
+ }
+
+ public void setAppRoleId(Long appRoleId) {
+ this.appRoleId = appRoleId;
+ }
+
+ @Override
+ public String toString() {
+ return "[Id = " + id + ", name = " + name + "]";
+ }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUser.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUser.java
new file mode 100644
index 00000000..3a52ffc3
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUser.java
@@ -0,0 +1,650 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import java.util.Date;
+import java.util.Iterator;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import org.openecomp.portalapp.portal.utils.PortalConstants;
+import org.openecomp.portalsdk.core.domain.User;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public class EPUser extends User {
+
+ private Long orgId;
+ private Long managerId;
+ private String firstName;
+ private String middleInitial;
+ private String lastName;
+ private String phone;
+ private String fax;
+ private String cellular;
+ private String email;
+ private Long addressId;
+ private String alertMethodCd;
+ private String hrid;
+ private String orgUserId;
+ private String orgCode;
+ private String address1;
+ private String address2;
+ private String city;
+ private String state;
+ private String zipCode;
+ private String country;
+ private String orgManagerUserId;
+ private String locationClli;
+ private String businessCountryCode;
+ private String businessCountryName;
+ private String businessUnit;
+ private String businessUnitName;
+ private String department;
+ private String departmentName;
+ private String companyCode;
+ private String company;
+ private String zipCodeSuffix;
+ private String jobTitle;
+ private String commandChain;
+ private String siloStatus;
+ private String costCenter;
+ private String financialLocCode;
+
+
+
+ private String loginId;
+ private String loginPwd;
+ private Date lastLoginDate;
+ private boolean active;
+ private boolean internal;
+ private Long selectedProfileId;
+ private Long timeZoneId;
+ private boolean online;
+ private String chatId;
+
+ private static final long serialVersionUID = 1L;
+
+ private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPUser.class);
+ private static final String ECOMP_PORTAL_NAME = "ECOMP";
+ private boolean isGuest = false;
+
+ private SortedSet<EPUserApp> userApps = new TreeSet<EPUserApp>();
+ private SortedSet<EPRole> pseudoRoles = new TreeSet<EPRole>();
+
+ public EPUser() {}
+
+ public Long getAddressId() {
+ return addressId;
+ }
+
+ public String getAlertMethodCd() {
+ return alertMethodCd;
+ }
+
+ public String getCellular() {
+ return cellular;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public String getFax() {
+ return fax;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public String getHrid() {
+ return hrid;
+ }
+
+ public Date getLastLoginDate() {
+ return lastLoginDate;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ @JsonIgnore
+ public String getFullName() {
+ return getFirstName() + " " + getLastName();
+ }
+
+ public String getLoginId() {
+ return loginId;
+ }
+
+ public String getLoginPwd() {
+ return loginPwd;
+ }
+
+ public Long getManagerId() {
+ return managerId;
+ }
+
+ public String getMiddleInitial() {
+ return middleInitial;
+ }
+
+ public String getOrgCode() {
+ return orgCode;
+ }
+
+ public Long getOrgId() {
+ return orgId;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public String getOrgUserId() {
+ return orgUserId;
+ }
+
+ public boolean getActive() {
+ return active;
+ }
+
+ public boolean getInternal() {
+ return internal;
+ }
+
+ public String getAddress1() {
+ return address1;
+ }
+
+ public String getAddress2() {
+ return address2;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public String getCountry() {
+ return country;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public String getZipCode() {
+ return zipCode;
+ }
+
+ public String getBusinessCountryCode() {
+ return businessCountryCode;
+ }
+
+ public String getCommandChain() {
+ return commandChain;
+ }
+
+ public String getCompany() {
+ return company;
+ }
+
+ public String getCompanyCode() {
+ return companyCode;
+ }
+
+ public String getDepartment() {
+ return department;
+ }
+
+ public String getJobTitle() {
+ return jobTitle;
+ }
+
+ public String getLocationClli() {
+ return locationClli;
+ }
+
+ public String getOrgManagerUserId() {
+ return orgManagerUserId;
+ }
+
+ public String getZipCodeSuffix() {
+ return zipCodeSuffix;
+ }
+
+ public String getBusinessCountryName() {
+ return businessCountryName;
+ }
+
+ public Long getSelectedProfileId() {
+ return selectedProfileId;
+ }
+
+ public void setAddressId(Long addressId) {
+ this.addressId = addressId;
+ }
+
+ public void setAlertMethodCd(String alertMethodCd) {
+ this.alertMethodCd = alertMethodCd;
+ }
+
+ public void setCellular(String cellular) {
+ this.cellular = cellular;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public void setFax(String fax) {
+ this.fax = fax;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public void setHrid(String hrid) {
+ this.hrid = hrid;
+ }
+
+ public void setLastLoginDate(Date lastLoginDate) {
+ this.lastLoginDate = lastLoginDate;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ public void setLoginId(String loginId) {
+ this.loginId = loginId;
+ }
+
+ public void setLoginPwd(String loginPwd) {
+ this.loginPwd = loginPwd;
+ }
+
+ public void setManagerId(Long managerId) {
+ this.managerId = managerId;
+ }
+
+ public void setMiddleInitial(String middleInitial) {
+ this.middleInitial = middleInitial;
+ }
+
+ public void setOrgCode(String orgCode) {
+ this.orgCode = orgCode;
+ }
+
+ public void setOrgId(Long orgId) {
+ this.orgId = orgId;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public void setOrgUserId(String orgUserId) {
+ this.orgUserId = orgUserId;
+ }
+
+ public void setActive(boolean active) {
+ this.active = active;
+ }
+
+ public void setInternal(boolean internal) {
+ this.internal = internal;
+ }
+
+ public void setAddress1(String address1) {
+ this.address1 = address1;
+ }
+
+ public void setAddress2(String address2) {
+ this.address2 = address2;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ public void setZipCode(String zipCode) {
+ this.zipCode = zipCode;
+ }
+
+ public void setBusinessCountryCode(String businessCountryCode) {
+ this.businessCountryCode = businessCountryCode;
+ }
+
+ public void setCommandChain(String commandChain) {
+ this.commandChain = commandChain;
+ }
+
+ public void setCompany(String company) {
+ this.company = company;
+ }
+
+ public void setCompanyCode(String companyCode) {
+ this.companyCode = companyCode;
+ }
+
+ public void setDepartment(String department) {
+ this.department = department;
+ }
+
+ public void setJobTitle(String jobTitle) {
+ this.jobTitle = jobTitle;
+ }
+
+ public void setLocationClli(String locationClli) {
+ this.locationClli = locationClli;
+ }
+
+ public void setOrgManagerUserId(String orgManagerUserId) {
+ this.orgManagerUserId = orgManagerUserId;
+ }
+
+ public void setZipCodeSuffix(String zipCodeSuffix) {
+ this.zipCodeSuffix = zipCodeSuffix;
+ }
+
+ public void setBusinessCountryName(String businessCountryName) {
+ this.businessCountryName = businessCountryName;
+ }
+
+ public SortedSet<EPRole> getPseudoRoles() {
+ return pseudoRoles;
+ }
+
+ public void setPseudoRoles(SortedSet<EPRole> pseudoRoles) {
+ this.pseudoRoles = pseudoRoles;
+ }
+
+ public void setSelectedProfileId(Long selectedProfileId) {
+ this.selectedProfileId = selectedProfileId;
+ }
+
+ public Long getTimeZoneId() {
+ return timeZoneId;
+ }
+
+ public void setTimeZoneId(Long timeZoneId) {
+ this.timeZoneId = timeZoneId;
+ }
+
+ public String getBusinessUnit() {
+ return businessUnit;
+ }
+
+ public void setBusinessUnit(String businessUnit) {
+ this.businessUnit = businessUnit;
+ }
+
+ public String getSiloStatus() {
+ return siloStatus;
+ }
+
+ public void setSiloStatus(String siloStatus) {
+ this.siloStatus = siloStatus;
+ }
+
+ public String getCostCenter() {
+ return costCenter;
+ }
+
+ public void setCostCenter(String costCenter) {
+ this.costCenter = costCenter;
+ }
+
+ public String getFinancialLocCode() {
+ return financialLocCode;
+ }
+
+ public void setFinancialLocCode(String financialLocCode) {
+ this.financialLocCode = financialLocCode;
+ }
+
+ public String getBusinessUnitName() {
+ return businessUnitName;
+ }
+
+ public void setBusinessUnitName(String businessUnitName) {
+ this.businessUnitName = businessUnitName;
+ }
+
+ public String getDepartmentName() {
+ return departmentName;
+ }
+
+ public void setDepartmentName(String departmentName) {
+ this.departmentName = departmentName;
+ }
+
+ public int compareTo(Object obj){
+ EPUser user = (EPUser)obj;
+
+ String c1 = getLastName() + getFirstName() + getMiddleInitial();
+ String c2 = user.getLastName() + user.getFirstName() + user.getMiddleInitial();
+
+ return c1.compareTo(c2);
+ }
+
+ public boolean isOnline() {
+ return online;
+ }
+
+ public void setOnline(boolean online) {
+ this.online = online;
+ }
+
+ public String getChatId() {
+ return chatId;
+ }
+
+ public void setChatId(String chatId) {
+ this.chatId = chatId;
+ }
+
+
+ public void setPseudoEPRoles(SortedSet<EPRole> pseudoRoles) {
+ this.pseudoRoles = pseudoRoles;
+ }
+
+ public SortedSet<EPUserApp> getEPUserApps() {
+ return userApps;
+ }
+
+ public void setEPUserApps(SortedSet<EPUserApp> userApps) {
+ this.userApps = userApps;
+ }
+
+ public void addUserApp(EPUserApp userApp) {
+ userApps.add(userApp);
+ }
+
+ public void addAppRoles(EPApp app, SortedSet<EPRole> roles) {
+ if (roles != null) {
+ // add all
+ SortedSet<EPUserApp> userApps = new TreeSet<EPUserApp>();
+ // this.userApps.removeAll(this.userApps);
+ Iterator<EPRole> itr = roles.iterator();
+ while (itr.hasNext()) {
+ EPRole role = (EPRole) itr.next();
+ EPUserApp userApp = new EPUserApp();
+ userApp.setUserId(this.id);
+ userApp.setApp(app);
+ userApp.setRole(role);
+ userApps.add(userApp);
+ }
+ setEPUserApps(userApps);
+ } else {
+ // remove all
+ setEPUserApps(null);
+ }
+
+ }
+
+ public SortedSet<EPRole> getAppEPRoles(EPApp app) {
+
+ logger.debug(EELFLoggerDelegate.debugLogger, "In EPUser.getAppEPRoles() - app = {}", app.getName());
+
+ SortedSet<EPRole> roles = new TreeSet<EPRole>();
+ SortedSet<EPUserApp> userAppRoles = getEPUserApps();
+
+ logger.debug(EELFLoggerDelegate.debugLogger, "In EPUser.getAppEPRoles() - userApps = ", userAppRoles.size());
+
+ Iterator<EPUserApp> userAppRolesIterator = userAppRoles.iterator();
+ EPUserApp userAppRole = null;
+ // getting default app
+ while (userAppRolesIterator.hasNext()) {
+ EPUserApp tempUserApp = (EPUserApp) userAppRolesIterator.next();
+ if (tempUserApp.getApp().getId().equals(app.getId())) {
+
+ logger.debug(EELFLoggerDelegate.debugLogger, "In EPUser.getAppEPRoles() - for user {}, found application {}", this.getFullName(), app.getName());
+
+ userAppRole = tempUserApp;
+
+ EPRole role = userAppRole.getRole();
+ if(role.getActive()){
+ logger.debug(EELFLoggerDelegate.debugLogger, "In EPUser.getAppEPRoles() - Role {} is active - adding for user {} and app {}", role.getName(), this.getFullName(), app.getName());
+ roles.add((EPRole) role);
+ }
+ else{
+ logger.debug(EELFLoggerDelegate.debugLogger, "In EPUser.getAppEPRoles() - Role {} is NOT active - NOT adding for user {} and app {}", role.getName(), this.getFullName(), app.getName());
+ }
+ }
+ }
+ logger.debug(EELFLoggerDelegate.debugLogger, "In EPUser.getAppEPRoles() - roles = ", roles.size());
+
+ return roles;
+ }
+
+
+ /**
+ * Attention! Not for use in ECOMP
+ */
+ public SortedSet<EPRole> getAppRoles(EPApp app) {
+ SortedSet<EPRole> roles = new TreeSet<EPRole>();
+ SortedSet<EPUserApp> apps = getEPUserApps();
+ Iterator<EPUserApp> appsItr = apps.iterator();
+ EPUserApp userApp = null;
+ // getting default app
+ while (appsItr.hasNext()) {
+ EPUserApp tempUserApp = (EPUserApp) appsItr.next();
+ if (tempUserApp.getApp().getId().equals(app.getId())) {
+ userApp = tempUserApp;
+ roles.add((EPRole) userApp.getRole());
+ }
+ }
+ return roles;
+ }
+
+
+
+ /**
+ * Attention! Not for use in ECOMP
+ */
+ public SortedSet<EPRole> getEPRoles() {
+ EPApp app = new EPApp();
+ app.setId(new Long(PortalConstants.PORTAL_APP_ID));
+ app.setName(ECOMP_PORTAL_NAME);
+ return getAppEPRoles(app);
+ }
+
+ /**
+ * Attention! Not for use in ECOMP
+ */
+ public void setEPRoles(SortedSet<EPRole> roles) {
+ EPApp app = new EPApp();
+ app.setId(new Long(PortalConstants.PORTAL_APP_ID));
+ app.setName(ECOMP_PORTAL_NAME);
+ addAppRoles(app, roles);
+ }
+
+ /**
+ * Attention! Not for use in ECOMP
+ */
+ public void removeEPRole(Long roleId) {
+ SortedSet<EPUserApp> apps = getEPUserApps();
+ Iterator<EPUserApp> appsItr = apps.iterator();
+ // getting default app
+ while (appsItr.hasNext()) {
+ EPUserApp tempUserApp = (EPUserApp) appsItr.next();
+ if (tempUserApp.equals(new Long(PortalConstants.PORTAL_APP_ID)) && tempUserApp.getRole().getId().equals(roleId)) {
+ appsItr.remove();
+ }
+ }
+ }
+
+ /**
+ * Attention! Not for use in ECOMP
+ */
+ public void addEPRole(EPRole role) {
+ if (role != null) {
+ SortedSet<EPRole> roles = getEPRoles();
+ if (roles == null) {
+ roles = new TreeSet<EPRole>();
+ }
+ roles.add(role);
+ setEPRoles(roles);
+ }
+ }
+
+ public boolean isGuest() {
+ return isGuest;
+ }
+
+ public void setGuest(boolean isGuest) {
+ this.isGuest = isGuest;
+ }
+
+ @Override
+ public String toString() {
+ return "EPUser [orgId=" + orgId + ", managerId=" + managerId + ", firstName=" + firstName + ", middleInitial="
+ + middleInitial + ", lastName=" + lastName + ", phone=" + phone + ", fax=" + fax + ", cellular="
+ + cellular + ", email=" + email + ", addressId=" + addressId + ", alertMethodCd=" + alertMethodCd
+ + ", hrid=" + hrid + ", orgUserId=" + orgUserId + ", orgCode=" + orgCode + ", address1=" + address1
+ + ", address2=" + address2 + ", city=" + city + ", state=" + state + ", zipCode=" + zipCode
+ + ", country=" + country + ", orgManagerUserId=" + orgManagerUserId + ", locationClli=" + locationClli
+ + ", businessCountryCode=" + businessCountryCode + ", businessCountryName=" + businessCountryName
+ + ", businessUnit=" + businessUnit + ", businessUnitName=" + businessUnitName + ", department="
+ + department + ", departmentName=" + departmentName + ", companyCode=" + companyCode + ", company="
+ + company + ", zipCodeSuffix=" + zipCodeSuffix + ", jobTitle=" + jobTitle + ", commandChain="
+ + commandChain + ", siloStatus=" + siloStatus + ", costCenter=" + costCenter + ", financialLocCode="
+ + financialLocCode + ", loginId=" + loginId + ", loginPwd=" + loginPwd + ", lastLoginDate="
+ + lastLoginDate + ", active=" + active + ", internal=" + internal + ", selectedProfileId="
+ + selectedProfileId + ", timeZoneId=" + timeZoneId + ", online=" + online + ", chatId=" + chatId
+ + ", isGuest=" + isGuest + ", userApps=" + userApps + ", pseudoRoles=" + pseudoRoles + "]";
+ }
+
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserApp.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserApp.java
new file mode 100644
index 00000000..9ed62d8b
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserApp.java
@@ -0,0 +1,119 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+
+@SuppressWarnings("rawtypes")
+public class EPUserApp implements java.io.Serializable, Comparable {
+
+ private static final long serialVersionUID = 1L;
+
+ private Long userId;
+ private EPApp app;
+ private EPRole role;
+ private Short priority;
+
+ public EPUserApp() {
+ }
+
+ public Long getAppId() {
+ return this.getApp().getId();
+ }
+
+ public Long getRoleId() {
+ return (role == null) ? null : role.getId();
+ }
+
+ public Long getAppRoleId() {
+ return (role.getAppRoleId() == null) ? null : role.getAppRoleId();
+ }
+
+ @Override
+ public String toString() {
+ String str = "[u: "+getUserId()+"; a: "+getAppId()+", r: "+getRoleId()+"; appRoleId: "+getAppRoleId()+"]";
+ return str;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long id) {
+ this.userId = id;
+ }
+
+ public EPApp getApp() {
+ return app;
+ }
+
+ public void setApp(EPApp app) {
+ this.app = app;
+ }
+
+ public EPRole getRole() {
+ return role;
+ }
+
+ public void setRole(EPRole role) {
+ this.role = role;
+ }
+
+ public Short getPriority() {
+ return this.priority;
+ }
+
+ public void setPriority(Short priority) {
+ this.priority = priority;
+ }
+
+ public boolean equals(Object other) {
+ if ((this == other))
+ return true;
+ if ((other == null))
+ return false;
+ if (!(other instanceof EPUserApp))
+ return false;
+ EPUserApp castOther = (EPUserApp) other;
+
+ return (this.getUserId().equals(castOther.getUserId()))
+ && (this.getApp().getId().equals(castOther.getApp().getId()))
+ && (this.getRole().getId().equals(castOther.getRole().getId()))
+ && ((this.priority==null && castOther.getPriority()==null) || this.getPriority().equals(castOther.getPriority()));
+ }
+
+ public int hashCode() {
+ int result = 17;
+
+ result = 37 * result + (int) (this.getUserId()==null ? 0 : this.getUserId().intValue());
+ result = 37 * result + (int) (this.getApp().getId()==null ? 0 : this.getApp().getId().intValue());
+ result = 37 * result + (int) (this.getRole().getId()==null ? 0 : this.getRole().getId().intValue());
+ result = 37 * result + (int) (this.priority==null ? 0 : this.priority);
+ return result;
+ }
+
+ public int compareTo(Object other){
+ EPUserApp castOther = (EPUserApp) other;
+
+ Long c1 = (this.getUserId()==null ? 0 : this.getUserId()) + (this.getApp()==null||this.getApp().getId()==null ? 0 : this.getApp().getId()) + (this.getRole()==null||this.getRole().getId()==null ? 0 : this.getRole().getId()) + (this.priority==null ? 0 : this.priority);
+ Long c2 = (castOther.getUserId()==null ? 0 : castOther.getUserId()) + (castOther.getApp()==null||castOther.getApp().getId()==null ? 0 : castOther.getApp().getId()) + (castOther.getRole()==null||castOther.getRole().getId()==null ? 0 : castOther.getRole().getId()) + (castOther.priority==null ? 0 : castOther.priority);
+
+ return c1.compareTo(c2);
+ }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppCatalogRoles.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppCatalogRoles.java
new file mode 100644
index 00000000..89411ea5
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppCatalogRoles.java
@@ -0,0 +1,92 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+@Entity
+@JsonInclude
+public class EPUserAppCatalogRoles extends DomainVo {
+
+ private static final long serialVersionUID = -5259869298825093816L;
+
+
+ @Id
+ @Column(name="requested_role_id")
+ public Long requestedRoleId;
+
+
+ @Id
+ @Column(name="role_name")
+ public String rolename;
+
+ @Id
+ @Column(name="request_status")
+ public String requestStatus;
+
+ @Id
+ @Column(name="app_id")
+ public Long appId;
+
+ public Long getRequestedRoleId() {
+ return requestedRoleId;
+ }
+
+ public void setRequestedRoleId(Long requestedRoleId) {
+ this.requestedRoleId = requestedRoleId;
+ }
+
+ public String getRolename() {
+ return rolename;
+ }
+
+ public void setRolename(String rolename) {
+ this.rolename = rolename;
+ }
+
+ public String getRequestStatus() {
+ return requestStatus;
+ }
+
+ public void setRequestStatus(String requestStatus) {
+ this.requestStatus = requestStatus;
+ }
+
+ public Long getAppId() {
+ return appId;
+ }
+
+ public void setAppId(Long appId) {
+ this.appId = appId;
+ }
+
+ public String toString() {
+ return "EPUserAppCatalogRoles [requestedRoleId=" + requestedRoleId + ", rolename=" + rolename
+ + ", requestStatus=" + requestStatus + ", appId=" + appId + "]";
+ }
+
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppRolesRequest.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppRolesRequest.java
new file mode 100644
index 00000000..1d73945e
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppRolesRequest.java
@@ -0,0 +1,87 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+
+import java.util.Date;
+import java.util.Set;
+
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+
+public class EPUserAppRolesRequest extends DomainVo {
+
+ private static final long serialVersionUID = -7225288307806389019L;
+ private Long userId;
+ private Long appId;
+ private Date createdDate;
+ private Date updatedDate;
+ private String requestStatus;
+
+ private Set<EPUserAppRolesRequestDetail> epRequestIdDetail;
+
+ public final Long getUserId() {
+ return userId;
+ }
+
+ public final void setUserId(Long userId) {
+ this.userId = userId;
+ }
+
+ public final Long getAppId() {
+ return appId;
+ }
+
+ public final void setAppId(Long appId) {
+ this.appId = appId;
+ }
+
+ public final Date getCreatedDate() {
+ return createdDate;
+ }
+
+ public final void setCreatedDate(Date createdDate) {
+ this.createdDate = createdDate;
+ }
+
+ public final Date getUpdatedDate() {
+ return updatedDate;
+ }
+
+ public final void setUpdatedDate(Date updatedDate) {
+ this.updatedDate = updatedDate;
+ }
+
+ public final String getRequestStatus() {
+ return requestStatus;
+ }
+
+ public final void setRequestStatus(String requestStatus) {
+ this.requestStatus = requestStatus;
+ }
+
+ public final Set<EPUserAppRolesRequestDetail> getEpRequestIdDetail() {
+ return epRequestIdDetail;
+ }
+
+ public final void setEpRequestIdDetail(Set<EPUserAppRolesRequestDetail> epMyLoginsDetail) {
+ this.epRequestIdDetail = epMyLoginsDetail;
+ }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppRolesRequestDetail.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppRolesRequestDetail.java
new file mode 100644
index 00000000..d7989bcd
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppRolesRequestDetail.java
@@ -0,0 +1,52 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+public class EPUserAppRolesRequestDetail extends DomainVo{
+
+ private static final long serialVersionUID = -4908856671135348157L;
+
+ private Long reqRoleId;
+ private String reqType;
+ private EPUserAppRolesRequest epRequestIdData;
+
+ public final EPUserAppRolesRequest getEpRequestIdData() {
+ return epRequestIdData;
+ }
+ public final void setEpRequestIdData(EPUserAppRolesRequest epRequestIdData) {
+ this.epRequestIdData = epRequestIdData;
+ }
+ public final Long getReqRoleId() {
+ return reqRoleId;
+ }
+ public final void setReqRoleId(Long reqRoleId) {
+ this.reqRoleId = reqRoleId;
+ }
+ public final String getReqType() {
+ return reqType;
+ }
+ public final void setReqType(String reqType) {
+ this.reqType = reqType;
+ }
+
+}
+
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppsManualSortPreference.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppsManualSortPreference.java
new file mode 100644
index 00000000..30d69bab
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppsManualSortPreference.java
@@ -0,0 +1,50 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+public class EPUserAppsManualSortPreference extends DomainVo {
+
+ private static final long serialVersionUID = -6270136291139278216L;
+ private int userId;
+ private Long appId;
+ private int appManualSortOrder;
+
+ public int getUserId() {
+ return userId;
+ }
+ public void setUserId(int userId) {
+ this.userId = userId;
+ }
+ public Long getAppId() {
+ return appId;
+ }
+ public void setAppId(Long appId) {
+ this.appId = appId;
+ }
+ public int getAppManualSortOrder() {
+ return appManualSortOrder;
+ }
+ public void setAppManualSortOrder(int appManualSortOrder) {
+ this.appManualSortOrder = appManualSortOrder;
+ }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppsSortPreference.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppsSortPreference.java
new file mode 100644
index 00000000..1cab30ff
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppsSortPreference.java
@@ -0,0 +1,44 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+public class EPUserAppsSortPreference extends DomainVo{
+
+ private static final long serialVersionUID = -5267000174894006433L;
+
+ private int userId;
+ private String sortPref;
+
+ public int getUserId() {
+ return userId;
+ }
+ public void setUserId(final int userId) {
+ this.userId = userId;
+ }
+ public String getSortPref() {
+ return sortPref;
+ }
+ public void setSortPref(final String sortPref) {
+ this.sortPref = sortPref;
+ }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserNotification.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserNotification.java
new file mode 100644
index 00000000..c82db4de
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserNotification.java
@@ -0,0 +1,57 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import java.util.Date;
+
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+
+public class EPUserNotification extends DomainVo {
+ private Long userId;
+ private Long notificationId;
+ private String viewed;
+ private Date updateTime;
+
+ public Long getUserId() {
+ return userId;
+ }
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+ public Long getNotificationId() {
+ return notificationId;
+ }
+ public void setNotificationId(Long notificationId) {
+ this.notificationId = notificationId;
+ }
+ public String getViewed() {
+ return viewed;
+ }
+ public void setViewed(String viewed) {
+ this.viewed = viewed;
+ }
+ public Date getUpdateTime() {
+ return updateTime;
+ }
+ public void setUpdateTime(Date updateTime) {
+ this.updateTime = updateTime;
+ }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPWidgetsManualSortPreference.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPWidgetsManualSortPreference.java
new file mode 100644
index 00000000..4a3b784b
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPWidgetsManualSortPreference.java
@@ -0,0 +1,70 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+public class EPWidgetsManualSortPreference extends DomainVo{
+
+ private static final long serialVersionUID = 4607102334801223570L;
+ private int userId;
+ private Long widgetId;
+ private int widgetRow;
+ private int widgetCol;
+ private int widgetWidth;
+ private int widgetHeight;
+
+ public int getUserId() {
+ return userId;
+ }
+ public void setUserId(int userId) {
+ this.userId = userId;
+ }
+ public Long getWidgetId() {
+ return widgetId;
+ }
+ public void setWidgetId(Long widgetId) {
+ this.widgetId = widgetId;
+ }
+ public int getWidgetRow() {
+ return widgetRow;
+ }
+ public void setWidgetRow(int widgetRow) {
+ this.widgetRow = widgetRow;
+ }
+ public int getWidgetCol() {
+ return widgetCol;
+ }
+ public void setWidgetCol(int widgetCol) {
+ this.widgetCol = widgetCol;
+ }
+ public int getWidgetWidth() {
+ return widgetWidth;
+ }
+ public void setWidgetWidth(int widgetWidth) {
+ this.widgetWidth = widgetWidth;
+ }
+ public int getWidgetHeight() {
+ return widgetHeight;
+ }
+ public void setWidgetHeight(int widgetHeight) {
+ this.widgetHeight = widgetHeight;
+ }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompApp.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompApp.java
new file mode 100644
index 00000000..1cf89fbd
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompApp.java
@@ -0,0 +1,146 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+/**
+ * Model for a subset of the columns in the fn_app table.
+ */
+public class EcompApp {
+
+ protected Long id;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ private String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ private String imageUrl;
+
+ public String getImageUrl() {
+ return imageUrl;
+ }
+
+ public void setImageUrl(String imageUrl) {
+ this.imageUrl = imageUrl;
+ }
+
+ private String description;
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ private String notes;
+
+ public String getNotes() {
+ return notes;
+ }
+
+ public void setNotes(String notes) {
+ this.notes = notes;
+ }
+
+ private String url;
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ private String alternateUrl;
+
+ public String getAlternateUrl() {
+ return alternateUrl;
+ }
+
+ public void setAlternateUrl(String alternateUrl) {
+ this.alternateUrl = alternateUrl;
+ }
+
+ private String uebTopicName;
+
+ public String getUebTopicName() {
+ return uebTopicName;
+ }
+
+ public void setUebTopicName(String topicName) {
+ this.uebTopicName = topicName;
+ }
+
+ private String uebKey;
+
+ public String getUebKey() {
+ return uebKey;
+ }
+
+ public void setUebKey(String uebKey) {
+ this.uebKey = uebKey;
+ }
+
+ private String uebSecret;
+
+ public String getUebSecret() {
+ return uebSecret;
+ }
+
+ public void setUebSecret(String secret) {
+ this.uebSecret = secret;
+ }
+
+ private Boolean enabled;
+
+ public Boolean isEnabled() {
+ return enabled;
+ }
+
+ public void setEnabled(Boolean enable) {
+ this.enabled = enable;
+ }
+
+ private Boolean restrictedApp;
+
+ public Boolean isRestrictedApp() {
+ return restrictedApp;
+ }
+
+ public void setRestrictedApp(Boolean restrictedApp) {
+ this.restrictedApp = restrictedApp;
+ }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompAppRole.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompAppRole.java
new file mode 100644
index 00000000..78cf4162
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompAppRole.java
@@ -0,0 +1,80 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+
+@Entity
+@IdClass(EcompAppRoleId.class)
+public class EcompAppRole {
+
+ @Id
+ @Column(name="app_id")
+ private Long appId;
+
+ @Id
+ @Column(name="app_name")
+ private String appName;
+
+ @Id
+ @Column(name="role_id")
+ private Integer roleId;
+
+ @Id
+ @Column(name="role_name")
+ private String roleName;
+
+ public Long getAppId() {
+ return appId;
+ }
+
+ public void setAppId(Long appId) {
+ this.appId = appId;
+ }
+
+ public String getAppName() {
+ return appName;
+ }
+
+ public void setAppName(String appName) {
+ this.appName = appName;
+ }
+
+ public Integer getRoleId() {
+ return roleId;
+ }
+
+ public void setRoleId(Integer roleId) {
+ this.roleId = roleId;
+ }
+
+ public String getRoleName() {
+ return roleName;
+ }
+
+ public void setRoleName(String roleName) {
+ this.roleName = roleName;
+ }
+
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompAppRoleId.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompAppRoleId.java
new file mode 100644
index 00000000..d89c0736
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompAppRoleId.java
@@ -0,0 +1,83 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+
+public class EcompAppRoleId implements Serializable{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Id
+ @Column(name="app_id")
+ private Long appId;
+
+ @Id
+ @Column(name="app_name")
+ private String appName;
+
+ @Id
+ @Column(name="role_id")
+ private Integer roleId;
+
+ @Id
+ @Column(name="role_name")
+ private String roleName;
+
+ public Long getAppId() {
+ return appId;
+ }
+
+ public void setAppId(Long appId) {
+ this.appId = appId;
+ }
+
+ public String getAppName() {
+ return appName;
+ }
+
+ public void setAppName(String appName) {
+ this.appName = appName;
+ }
+
+ public Integer getRoleId() {
+ return roleId;
+ }
+
+ public void setRoleId(Integer roleId) {
+ this.roleId = roleId;
+ }
+
+ public String getRoleName() {
+ return roleName;
+ }
+
+ public void setRoleName(String roleName) {
+ this.roleName = roleName;
+ }
+
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompAuditLog.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompAuditLog.java
new file mode 100644
index 00000000..4d4ec277
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompAuditLog.java
@@ -0,0 +1,61 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import java.util.Date;
+
+import org.openecomp.portalsdk.core.domain.AuditLog;
+
+public class EcompAuditLog extends AuditLog {
+
+ private static final long serialVersionUID = 7970458389782626231L;
+
+ // values of activity_cd column in table fu_lu_activity
+ // as loaded by DML sql script
+ public static final String CD_ACTIVITY_ADD_CHILD_ROLE = "add_child_role";
+ public static final String CD_ACTIVITY_ADD_ROLE = "add_role";
+ public static final String CD_ACTIVITY_ADD_ROLE_FUNCTION = "add_role_function";
+ public static final String CD_ACTIVITY_ADD_USER_ROLE = "add_user_role";
+ public static final String CD_ACTIVITY_APP_ACCESS = "app_access";
+ public static final String CD_ACTIVITY_FUNCTIONAL_ACCESS = "functional_access";
+ public static final String CD_ACTIVITY_GUEST_LOGIN = "guest_login";
+ public static final String CD_ACTIVITY_LOGIN = "login";
+ public static final String CD_ACTIVITY_LOGOUT = "logout";
+ public static final String CD_ACTIVITY_MOBILE_LOGIN = "mobile_login";
+ public static final String CD_ACTIVITY_MOBILE_LOGOUT = "mobile_logout";
+ public static final String CD_ACTIVITY_REMOVE_CHILD_ROLE = "remove_child_role";
+ public static final String CD_ACTIVITY_REMOVE_ROLE = "remove_role";
+ public static final String CD_ACTIVITY_REMOVE_ROLE_FUNCTION = "remove_role_function";
+ public static final String CD_ACTIVITY_REMOVE_USER_ROLE = "remove_user_role";
+ public static final String CD_ACTIVITY_TAB_ACCESS = "tab_access";
+ public static final String CD_ACTIVITY_SEARCH = "search";
+ public static final String CD_ACTIVITY_ADD_PORTAL_ADMIN = "apa ";
+ public static final String CD_ACTIVITY_DELETE_PORTAL_ADMIN = "dpa";
+ public static final String CD_ACTIVITY_UPDATE_USER = "uu ";
+ public static final String CD_ACTIVITY_UPDATE_ACCOUNT_ADMIN = "uaa ";
+ public static final String CD_ACTIVITY_STORE_ANALYTICS = "store_analytics";
+
+ /**
+ * Creates a new object with the created field set to the current date-time.
+ */
+ public EcompAuditLog() {
+ setCreated(new Date());
+ }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EpUserAppRoles.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EpUserAppRoles.java
new file mode 100644
index 00000000..1bfb1841
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EpUserAppRoles.java
@@ -0,0 +1,63 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+@Entity
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class EpUserAppRoles extends DomainVo {
+
+ private static final long serialVersionUID = -1484592641766545668L;
+
+ @Id
+ @Column(name ="role_id")
+ public Long roleId;
+
+ @Id
+ @Column(name ="app_id")
+ public Long appId;
+
+ public Long getRoleId() {
+ return roleId;
+ }
+ public void setRoleId(Long roleId) {
+ this.roleId = roleId;
+ }
+ public Long getAppId() {
+ return appId;
+ }
+ public void setAppId(Long appId) {
+ this.appId = appId;
+ }
+
+ @Override
+ public String toString() {
+ return "EpUserAppRoles [roleId=" + roleId + ", appId=" + appId + "]";
+ }
+}
+
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/ExternalSystemAccess.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/ExternalSystemAccess.java
new file mode 100644
index 00000000..a0395bf8
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/ExternalSystemAccess.java
@@ -0,0 +1,49 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+public class ExternalSystemAccess {
+
+ private String key;
+ private Boolean accessValue;
+
+ public ExternalSystemAccess(String key, Boolean accessValue){
+ this.key = key;
+ this.accessValue = accessValue;
+ }
+
+ public String getKey() {
+ return key;
+ }
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ public Boolean getAccessValue() {
+ return accessValue;
+ }
+
+ public void setAccessValue(Boolean accessValue) {
+ this.accessValue = accessValue;
+ }
+
+
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/FunctionalMenuItemWithAppID.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/FunctionalMenuItemWithAppID.java
new file mode 100644
index 00000000..ac2bc6c4
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/FunctionalMenuItemWithAppID.java
@@ -0,0 +1,96 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import java.util.List;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Transient;
+/***
+ *
+ * This class is almost identical to org.openecomp.portalapp.portal.transport.FunctionalMenuItem
+ * The only difference is the appId field. In FunctionMenuItem, we used @Transient as an attribute, and we are using @Column in this class.
+ * In some sql queries, we need to have appId, but it's not a field in fn_menu_functional table.
+ *
+ * @author robertlo
+ *
+ */
+@Entity
+public class FunctionalMenuItemWithAppID{
+ private static final long serialVersionUID = 1L;
+
+ @Id
+ @GeneratedValue(strategy=GenerationType.IDENTITY)
+ @Column(name = "MENU_ID")
+ public Long menuId;
+
+ @Column(name = "COLUMN_NUM")
+ public Integer column;
+
+ @Column(name = "TEXT")
+ public String text;
+
+ @Column(name = "PARENT_MENU_ID")
+ public Integer parentMenuId;
+
+ @Column(name = "URL")
+ public String url;
+
+ @Column(name="ACTIVE_YN")
+ public String active_yn;
+
+ @Column(name="APP_ID")
+ public Integer appid;
+
+ @Transient
+ public List<Integer> roles;
+
+ @Transient
+ public Boolean restrictedApp;
+
+ public void normalize() {
+ if (this.column == null)
+ this.column = new Integer(1);
+ this.text = (this.text == null) ? "" : this.text.trim();
+ if (this.parentMenuId == null)
+ this.parentMenuId = new Integer(-1);
+ this.url = (this.url == null) ? "" : this.url.trim();
+ }
+
+ @Override
+ public String toString() {
+ return "FunctionalMenuItem [menuId=" + menuId + ", column=" + column + ", text=" + text + ", parentMenuId="
+ + parentMenuId + ", url=" + url + ", active_yn=" + active_yn + ", appid=" + appid + ", roles=" + roles
+ + ", restrictedApp=" + restrictedApp + "]";
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public void setRestrictedApp(Boolean restrictedApp) {
+ this.restrictedApp = restrictedApp;
+ }
+}
+
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/GetAccessResult.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/GetAccessResult.java
new file mode 100644
index 00000000..4669426a
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/GetAccessResult.java
@@ -0,0 +1,114 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+@Entity
+@JsonInclude
+public class GetAccessResult implements Serializable{
+
+
+ private static final long serialVersionUID = 5239527705869613411L;
+
+ @Id
+ @Column(name="row_id")
+ private String rowId;
+
+ @Column(name="role_id")
+ private Long roleId;
+
+ @Column(name="ecomp_function",nullable=true)
+ private String ecompFunction;
+
+ @Column(name="app_name")
+ private String appName;
+
+ @Column(name="app_mots_id",nullable=true)
+ private Integer appMotsId;
+
+ @Column(name="role_name")
+ private String roleName;
+
+ @Column(name="role_actv",nullable=true)
+ private String roleActive;
+
+
+ @Column(name="request_type",nullable=true)
+ private String reqType;
+
+
+
+ public final String getRowId() {
+ return rowId;
+ }
+ public final void setRowId(String rowId) {
+ this.rowId = rowId;
+ }
+ public final Long getRoleId() {
+ return roleId;
+ }
+ public final void setRoleId(Long roleId) {
+ this.roleId = roleId;
+ }
+ public String getEcompFunction() {
+ return ecompFunction;
+ }
+ public void setEcompFunction(String ecompFunction) {
+ this.ecompFunction = ecompFunction;
+ }
+ public String getAppName() {
+ return appName;
+ }
+ public void setAppName(String appName) {
+ this.appName = appName;
+ }
+ public Integer getAppMotsId() {
+ return appMotsId;
+ }
+ public void setAppMotsId(Integer appMotsId) {
+ this.appMotsId = appMotsId;
+ }
+ public String getRoleName() {
+ return roleName;
+ }
+ public void setRoleName(String roleName) {
+ this.roleName = roleName;
+ }
+ public final String getRoleActive() {
+ return roleActive;
+ }
+ public final void setRoleActive(String roleActive) {
+ this.roleActive = roleActive;
+ }
+ public final String getReqType() {
+ return reqType;
+ }
+ public final void setReqType(String reqType) {
+ this.reqType = reqType;
+ }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/GetAccessResultId.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/GetAccessResultId.java
new file mode 100644
index 00000000..0830bfd8
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/GetAccessResultId.java
@@ -0,0 +1,64 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+
+public class GetAccessResultId implements Serializable{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Id
+ @Column(name="ecomp_function")
+ private String ecompFunction;
+
+ @Id
+ @Column(name="app_name")
+ private String appName;
+
+ @Id
+ @Column(name="role_name")
+ private String roleName;
+
+ public String getEcompFunction() {
+ return ecompFunction;
+ }
+ public void setEcompFunction(String ecompFunction) {
+ this.ecompFunction = ecompFunction;
+ }
+ public String getAppName() {
+ return appName;
+ }
+ public void setAppName(String appName) {
+ this.appName = appName;
+ }
+ public String getRoleName() {
+ return roleName;
+ }
+ public void setRoleName(String roleName) {
+ this.roleName = roleName;
+ }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/MicroserviceData.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/MicroserviceData.java
new file mode 100644
index 00000000..91366ce8
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/MicroserviceData.java
@@ -0,0 +1,146 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import java.util.List;
+
+import javax.persistence.Column;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+public class MicroserviceData extends DomainVo {
+
+ private static final long serialVersionUID = 1L;
+
+ public MicroserviceData() {
+
+ }
+
+ private Long id;
+
+ private String name;
+
+ private String active;
+
+ private String desc;
+
+ private long appId;
+
+ private String url;
+
+ private String securityType;
+
+ private String username;
+
+ private String password;
+
+ private List<MicroserviceParameter> parameterList;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getActive() {
+ return active;
+ }
+
+ public void setActive(String active) {
+ this.active = active;
+ }
+
+ public String getDesc() {
+ return desc;
+ }
+
+ public void setDesc(String desc) {
+ this.desc = desc;
+ }
+
+ public long getAppId() {
+ return appId;
+ }
+
+ public void setAppId(long appId) {
+ this.appId = appId;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public String getSecurityType() {
+ return securityType;
+ }
+
+ public void setSecurityType(String securityType) {
+ this.securityType = securityType;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public List<MicroserviceParameter> getParameterList() {
+ return parameterList;
+ }
+
+ public void setParameterList(List<MicroserviceParameter> parameterList) {
+ this.parameterList = parameterList;
+ }
+
+ @Override
+ public String toString() {
+ return "MicroserviceData [id=" + id + ", name=" + name + ", desc=" + desc + ", appId=" + appId + ", url=" + url
+ + ", securityType=" + securityType + ", username=" + username + ", password=" + password
+ + ", parameterList=" + parameterList + "]";
+ }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/MicroserviceParameter.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/MicroserviceParameter.java
new file mode 100644
index 00000000..74a29370
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/MicroserviceParameter.java
@@ -0,0 +1,82 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import javax.persistence.Column;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+public class MicroserviceParameter extends DomainVo {
+
+ private static final long serialVersionUID = 1L;
+
+ public MicroserviceParameter() {
+
+ }
+
+ private Long id;
+
+ private long serviceId;
+
+ private String para_key;
+
+ private String para_value;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public long getServiceId() {
+ return serviceId;
+ }
+
+ public void setServiceId(long serviceId) {
+ this.serviceId = serviceId;
+ }
+
+ public String getPara_key() {
+ return para_key;
+ }
+
+ public void setPara_key(String para_key) {
+ this.para_key = para_key;
+ }
+
+ public String getPara_value() {
+ return para_value;
+ }
+
+ public void setPara_value(String para_value) {
+ this.para_value = para_value;
+ }
+
+ @Override
+ public String toString() {
+ return "MicroserviceParameter [id=" + id + ", serviceId=" + serviceId + ", para_key=" + para_key
+ + ", para_value=" + para_value + "]";
+ }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/PersUserAppSelection.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/PersUserAppSelection.java
new file mode 100644
index 00000000..68875bf5
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/PersUserAppSelection.java
@@ -0,0 +1,78 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+/**
+ * Models a row in the table with personalization of user app selections.
+ */
+public class PersUserAppSelection extends DomainVo {
+
+ private static final long serialVersionUID = 1545308654500121206L;
+
+ private Long userId;
+
+ private Long appId;
+
+ private String statusCode;
+
+ public PersUserAppSelection() {}
+
+ /**
+ * Convenience constructor
+ *
+ * @param id
+ * @param userId
+ * @param appId
+ * @param statusCode
+ */
+ public PersUserAppSelection(final Long id, final Long userId, final Long appId, final String statusCode) {
+ super.id = id;
+ this.userId = userId;
+ this.appId = appId;
+ this.statusCode = statusCode;
+ }
+
+ public Long getAppId() {
+ return appId;
+ }
+
+ public void setAppId(Long appId) {
+ this.appId = appId;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+
+ public String getStatusCode() {
+ return statusCode;
+ }
+
+ public void setStatusCode(String statusCode) {
+ this.statusCode = statusCode;
+ }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/PersUserWidgetSelection.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/PersUserWidgetSelection.java
new file mode 100644
index 00000000..4993b462
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/PersUserWidgetSelection.java
@@ -0,0 +1,81 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+/**
+ * Models a row in the table with personalization of user widget selections.
+ */
+public class PersUserWidgetSelection extends DomainVo {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -6547880514779039200L;
+
+ private Long userId;
+
+ private Long widgetId;
+
+ private String statusCode;
+
+ public PersUserWidgetSelection() {}
+
+ /**
+ * Convenience constructor
+ *
+ * @param id
+ * @param userId
+ * @param widgetId
+ * @param statusCode
+ */
+ public PersUserWidgetSelection(final Long id, final Long userId, final Long widgetId, final String statusCode) {
+ super.id = id;
+ this.userId = userId;
+ this.widgetId = widgetId;
+ this.statusCode = statusCode;
+ }
+
+ public Long getWidgetId() {
+ return widgetId;
+ }
+
+ public void setWidgetId(Long widgetId) {
+ this.widgetId = widgetId;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+
+ public String getStatusCode() {
+ return statusCode;
+ }
+
+ public void setStatusCode(String statusCode) {
+ this.statusCode = statusCode;
+ }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/RoleApp.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/RoleApp.java
new file mode 100644
index 00000000..ade24dcb
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/RoleApp.java
@@ -0,0 +1,114 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import java.io.Serializable;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToMany;
+import javax.persistence.ManyToOne;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+//@Entity
+//@Table(name = "FN_ROLE")
+public class RoleApp implements Serializable{
+ private static final long serialVersionUID = 1L;
+
+ //@Id
+ //@Column(name = "ROLE_ID")
+ //@GeneratedValue(strategy=GenerationType.AUTO)
+ private Long roleId;
+
+
+ //@Column(name = "ROLE_Name")
+ private String roleName;
+
+ //@ManyToOne(fetch = FetchType.EAGER)
+ //@JoinColumn(name="APP_ID")
+ private App app;
+
+ //@JsonIgnore
+ //@ManyToMany(fetch = FetchType.EAGER, cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}, mappedBy="widgetRoles")
+ private Set<WidgetCatalog> widgets;
+
+ /*@PreRemove
+ private void removeGroupsFromUsers() {
+ for (WidgetCatalog w : widgets) {
+ w.getWidgetRoles().remove(this);
+ }
+ }*/
+
+ /*@ManyToOne
+ @JoinColumn(name = "WIDGET_ID", nullable = false)
+ WidgetCatalog widgetCatalog;*/
+
+ //@JsonIgnore
+ //@ManyToMany(mappedBy = "widgetRoles")
+ //@ManyToMany(fetch = FetchType.EAGER, mappedBy = "widgetRoles")
+ //private Set<WidgetCatalog> widgets = new HashSet<WidgetCatalog>();
+
+ public Long getRoleId() {
+ return roleId;
+ }
+
+ public void setRoleId(Long roleId) {
+ this.roleId = roleId;
+ }
+
+ public String getRoleName() {
+ return roleName;
+ }
+
+ public void setRoleName(String roleName) {
+ this.roleName = roleName;
+ }
+
+ public App getApp() {
+ return app;
+ }
+
+ public void setApp(App app) {
+ this.app = app;
+ }
+
+
+
+ public Set<WidgetCatalog> getWidgets() {
+ return widgets;
+ }
+
+ public void setWidgets(Set<WidgetCatalog> widgets) {
+ this.widgets = widgets;
+ }
+
+ @Override
+ public String toString() {
+ return "Role [roleId=" + roleId + ", roleName=" + roleName + ", app=" + app + "]";
+ }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/SharedContext.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/SharedContext.java
new file mode 100644
index 00000000..f966c964
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/SharedContext.java
@@ -0,0 +1,161 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import java.util.Date;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+/**
+ * A shared context is a key-value pair in a session. All shared-context objects
+ * should be dropped when a session is destroyed. Because there's always a
+ * chance of missing that event, this object notes its creation time so that it
+ * can be expired after a suitable time interval.
+ */
+@Entity
+@Table(name = "fn_shared_context")
+public class SharedContext extends DomainVo {
+
+ // generated
+ private static final long serialVersionUID = 7287469622586677888L;
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.AUTO)
+ private Long id;
+ private Date create_time;
+ private String context_id;
+ private String ckey;
+ private String cvalue;
+
+ /**
+ * Mandatory no-argument constructor
+ */
+ public SharedContext() {
+ }
+
+ /**
+ * Convenience constructor. The database ID and creation timestamp are
+ * populated when the object is added to the database.
+ */
+ public SharedContext(final String contextId, final String key, final String value) {
+ this.context_id = contextId;
+ this.ckey = key;
+ this.cvalue = value;
+ }
+
+ /**
+ * Gets the database row ID.
+ *
+ * @return Database row ID
+ */
+ public Long getId() {
+ return id;
+ }
+
+ /**
+ * Sets the database row ID.
+ *
+ * @param id
+ */
+ public void setId(final Long id) {
+ this.id = id;
+ }
+
+ /**
+ * Gets the creation time
+ *
+ * @return Creation time as a Date
+ */
+ public Date getCreate_time() {
+ return create_time;
+ }
+
+ /**
+ * Sets the creation time
+ *
+ * @param create_time
+ */
+ public void setCreate_time(final Date create_time) {
+ this.create_time = create_time;
+ }
+
+ /**
+ * Gets the context ID
+ *
+ * @return Context ID
+ */
+ public String getContext_id() {
+ return context_id;
+ }
+
+ /**
+ * Sets the context ID
+ *
+ * @param context_id
+ */
+ public void setContext_id(final String context_id) {
+ this.context_id = context_id;
+ }
+
+ /**
+ * Gets the key of the key-value pair. Called ckey because "key" is a
+ * reserved word in Mysql.
+ *
+ * @return The key
+ */
+ public String getCkey() {
+ return ckey;
+ }
+
+ /**
+ * Sets the key of the key-value pair.
+ *
+ * @param ckey
+ */
+ public void setCkey(final String ckey) {
+ this.ckey = ckey;
+ }
+
+ /**
+ * Gets the value of the key-value pair. Called cvalue because "value" is a
+ * reserved word in Mysql.
+ *
+ * @return
+ */
+ public String getCvalue() {
+ return cvalue;
+ }
+
+ /**
+ * Sets the value of the key-value pair.
+ *
+ * @param cvalue
+ */
+ public void setCvalue(final String cvalue) {
+ this.cvalue = cvalue;
+ }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/UserIdRoleId.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/UserIdRoleId.java
new file mode 100644
index 00000000..4d2041dd
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/UserIdRoleId.java
@@ -0,0 +1,77 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class UserIdRoleId implements Serializable{
+
+ private static final long serialVersionUID = 1L;
+
+ @Id
+ @Column(name="USER_ID")
+ private String user_Id;
+
+ @Column(name="ROLE_ID")
+ private String roleId;
+
+ @Column(name="ORG_USER_ID")
+ private String orgUserId;
+
+ @Column(name="APP_ID")
+ private String appId;
+
+ public String getUser_Id() {
+ return user_Id;
+ }
+
+ public void setUser_Id(String id) {
+ this.user_Id = id;
+ }
+
+ public String getRoleId() {
+ return roleId;
+ }
+
+ public void setRoleId(String roleId) {
+ this.roleId = roleId;
+ }
+
+ public String getAppId() {
+ return appId;
+ }
+
+ public void setAppId(String appId) {
+ this.appId = appId;
+ }
+
+ public String getOrgUserId() {
+ return orgUserId;
+ }
+
+ public void setOrgUserId(String orgUserId) {
+ this.orgUserId = orgUserId;
+ }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/UserRole.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/UserRole.java
new file mode 100644
index 00000000..0e13cc01
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/UserRole.java
@@ -0,0 +1,91 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class UserRole implements Serializable{
+ private static final long serialVersionUID = 1L;
+
+
+ @Id
+ @Column(name="USER_ID")
+ private Long user_Id;
+
+ @Id
+ @Column(name="ROLE_ID")
+ private Long roleId;
+
+ @Column(name="ORG_USER_ID")
+ private String orgUserId;
+
+
+ @Column(name="FIRST_NAME")
+ private String firstName;
+
+ @Column(name="LAST_NAME")
+ private String lastName;
+
+
+ @Column(name="ROLE_NAME")
+ private String roleName;
+
+ public String getFirstName() {
+ return firstName;
+ }
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+ public String getLastName() {
+ return lastName;
+ }
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+ public String getOrgUserId() {
+ return orgUserId;
+ }
+ public void setOrgUserId(String orgUserId) {
+ this.orgUserId = orgUserId;
+ }
+ public String getRoleName() {
+ return roleName;
+ }
+ public void setRoleName(String roleName) {
+ this.roleName = roleName;
+ }
+ public Long getUser_Id() {
+ return user_Id;
+ }
+ public void setUser_Id(Long user_Id) {
+ this.user_Id = user_Id;
+ }
+ public Long getRoleId() {
+ return roleId;
+ }
+ public void setRoleId(Long roleId) {
+ this.roleId = roleId;
+ }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/UserRoles.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/UserRoles.java
new file mode 100644
index 00000000..1483f34a
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/UserRoles.java
@@ -0,0 +1,113 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
+
+public class UserRoles implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ /*
+ private static final HashMap<Long, String> rolesDictionary;
+ // remove hard coded roles
+ static {
+ rolesDictionary = new HashMap<Long, String>();
+ rolesDictionary.put(Long.valueOf(SystemProperties.getProperty(SystemProperties.SYS_ADMIN_ROLE_ID)).longValue(), "superAdmin");
+ rolesDictionary.put(Long.valueOf(SystemProperties.getProperty(EPCommonSystemProperties.ACCOUNT_ADMIN_ROLE_ID)).longValue(), "admin");
+ }
+ */
+
+ public UserRoles(UserRole user) {
+ setOrgUserId(user.getOrgUserId());
+ setFirstName(user.getFirstName());
+ setLastName(user.getLastName());
+ setGuestSession(user.getUser_Id()==-1 ? true : false);
+
+ addRole(user.getRoleName());
+ }
+
+ public void addRole(String roleName) {
+ //String normalizedRole = normalizeRole(roleId);
+ if (!getRoles().contains(roleName)) {
+ this.roles.add(roleName);
+ }
+ }
+
+ /*
+ public static String normalizeRole(Long role) {
+ String roleTranslated = rolesDictionary.get(role);
+ return roleTranslated == null ? "user" : roleTranslated;
+ }
+ */
+
+ private String orgUserId;
+ private String firstName;
+ private String lastName;
+ private boolean guestSession;
+
+ // TODO: Make into set
+ private List<String> roles = new ArrayList<String>();
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ public String getOrgUserId() {
+ return orgUserId;
+ }
+
+ public void setOrgUserId(String orgUserId) {
+ this.orgUserId = orgUserId;
+ }
+
+ public List<String> getRoles() {
+ return roles;
+ }
+
+ public void setRoles(List<String> roles) {
+ this.roles = roles;
+ }
+
+ public void setGuestSession(boolean guestSession) {
+ this.guestSession = guestSession;
+ }
+
+ public boolean getGuestSession() {
+ return this.guestSession;
+ }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/Widget.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/Widget.java
new file mode 100644
index 00000000..c2ef3c00
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/Widget.java
@@ -0,0 +1,105 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import org.apache.commons.lang.StringUtils;
+
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+public class Widget extends DomainVo {
+
+ private static final long serialVersionUID = 1L;
+
+ private String name;
+
+ private Integer width;
+
+ private Integer height;
+
+ private String url;
+
+ private Long appId;
+
+ public Widget() {
+ // Attention!!!
+ // We set here all default values. We also place protection
+ // into setters for fields with default values.
+ // If we don't use such protection we are able to place null
+ // to these fields and save such fields into DB even if DB has
+ // default values for these fields.
+ this.name = "";
+ this.width = new Integer(0);
+ this.height = new Integer(0);
+ this.url = "";
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ if (StringUtils.isEmpty(name)) {
+ name = "";
+ }
+ this.name = name;
+ }
+
+ public Integer getWidth() {
+ return width;
+ }
+
+ public void setWidth(Integer width) {
+ if (width == null) {
+ width = new Integer(0);
+ }
+ this.width = width;
+ }
+
+ public Integer getHeight() {
+ return height;
+ }
+
+ public void setHeight(Integer height) {
+ if (height == null) {
+ height = new Integer(0);
+ }
+ this.height = height;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ if (StringUtils.isEmpty(url)) {
+ url = "";
+ }
+ this.url = url;
+ }
+
+ public Long getAppId() {
+ return appId;
+ }
+
+ public void setAppId(Long appId) {
+ this.appId = appId;
+ }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetCatalog.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetCatalog.java
new file mode 100644
index 00000000..605a41d2
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetCatalog.java
@@ -0,0 +1,109 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import java.io.Serializable;
+import java.util.Set;
+
+public class WidgetCatalog implements Serializable{
+
+ private static final long serialVersionUID = 1L;
+
+ private long id;
+
+ private String name;
+
+ private String desc;
+
+ private String fileLocation;
+
+ private String allowAllUser;
+
+ private Long serviceId;
+
+ private String sortOrder;
+
+ private String statusCode;
+
+ private Set<RoleApp> widgetRoles;
+
+ public long getId() {
+ return id;
+ }
+ public void setId(long id) {
+ this.id = id;
+ }
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Long getServiceId() {
+ return serviceId;
+ }
+ public void setServiceId(Long serviceId) {
+ this.serviceId = serviceId;
+ }
+ public String getDesc() {
+ return desc;
+ }
+ public void setDesc(String desc) {
+ this.desc = desc;
+ }
+ public String getFileLocation() {
+ return fileLocation;
+ }
+ public void setFileLocation(String fileLocation) {
+ this.fileLocation = fileLocation;
+ }
+
+ public String getAllowAllUser() {
+ return allowAllUser;
+ }
+ public void setAllowAllUser(String allowAllUser) {
+ this.allowAllUser = allowAllUser;
+ }
+ public Set<RoleApp> getWidgetRoles() {
+ return widgetRoles;
+ }
+ public void setWidgetRoles(Set<RoleApp> widgetRoles) {
+ this.widgetRoles = widgetRoles;
+ }
+
+ public String getSortOrder() {
+ return sortOrder;
+ }
+ public void setSortOrder(String sortOrder) {
+ this.sortOrder = sortOrder;
+ }
+ public String getStatusCode() {
+ return statusCode;
+ }
+ public void setStatusCode(String statusCode) {
+ this.statusCode = statusCode;
+ }
+ @Override
+ public String toString() {
+ return "WidgetCatalog [id=" + id + ", name=" + name + ", desc=" + desc + ", fileLocation=" + fileLocation
+ + ", allowAllUser=" + allowAllUser + "]";
+ }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetCatalogParameter.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetCatalogParameter.java
new file mode 100644
index 00000000..c72780aa
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetCatalogParameter.java
@@ -0,0 +1,90 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+public class WidgetCatalogParameter extends DomainVo{
+
+ private static final long serialVersionUID = 1L;
+
+ public WidgetCatalogParameter() {
+
+ }
+ private Long id;
+
+ private Long widgetId;
+
+ private Long userId;
+
+ private Long paramId;
+
+ private String user_value;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Long getWidgetId() {
+ return widgetId;
+ }
+
+ public void setWidgetId(Long widgetId) {
+ this.widgetId = widgetId;
+ }
+
+ public String getUser_value() {
+ return user_value;
+ }
+
+ public void setUser_value(String user_value) {
+ this.user_value = user_value;
+ }
+
+ public Long getParamId() {
+ return paramId;
+ }
+
+ public void setParamId(Long paramId) {
+ this.paramId = paramId;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+
+ @Override
+ public String toString() {
+ return "WidgetCatalogParameter [id=" + id + ", widgetId=" + widgetId + ", userId=" + userId + ", paramId="
+ + paramId + ", user_value=" + user_value + "]";
+ }
+
+
+
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetParameterResult.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetParameterResult.java
new file mode 100644
index 00000000..884ec141
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetParameterResult.java
@@ -0,0 +1,70 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+public class WidgetParameterResult {
+
+ private Long param_id;
+
+ private String param_key;
+
+ private String user_value;
+
+ private String default_value;
+
+ public Long getParam_id() {
+ return param_id;
+ }
+
+ public void setParam_id(Long param_id) {
+ this.param_id = param_id;
+ }
+
+ public String getParam_key() {
+ return param_key;
+ }
+
+ public void setParam_key(String param_key) {
+ this.param_key = param_key;
+ }
+
+ public String getUser_value() {
+ return user_value;
+ }
+
+ public void setUser_value(String user_value) {
+ this.user_value = user_value;
+ }
+
+ public String getDefault_value() {
+ return default_value;
+ }
+
+ public void setDefault_value(String default_value) {
+ this.default_value = default_value;
+ }
+
+ @Override
+ public String toString() {
+ return "WidgetParameterResult [param_id=" + param_id + ", param_key=" + param_key + ", user_value=" + user_value
+ + ", default_value=" + default_value + "]";
+ }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetServiceHeaders.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetServiceHeaders.java
new file mode 100644
index 00000000..9200adda
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetServiceHeaders.java
@@ -0,0 +1,54 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import java.nio.charset.Charset;
+
+import org.apache.commons.codec.binary.Base64;
+import org.springframework.http.HttpHeaders;
+
+import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
+import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
+
+public class WidgetServiceHeaders {
+
+ private static HttpHeaders widgetHeaders;
+
+ private WidgetServiceHeaders(){}
+
+ public static HttpHeaders getInstance() throws Exception{
+ if(null == widgetHeaders){
+ return new HttpHeaders(){{
+
+ String username = EcompPortalUtils.getPropertyOrDefault("microservices.widget.username", "widget_user");
+ String password = CipherUtil.decrypt(EcompPortalUtils.getPropertyOrDefault("microservices.widget.password", "widget_password"));
+ String auth = username + ":" + password;
+ byte[] encodedAuth = Base64.encodeBase64(
+ auth.getBytes(Charset.forName("US-ASCII")) );
+ String authHeader = "Basic " + new String( encodedAuth );
+ set( "Authorization", authHeader );
+ }
+ };
+ }
+ else
+ return widgetHeaders;
+
+ }
+}