summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/utils/component-instance-factory.ts
diff options
context:
space:
mode:
authorTal Gitelman <tg851x@intl.att.com>2017-12-10 18:55:03 +0200
committerTal Gitelman <tg851x@intl.att.com>2017-12-10 19:33:38 +0200
commit51d50f0ef642e0f996a1c8b8d2ef4838bdfec892 (patch)
tree3ac236a864d74d19b0f5c9020891a7a7e5c31b44 /catalog-ui/src/app/utils/component-instance-factory.ts
parentb5cc2e0695f195716d6ccdc65e73807a6632ec70 (diff)
Final commit to master merge from
Change-Id: Ib464f9a8828437c86fe6def8af238aaf83473507 Issue-ID: SDC-714 Signed-off-by: Tal Gitelman <tg851x@intl.att.com>
Diffstat (limited to 'catalog-ui/src/app/utils/component-instance-factory.ts')
-rw-r--r--catalog-ui/src/app/utils/component-instance-factory.ts18
1 files changed, 13 insertions, 5 deletions
diff --git a/catalog-ui/src/app/utils/component-instance-factory.ts b/catalog-ui/src/app/utils/component-instance-factory.ts
index 9e25e6b02f..25916cc055 100644
--- a/catalog-ui/src/app/utils/component-instance-factory.ts
+++ b/catalog-ui/src/app/utils/component-instance-factory.ts
@@ -21,7 +21,8 @@
* Created by obarda on 3/7/2016.
*/
'use strict';
-import {ComponentInstance, ServiceInstance, ResourceInstance, Component} from "../models";
+import {ComponentInstance, ServiceInstance, ResourceInstance, Component, ServiceProxyInstance} from "../models";
+import {ComponentType} from "app/utils";
import {LeftPaletteComponent} from "../models/components/displayComponent";
export class ComponentInstanceFactory {
@@ -29,10 +30,12 @@ export class ComponentInstanceFactory {
static createComponentInstance(componentInstance:ComponentInstance):ComponentInstance {
let newComponentInstance:ComponentInstance;
switch (componentInstance.originType) {
- case 'SERVICE':
+ case ComponentType.SERVICE:
newComponentInstance = new ServiceInstance(componentInstance);
break;
-
+ case ComponentType.SERVICE_PROXY:
+ newComponentInstance = new ServiceProxyInstance(componentInstance);
+ break;
default :
newComponentInstance = new ResourceInstance(componentInstance);
break;
@@ -43,10 +46,12 @@ export class ComponentInstanceFactory {
public createEmptyComponentInstance = (componentInstanceType?:string):ComponentInstance => {
let newComponentInstance:ComponentInstance;
switch (componentInstanceType) {
- case 'SERVICE':
+ case ComponentType.SERVICE:
newComponentInstance = new ServiceInstance();
break;
-
+ case ComponentType.SERVICE_PROXY:
+ newComponentInstance = new ServiceProxyInstance();
+ break;
default :
newComponentInstance = new ResourceInstance();
break;
@@ -62,6 +67,9 @@ export class ComponentInstanceFactory {
newComponentInstance.name = component.name;
newComponentInstance.componentVersion = component.version;
newComponentInstance.originType = component.getComponentSubType();
+ if(component.getComponentSubType() === ComponentType.SERVICE){
+ newComponentInstance.originType = ComponentType.SERVICE_PROXY
+ }
//new component instance -> req. & cap. are added on successful instance creation
newComponentInstance.requirements = component.requirements;
newComponentInstance.capabilities = component.capabilities;