595d8b2e53fa681203d5bb0eaba5fbc1a3abe972
[osm/riftware.git] /
1 /*
2  * STANDARD_RIFT_IO_COPYRIGHT
3  */
4 /**
5  * Created by onvelocity on 11/23/15.
6  */
7
8 'use strict';
9
10 import DescriptorModel from '../DescriptorModel'
11
12 /**
13  * This class creates the identity of a VirtualNetworkFunctionConnectionPoint on a VNFD. Visually
14  * this class represents an svg:Path between the parent VLD and VirtualNetworkFunctionConnectionPoint.
15  *
16  *     VNFD.VirtualNetworkFunctionConnectionPoint ====path==== VLD
17  *
18  * The VNFD is referenced by nsd.constituent-vnfd.member-vnf-index.
19  * The VirtualNetworkFunctionConnectionPoint is referenced by vnfd.connection-point.name.
20  */
21 export default class VnfdConnectionPointRef extends DescriptorModel {
22
23         static get type() {
24                 return 'vnfd-connection-point-ref';
25         }
26
27         static get className() {
28                 return 'VnfdConnectionPointRef';
29         }
30
31         constructor(model, parent) {
32                 super(model, parent);
33                 this.type = 'vnfd-connection-point-ref';
34                 this.uiState['qualified-type'] = 'nsd.vld.vnfd-connection-point-ref';
35                 this.className = 'VnfdConnectionPointRef';
36         }
37
38         get key() {
39                 return this.model['member-vnf-index-ref'] + '/' + this.model['vnfd-connection-point-ref'];
40         }
41
42         get title() {
43                 return this.type;
44         }
45
46         get vnfdId() {
47                 return this.model['vnfd-id-ref'];
48         }
49
50         set vnfdId(id) {
51                 return this.model['vnfd-id-ref'] = id;
52         }
53
54         get vnfdIndex() {
55                 return this.model['member-vnf-index-ref'];
56         }
57
58         set vnfdIndex(index) {
59                 return this.model['member-vnf-index-ref'] = index;
60         }
61
62         get vnfdConnectionPointName() {
63                 return this.model['vnfd-connection-point-ref'];
64         }
65
66         set vnfdConnectionPointName(name) {
67                 return this.model['vnfd-connection-point-ref'] = name;
68         }
69
70         get cpNumber() {
71                 return this.uiState.cpNumber;
72         }
73
74         set cpNumber(n) {
75                 this.uiState.cpNumber = n;
76         }
77
78         remove() {
79                 if (this.parent) {
80                         return this.parent.removeVnfdConnectionPointRefKey(this.key);
81                 }
82         }
83
84 }