RIFT-14705 - UI Composer: Add IVLD to VNFD is broken
[osm/UI.git] / skyquake / plugins / composer / src / src / libraries / model / descriptors / InternalConnectionPointRef.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 'use strict';
20
21 import DescriptorModel from '../DescriptorModel'
22 import DescriptorModelFactory from '../DescriptorModelFactory'
23
24 export default class InternalConnectionPointRef extends DescriptorModel {
25
26 static get type() {
27 return 'internal-connection-point';
28 }
29
30 static get className() {
31 return 'InternalConnectionPointRef';
32 }
33
34 static get qualifiedType() {
35 return 'vnfd.internal-vld.' + InternalConnectionPointRef.type;
36 }
37
38 constructor(m, parent) {
39 super(m, parent);
40 this.uid = this.id;
41 this.type = InternalConnectionPointRef.type;
42 this.uiState['qualified-type'] = InternalConnectionPointRef.qualifiedType;
43 this.className = InternalConnectionPointRef.className;
44 }
45
46 get key() {
47 return this.model['id-ref'];
48 }
49
50 get idRef() {
51 return this.model['id-ref'];
52 }
53
54 set idRef(id) {
55 return this.model['id-ref'] = id;
56 }
57
58 get cpNumber() {
59 return this.uiState.cpNumber;
60 }
61
62 set cpNumber(n) {
63 this.uiState.cpNumber = n;
64 }
65
66 remove() {
67 return this.parent.removeInternalConnectionPointRefForId(this.idRef);
68 }
69
70 }