summaryrefslogtreecommitdiffstats
path: root/portal-BE
diff options
context:
space:
mode:
Diffstat (limited to 'portal-BE')
-rw-r--r--portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnAppContactUs.java177
1 files changed, 177 insertions, 0 deletions
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnAppContactUs.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnAppContactUs.java
new file mode 100644
index 00000000..26fd4668
--- /dev/null
+++ b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnAppContactUs.java
@@ -0,0 +1,177 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.io.Serializable;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EntityResult;
+import javax.persistence.FetchType;
+import javax.persistence.FieldResult;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.MapsId;
+import javax.persistence.NamedNativeQueries;
+import javax.persistence.NamedNativeQuery;
+import javax.persistence.OneToOne;
+import javax.persistence.SqlResultSetMapping;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.hibernate.validator.constraints.URL;
+import org.onap.portal.domain.dto.DomainVo;
+
+/*
+CREATE TABLE `fn_app_contact_us` (
+ `app_id` int(11) NOT NULL,
+ `contact_name` varchar(128) DEFAULT NULL,
+ `contact_email` varchar(128) DEFAULT NULL,
+ `url` varchar(256) DEFAULT NULL,
+ `active_yn` varchar(2) DEFAULT NULL,
+ `description` varchar(1024) DEFAULT NULL,
+ PRIMARY KEY (`app_id`),
+ CONSTRAINT `fk_fn_a_con__ref_202_fn_app` FOREIGN KEY (`app_id`) REFERENCES `fn_app` (`app_id`)
+ )
+*/
+
+@SqlResultSetMapping(
+ name = "fnAppContactUsMapping",
+ entities = {
+ @EntityResult(
+ entityClass = FnAppContactUs.class,
+ fields = {
+ @FieldResult(name = "appId", column = "app_Id"),
+ @FieldResult(name = "contactName", column = "contactName"),
+ @FieldResult(name = "contact_email", column = "contactEmail"),
+ @FieldResult(name = "description", column = "description"),
+ @FieldResult(name = "activeYN", column = "activeYN")
+ }
+ )
+ })
+
+@NamedNativeQueries({
+ @NamedNativeQuery(
+ name = "FnAppContactUs.getAppsAndContacts",
+ query = "select "
+ + "a.app_id as app_Id, a.app_name as appName,"
+ + "c.contact_name as contactName, "
+ + "c.contact_email as contactEmail, c.url, c.description, "
+ + "c.active_yn as activeYN"
+ + "from "
+ + "fn_app a"
+ + "left join "
+ + "fn_app_contact_us c"
+ + "on a.app_id = c.app_id"
+ + "where "
+ + "a.enabled = 'Y' and a.app_name is not null and a.app_name != '';",
+ resultClass = FnAppContactUs.class,
+ resultSetMapping = "fnAppContactUsMapping"),
+ @NamedNativeQuery(
+ name = "FnAppContactUs.getAppContactUsItems",
+ query = "select\n"
+ + " c.app_id as app_Id,\n"
+ + " c.contact_name as contact_name,\n"
+ + " c.contact_email as contact_email,\n"
+ + " c.url,\n"
+ + " c.description,\n"
+ + " c.active_yn as active_yn,\n"
+ + " a.app_name as appName\n"
+ + "from\n"
+ + " fn_app_contact_us c\n"
+ + " left join fn_app a on a.app_id = c.app_id\n"
+ + "where\n"
+ + " a.enabled = 'Y'\n"
+ + " and a.app_name is not null\n"
+ + " and a.app_name != ''",
+ resultClass = FnAppContactUs.class,
+ resultSetMapping = "fnAppContactUsMapping")
+})
+
+@Table(name = "fn_app_contact_us")
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Getter
+@Setter
+@Entity
+public class FnAppContactUs extends DomainVo implements Serializable {
+ @Id
+ @Column(name = "app_id")
+ private Long appId;
+
+ @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+ @JoinColumn(name = "app_id")
+ @MapsId
+ @Valid
+ private FnApp fnApp;
+ @Column(name = "contact_name", length = 128, columnDefinition = "varchar(128) default null")
+ @Size(max = 128)
+ @SafeHtml
+ private String contactName;
+ @Column(name = "contact_email", length = 128, columnDefinition = "varchar(128) default null")
+ @Size(max = 128)
+ @SafeHtml
+ private String contactEmail;
+ @Column(name = "url", length = 256, columnDefinition = "varchar(128) default null")
+ @Size(max = 256)
+ @SafeHtml
+ //TODO URL
+ @URL
+ private String url;
+ @Column(name = "active_yn", length = 1, columnDefinition = "varchar(1) default null")
+ @Pattern(regexp = "[YNyn]")
+ @Size(max = 1)
+ @SafeHtml
+ private String activeYn;
+ @Column(name = "description", length = 1024, columnDefinition = "varchar(1024) default null")
+ @Size(max = 1024)
+ @SafeHtml
+ private String description;
+
+}
r">- name: service-url description: Oclip service base url type: url1 short_option: u long_option: service-url is_optional: false1 - name: status description: Oclip service status type: digit short_option: z long_option: service-version is_optional: true default_value: 1 - name: node-ip description: Oclip service running node IP type: string - name: node-port description: Oclip service running node port type: string - name: create-or-update description: Oclip service create or update type: cfbcv default_value: true results: direction: portrait attributes: - name: name description: Oclip service name scope: short type: string - name: version description: Oclip service version scope: short type: string - name: status description: Oclip service base url scope: short type: url - name: status description: Oclip service status scope: short1 type: digit - name: nodes description: Oclip service running nodes scope: long type: string - name: location description: Oclip service location scope: long type: url http: service: name: msb version: v1 type: direct auth: none request: uri: /services method: POST1 body: '{"serviceName":"${service}","serviceName":"${service-name}","version":"${service-version}","url":"${service-url}","protocol":"REST","visualRange":"1","lb_policy":"hash","nodes":[{"ip":"${node-ip}","port":"${node-port}","ttl":0}]}' headers: queries: createOrUpdate: ${create-or-update1} success_codes: - 201 - 300 result_map: name: $b{$.serviceName} version: $b{$.version} url: $b{$.url} status1: $b{$.status} nodes: $b{$.nodes[*].ip}:$b{$.nodes[*].port} location: $h{Location} sample_response: body: {"serviceName":"test","version":"v1","url":"/api/test/v1","protocol":"REST","visualRange":"1","lb_policy":"hash","nodes":[{"ip":"127.0.0.1","port":"8012","ttl":0,"nodeId":"test_127.0.0.1_8012","expiration":"2017-02-10T05:33:25Z","created_at":"2017-02-10T05:33:25Z","updated_at":"2017-02-10T05:33:25Z"}],"status":"1"}