summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/models/forwarding-path.ts
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/app/models/forwarding-path.ts')
-rw-r--r--catalog-ui/src/app/models/forwarding-path.ts30
1 files changed, 30 insertions, 0 deletions
diff --git a/catalog-ui/src/app/models/forwarding-path.ts b/catalog-ui/src/app/models/forwarding-path.ts
new file mode 100644
index 0000000000..2158dfe479
--- /dev/null
+++ b/catalog-ui/src/app/models/forwarding-path.ts
@@ -0,0 +1,30 @@
+import {PathElements} from './path-elements';
+import {ForwardingPathLink} from "./forwarding-path-link";
+
+export class ForwardingPath {
+ public name:string;
+ public destinationPortNumber:string;
+ public protocol:string;
+ public uniqueId:string;
+ public ownerId: string;
+ public pathElements: PathElements;
+
+ addPathLink(fromNode:string, fromCP:string, toNode:string, toCP:string, fromCPOriginId: string, toCPOriginId: string) {
+ if (!this.pathElements) {
+ this.pathElements = new PathElements();
+ }
+ this.pathElements.listToscaDataDefinition[this.pathElements.listToscaDataDefinition.length] = new ForwardingPathLink(fromNode, fromCP, toNode, toCP, fromCPOriginId, toCPOriginId);
+ }
+
+ deserialize(response:any) {
+ this.name = response.name;
+ this.destinationPortNumber = response.destinationPortNumber;
+ this.protocol = response.protocol;
+ if (response.pathElements && response.pathElements.listToscaDataDefinition) {
+ let list = response.pathElements.listToscaDataDefinition;
+ for (let i = 0; i < list.length; i++) {
+ this.addPathLink(list[i].fromNode, list[i].fromCP, list[i].toNode, list[i].toCP, list[i].fromCPOriginId, list[i].toCPOriginId);
+ }
+ }
+ }
+};