Rift.IO OSM R1 Initial Submission
[osm/UI.git] / skyquake / plugins / composer / src / src / libraries / model / descriptors / VnfdConnectionPointRef.js
1 /*
2 *
3 * Copyright 2016 RIFT.IO Inc
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 */
18 /**
19 * Created by onvelocity on 11/23/15.
20 */
21
22 'use strict';
23
24 import DescriptorModel from '../DescriptorModel'
25
26 /**
27 * This class creates the identity of a VirtualNetworkFunctionConnectionPoint on a VNFD. Visually
28 * this class represents an svg:Path between the parent VLD and VirtualNetworkFunctionConnectionPoint.
29 *
30 * VNFD.VirtualNetworkFunctionConnectionPoint ====path==== VLD
31 *
32 * The VNFD is referenced by nsd.constituent-vnfd.member-vnf-index.
33 * The VirtualNetworkFunctionConnectionPoint is referenced by vnfd.connection-point.name.
34 */
35 export default class VnfdConnectionPointRef extends DescriptorModel {
36
37 static get type() {
38 return 'vnfd-connection-point-ref';
39 }
40
41 static get className() {
42 return 'VnfdConnectionPointRef';
43 }
44
45 constructor(model, parent) {
46 super(model, parent);
47 this.type = 'vnfd-connection-point-ref';
48 this.uiState['qualified-type'] = 'nsd.vld.vnfd-connection-point-ref';
49 this.className = 'VnfdConnectionPointRef';
50 }
51
52 get key() {
53 return this.model['member-vnf-index-ref'] + '/' + this.model['vnfd-connection-point-ref'];
54 }
55
56 get title() {
57 return this.type;
58 }
59
60 get vnfdId() {
61 return this.model['vnfd-id-ref'];
62 }
63
64 set vnfdId(id) {
65 return this.model['vnfd-id-ref'] = id;
66 }
67
68 get vnfdIndex() {
69 return this.model['member-vnf-index-ref'];
70 }
71
72 set vnfdIndex(index) {
73 return this.model['member-vnf-index-ref'] = index;
74 }
75
76 get vnfdConnectionPointName() {
77 return this.model['vnfd-connection-point-ref'];
78 }
79
80 set vnfdConnectionPointName(name) {
81 return this.model['vnfd-connection-point-ref'] = name;
82 }
83
84 get cpNumber() {
85 return this.uiState.cpNumber;
86 }
87
88 set cpNumber(n) {
89 this.uiState.cpNumber = n;
90 }
91
92 get order() {
93 return this.model['order'];
94 }
95
96 set order(n) {
97 this.model['order'] = n;
98 }
99
100 remove() {
101 if (this.parent) {
102 return this.parent.removeVnfdConnectionPointRefKey(this.key);
103 }
104 }
105
106 }