diff options
Diffstat (limited to 'ncomp-openstack-model/src/main/xcore-gen/org/openecomp/ncomp/openstack/impl')
3 files changed, 628 insertions, 0 deletions
diff --git a/ncomp-openstack-model/src/main/xcore-gen/org/openecomp/ncomp/openstack/impl/OpenStackControllerImpl.java b/ncomp-openstack-model/src/main/xcore-gen/org/openecomp/ncomp/openstack/impl/OpenStackControllerImpl.java new file mode 100644 index 0000000..b0fcb92 --- /dev/null +++ b/ncomp-openstack-model/src/main/xcore-gen/org/openecomp/ncomp/openstack/impl/OpenStackControllerImpl.java @@ -0,0 +1,269 @@ + +/*- + * ============LICENSE_START========================================== + * OPENECOMP - DCAE + * =================================================================== + * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END============================================ + */ + +/** + */ +package org.openecomp.ncomp.openstack.impl; + +import org.openecomp.ncomp.core.User; +import org.openecomp.ncomp.openstack.OpenStackController; +import org.openecomp.ncomp.openstack.OpenstackPackage; +import org.openecomp.ncomp.openstack.core.VirtualMachineType; +import org.openecomp.ncomp.openstack.location.OpenStackLocation; +import java.lang.reflect.InvocationTargetException; +import java.util.Collection; +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; +import org.json.JSONObject; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Open Stack Controller</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.openecomp.ncomp.openstack.impl.OpenStackControllerImpl#getLocations <em>Locations</em>}</li> + * <li>{@link org.openecomp.ncomp.openstack.impl.OpenStackControllerImpl#getVmTypes <em>Vm Types</em>}</li> + * <li>{@link org.openecomp.ncomp.openstack.impl.OpenStackControllerImpl#getUsers <em>Users</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class OpenStackControllerImpl extends MinimalEObjectImpl.Container implements OpenStackController { + /** + * The cached value of the '{@link #getLocations() <em>Locations</em>}' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getLocations() + * @generated + * @ordered + */ + protected EList<OpenStackLocation> locations; + + /** + * The cached value of the '{@link #getVmTypes() <em>Vm Types</em>}' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getVmTypes() + * @generated + * @ordered + */ + protected EList<VirtualMachineType> vmTypes; + + /** + * The cached value of the '{@link #getUsers() <em>Users</em>}' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getUsers() + * @generated + * @ordered + */ + protected EList<User> users; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected OpenStackControllerImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return OpenstackPackage.Literals.OPEN_STACK_CONTROLLER; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<OpenStackLocation> getLocations() { + if (locations == null) { + locations = new EObjectContainmentEList<OpenStackLocation>(OpenStackLocation.class, this, OpenstackPackage.OPEN_STACK_CONTROLLER__LOCATIONS); + } + return locations; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<VirtualMachineType> getVmTypes() { + if (vmTypes == null) { + vmTypes = new EObjectContainmentEList<VirtualMachineType>(VirtualMachineType.class, this, OpenstackPackage.OPEN_STACK_CONTROLLER__VM_TYPES); + } + return vmTypes; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<User> getUsers() { + if (users == null) { + users = new EObjectContainmentEList<User>(User.class, this, OpenstackPackage.OPEN_STACK_CONTROLLER__USERS); + } + return users; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void uploadOpenstackConfiguration(JSONObject cx, OpenStackLocation loc) { + // TODO: implement this method + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case OpenstackPackage.OPEN_STACK_CONTROLLER__LOCATIONS: + return ((InternalEList<?>)getLocations()).basicRemove(otherEnd, msgs); + case OpenstackPackage.OPEN_STACK_CONTROLLER__VM_TYPES: + return ((InternalEList<?>)getVmTypes()).basicRemove(otherEnd, msgs); + case OpenstackPackage.OPEN_STACK_CONTROLLER__USERS: + return ((InternalEList<?>)getUsers()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case OpenstackPackage.OPEN_STACK_CONTROLLER__LOCATIONS: + return getLocations(); + case OpenstackPackage.OPEN_STACK_CONTROLLER__VM_TYPES: + return getVmTypes(); + case OpenstackPackage.OPEN_STACK_CONTROLLER__USERS: + return getUsers(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case OpenstackPackage.OPEN_STACK_CONTROLLER__LOCATIONS: + getLocations().clear(); + getLocations().addAll((Collection<? extends OpenStackLocation>)newValue); + return; + case OpenstackPackage.OPEN_STACK_CONTROLLER__VM_TYPES: + getVmTypes().clear(); + getVmTypes().addAll((Collection<? extends VirtualMachineType>)newValue); + return; + case OpenstackPackage.OPEN_STACK_CONTROLLER__USERS: + getUsers().clear(); + getUsers().addAll((Collection<? extends User>)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case OpenstackPackage.OPEN_STACK_CONTROLLER__LOCATIONS: + getLocations().clear(); + return; + case OpenstackPackage.OPEN_STACK_CONTROLLER__VM_TYPES: + getVmTypes().clear(); + return; + case OpenstackPackage.OPEN_STACK_CONTROLLER__USERS: + getUsers().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case OpenstackPackage.OPEN_STACK_CONTROLLER__LOCATIONS: + return locations != null && !locations.isEmpty(); + case OpenstackPackage.OPEN_STACK_CONTROLLER__VM_TYPES: + return vmTypes != null && !vmTypes.isEmpty(); + case OpenstackPackage.OPEN_STACK_CONTROLLER__USERS: + return users != null && !users.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException { + switch (operationID) { + case OpenstackPackage.OPEN_STACK_CONTROLLER___UPLOAD_OPENSTACK_CONFIGURATION__JSONOBJECT_OPENSTACKLOCATION: + uploadOpenstackConfiguration((JSONObject)arguments.get(0), (OpenStackLocation)arguments.get(1)); + return null; + } + return super.eInvoke(operationID, arguments); + } + +} //OpenStackControllerImpl diff --git a/ncomp-openstack-model/src/main/xcore-gen/org/openecomp/ncomp/openstack/impl/OpenstackFactoryImpl.java b/ncomp-openstack-model/src/main/xcore-gen/org/openecomp/ncomp/openstack/impl/OpenstackFactoryImpl.java new file mode 100644 index 0000000..02a56d5 --- /dev/null +++ b/ncomp-openstack-model/src/main/xcore-gen/org/openecomp/ncomp/openstack/impl/OpenstackFactoryImpl.java @@ -0,0 +1,116 @@ + +/*- + * ============LICENSE_START========================================== + * OPENECOMP - DCAE + * =================================================================== + * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END============================================ + */ + +/** + */ +package org.openecomp.ncomp.openstack.impl; + +import org.openecomp.ncomp.openstack.*; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EFactoryImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +/** + * <!-- begin-user-doc --> + * An implementation of the model <b>Factory</b>. + * <!-- end-user-doc --> + * @generated + */ +public class OpenstackFactoryImpl extends EFactoryImpl implements OpenstackFactory { + /** + * Creates the default factory implementation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static OpenstackFactory init() { + try { + OpenstackFactory theOpenstackFactory = (OpenstackFactory)EPackage.Registry.INSTANCE.getEFactory(OpenstackPackage.eNS_URI); + if (theOpenstackFactory != null) { + return theOpenstackFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new OpenstackFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public OpenstackFactoryImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case OpenstackPackage.OPEN_STACK_CONTROLLER: return createOpenStackController(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public OpenStackController createOpenStackController() { + OpenStackControllerImpl openStackController = new OpenStackControllerImpl(); + return openStackController; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public OpenstackPackage getOpenstackPackage() { + return (OpenstackPackage)getEPackage(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @deprecated + * @generated + */ + @Deprecated + public static OpenstackPackage getPackage() { + return OpenstackPackage.eINSTANCE; + } + +} //OpenstackFactoryImpl diff --git a/ncomp-openstack-model/src/main/xcore-gen/org/openecomp/ncomp/openstack/impl/OpenstackPackageImpl.java b/ncomp-openstack-model/src/main/xcore-gen/org/openecomp/ncomp/openstack/impl/OpenstackPackageImpl.java new file mode 100644 index 0000000..571822f --- /dev/null +++ b/ncomp-openstack-model/src/main/xcore-gen/org/openecomp/ncomp/openstack/impl/OpenstackPackageImpl.java @@ -0,0 +1,243 @@ + +/*- + * ============LICENSE_START========================================== + * OPENECOMP - DCAE + * =================================================================== + * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END============================================ + */ + +/** + */ +package org.openecomp.ncomp.openstack.impl; + +import org.openecomp.ncomp.openstack.OpenStackController; +import org.openecomp.ncomp.openstack.OpenstackFactory; +import org.openecomp.ncomp.openstack.OpenstackPackage; +import org.openecomp.ncomp.openstack.core.CorePackage; +import org.openecomp.ncomp.openstack.location.LocationPackage; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EOperation; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.impl.EPackageImpl; + +/** + * <!-- begin-user-doc --> + * An implementation of the model <b>Package</b>. + * <!-- end-user-doc --> + * @generated + */ +public class OpenstackPackageImpl extends EPackageImpl implements OpenstackPackage { + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass openStackControllerEClass = null; + + /** + * Creates an instance of the model <b>Package</b>, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + * <p>Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.openecomp.ncomp.openstack.OpenstackPackage#eNS_URI + * @see #init() + * @generated + */ + private OpenstackPackageImpl() { + super(eNS_URI, OpenstackFactory.eINSTANCE); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. + * + * <p>This method is used to initialize {@link OpenstackPackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static OpenstackPackage init() { + if (isInited) return (OpenstackPackage)EPackage.Registry.INSTANCE.getEPackage(OpenstackPackage.eNS_URI); + + // Obtain or create and register package + OpenstackPackageImpl theOpenstackPackage = (OpenstackPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof OpenstackPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new OpenstackPackageImpl()); + + isInited = true; + + // Initialize simple dependencies + LocationPackage.eINSTANCE.eClass(); + + // Create package meta-data objects + theOpenstackPackage.createPackageContents(); + + // Initialize created meta-data + theOpenstackPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theOpenstackPackage.freeze(); + + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(OpenstackPackage.eNS_URI, theOpenstackPackage); + return theOpenstackPackage; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getOpenStackController() { + return openStackControllerEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getOpenStackController_Locations() { + return (EReference)openStackControllerEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getOpenStackController_VmTypes() { + return (EReference)openStackControllerEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getOpenStackController_Users() { + return (EReference)openStackControllerEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getOpenStackController__UploadOpenstackConfiguration__JSONObject_OpenStackLocation() { + return openStackControllerEClass.getEOperations().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public OpenstackFactory getOpenstackFactory() { + return (OpenstackFactory)getEFactoryInstance(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void createPackageContents() { + if (isCreated) return; + isCreated = true; + + // Create classes and their features + openStackControllerEClass = createEClass(OPEN_STACK_CONTROLLER); + createEReference(openStackControllerEClass, OPEN_STACK_CONTROLLER__LOCATIONS); + createEReference(openStackControllerEClass, OPEN_STACK_CONTROLLER__VM_TYPES); + createEReference(openStackControllerEClass, OPEN_STACK_CONTROLLER__USERS); + createEOperation(openStackControllerEClass, OPEN_STACK_CONTROLLER___UPLOAD_OPENSTACK_CONFIGURATION__JSONOBJECT_OPENSTACKLOCATION); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void initializePackageContents() { + if (isInitialized) return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Obtain other dependent packages + LocationPackage theLocationPackage = (LocationPackage)EPackage.Registry.INSTANCE.getEPackage(LocationPackage.eNS_URI); + CorePackage theCorePackage = (CorePackage)EPackage.Registry.INSTANCE.getEPackage(CorePackage.eNS_URI); + org.openecomp.ncomp.core.CorePackage theCorePackage_1 = (org.openecomp.ncomp.core.CorePackage)EPackage.Registry.INSTANCE.getEPackage(org.openecomp.ncomp.core.CorePackage.eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + + // Initialize classes, features, and operations; add parameters + initEClass(openStackControllerEClass, OpenStackController.class, "OpenStackController", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getOpenStackController_Locations(), theLocationPackage.getOpenStackLocation(), null, "locations", null, 0, -1, OpenStackController.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getOpenStackController_VmTypes(), theCorePackage.getVirtualMachineType(), null, "vmTypes", null, 0, -1, OpenStackController.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getOpenStackController_Users(), theCorePackage_1.getUser(), null, "users", null, 0, -1, OpenStackController.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + EOperation op = initEOperation(getOpenStackController__UploadOpenstackConfiguration__JSONObject_OpenStackLocation(), null, "uploadOpenstackConfiguration", 0, 1, !IS_UNIQUE, IS_ORDERED); + addEParameter(op, theCorePackage_1.getRemoteContext(), "cx", 0, 1, !IS_UNIQUE, IS_ORDERED); + addEParameter(op, theLocationPackage.getOpenStackLocation(), "loc", 0, 1, !IS_UNIQUE, IS_ORDERED); + + // Create resource + createResource(eNS_URI); + } + +} //OpenstackPackageImpl |