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