/*- * ============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.core.impl; import org.openecomp.ncomp.core.CoreFactory; import org.openecomp.ncomp.core.CorePackage; import org.openecomp.ncomp.core.DeploymentStatus; import org.openecomp.ncomp.core.Event; import org.openecomp.ncomp.core.HasOperationalState; import org.openecomp.ncomp.core.NamedEntity; import org.openecomp.ncomp.core.OperationalState; import org.openecomp.ncomp.core.User; import org.openecomp.ncomp.core.types.metrics.DateMetricAttribute; import org.openecomp.ncomp.core.types.metrics.DoubleMetricAttribute; import org.openecomp.ncomp.core.types.metrics.IncreasingULongMetricAttribute; import org.openecomp.ncomp.core.types.metrics.LongMetricAttribute; import org.openecomp.ncomp.core.types.metrics.StringMetricAttribute; import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EDataType; import org.eclipse.emf.ecore.EEnum; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EcorePackage; import org.eclipse.emf.ecore.impl.EPackageImpl; import org.json.JSONObject; /** * * An implementation of the model Package. * * @generated */ public class CorePackageImpl extends EPackageImpl implements CorePackage { /** * * * @generated */ private EClass namedEntityEClass = null; /** * * * @generated */ private EClass eventEClass = null; /** * * * @generated */ private EClass hasOperationalStateEClass = null; /** * * * @generated */ private EClass userEClass = null; /** * * * @generated */ private EEnum operationalStateEEnum = null; /** * * * @generated */ private EEnum deploymentStatusEEnum = null; /** * * * @generated */ private EDataType jsonObjectEDataType = null; /** * * * @generated */ private EDataType remoteContextEDataType = null; /** * * * @generated */ private EDataType increasingULongMetricAttributeEDataType = null; /** * * * @generated */ private EDataType longMetricAttributeEDataType = null; /** * * * @generated */ private EDataType doubleMetricAttributeEDataType = null; /** * * * @generated */ private EDataType stringMetricAttributeEDataType = null; /** * * * @generated */ private EDataType dateMetricAttributeEDataType = null; /** * Creates an instance of the model Package, registered with * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package * package URI value. *

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. * * * @see org.eclipse.emf.ecore.EPackage.Registry * @see org.openecomp.ncomp.core.CorePackage#eNS_URI * @see #init() * @generated */ private CorePackageImpl() { super(eNS_URI, CoreFactory.eINSTANCE); } /** * * * @generated */ private static boolean isInited = false; /** * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. * *

This method is used to initialize {@link CorePackage#eINSTANCE} when that field is accessed. * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. * * * @see #eNS_URI * @see #createPackageContents() * @see #initializePackageContents() * @generated */ public static CorePackage init() { if (isInited) return (CorePackage)EPackage.Registry.INSTANCE.getEPackage(CorePackage.eNS_URI); // Obtain or create and register package CorePackageImpl theCorePackage = (CorePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof CorePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new CorePackageImpl()); isInited = true; // Initialize simple dependencies EcorePackage.eINSTANCE.eClass(); // Create package meta-data objects theCorePackage.createPackageContents(); // Initialize created meta-data theCorePackage.initializePackageContents(); // Mark meta-data to indicate it can't be changed theCorePackage.freeze(); // Update the registry and return the package EPackage.Registry.INSTANCE.put(CorePackage.eNS_URI, theCorePackage); return theCorePackage; } /** * * * @generated */ public EClass getNamedEntity() { return namedEntityEClass; } /** * * * @generated */ public EAttribute getNamedEntity_Name() { return (EAttribute)namedEntityEClass.getEStructuralFeatures().get(0); } /** * * * @generated */ public EAttribute getNamedEntity_LastPolled() { return (EAttribute)namedEntityEClass.getEStructuralFeatures().get(1); } /** * * * @generated */ public EAttribute getNamedEntity_LastChanged() { return (EAttribute)namedEntityEClass.getEStructuralFeatures().get(2); } /** * * * @generated */ public EAttribute getNamedEntity_Created() { return (EAttribute)namedEntityEClass.getEStructuralFeatures().get(3); } /** * * * @generated */ public EClass getEvent() { return eventEClass; } /** * * * @generated */ public EClass getHasOperationalState() { return hasOperationalStateEClass; } /** * * * @generated */ public EAttribute getHasOperationalState_OperationalState() { return (EAttribute)hasOperationalStateEClass.getEStructuralFeatures().get(0); } /** * * * @generated */ public EClass getUser() { return userEClass; } /** * * * @generated */ public EAttribute getUser_PublicKey() { return (EAttribute)userEClass.getEStructuralFeatures().get(0); } /** * * * @generated */ public EAttribute getUser_DeploymentStatus() { return (EAttribute)userEClass.getEStructuralFeatures().get(1); } /** * * * @generated */ public EEnum getOperationalState() { return operationalStateEEnum; } /** * * * @generated */ public EEnum getDeploymentStatus() { return deploymentStatusEEnum; } /** * * * @generated */ public EDataType getJsonObject() { return jsonObjectEDataType; } /** * * * @generated */ public EDataType getRemoteContext() { return remoteContextEDataType; } /** * * * @generated */ public EDataType getIncreasingULongMetricAttribute() { return increasingULongMetricAttributeEDataType; } /** * * * @generated */ public EDataType getLongMetricAttribute() { return longMetricAttributeEDataType; } /** * * * @generated */ public EDataType getDoubleMetricAttribute() { return doubleMetricAttributeEDataType; } /** * * * @generated */ public EDataType getStringMetricAttribute() { return stringMetricAttributeEDataType; } /** * * * @generated */ public EDataType getDateMetricAttribute() { return dateMetricAttributeEDataType; } /** * * * @generated */ public CoreFactory getCoreFactory() { return (CoreFactory)getEFactoryInstance(); } /** * * * @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. * * * @generated */ public void createPackageContents() { if (isCreated) return; isCreated = true; // Create classes and their features namedEntityEClass = createEClass(NAMED_ENTITY); createEAttribute(namedEntityEClass, NAMED_ENTITY__NAME); createEAttribute(namedEntityEClass, NAMED_ENTITY__LAST_POLLED); createEAttribute(namedEntityEClass, NAMED_ENTITY__LAST_CHANGED); createEAttribute(namedEntityEClass, NAMED_ENTITY__CREATED); eventEClass = createEClass(EVENT); hasOperationalStateEClass = createEClass(HAS_OPERATIONAL_STATE); createEAttribute(hasOperationalStateEClass, HAS_OPERATIONAL_STATE__OPERATIONAL_STATE); userEClass = createEClass(USER); createEAttribute(userEClass, USER__PUBLIC_KEY); createEAttribute(userEClass, USER__DEPLOYMENT_STATUS); // Create enums operationalStateEEnum = createEEnum(OPERATIONAL_STATE); deploymentStatusEEnum = createEEnum(DEPLOYMENT_STATUS); // Create data types jsonObjectEDataType = createEDataType(JSON_OBJECT); remoteContextEDataType = createEDataType(REMOTE_CONTEXT); increasingULongMetricAttributeEDataType = createEDataType(INCREASING_ULONG_METRIC_ATTRIBUTE); longMetricAttributeEDataType = createEDataType(LONG_METRIC_ATTRIBUTE); doubleMetricAttributeEDataType = createEDataType(DOUBLE_METRIC_ATTRIBUTE); stringMetricAttributeEDataType = createEDataType(STRING_METRIC_ATTRIBUTE); dateMetricAttributeEDataType = createEDataType(DATE_METRIC_ATTRIBUTE); } /** * * * @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. * * * @generated */ public void initializePackageContents() { if (isInitialized) return; isInitialized = true; // Initialize package setName(eNAME); setNsPrefix(eNS_PREFIX); setNsURI(eNS_URI); // Obtain other dependent packages EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); // Create type parameters // Set bounds for type parameters // Add supertypes to classes userEClass.getESuperTypes().add(this.getNamedEntity()); // Initialize classes, features, and operations; add parameters initEClass(namedEntityEClass, NamedEntity.class, "NamedEntity", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getNamedEntity_Name(), theEcorePackage.getEString(), "name", null, 0, 1, NamedEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getNamedEntity_LastPolled(), theEcorePackage.getEDate(), "lastPolled", null, 0, 1, NamedEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getNamedEntity_LastChanged(), theEcorePackage.getEDate(), "lastChanged", null, 0, 1, NamedEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getNamedEntity_Created(), theEcorePackage.getEDate(), "created", null, 0, 1, NamedEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(eventEClass, Event.class, "Event", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(hasOperationalStateEClass, HasOperationalState.class, "HasOperationalState", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getHasOperationalState_OperationalState(), this.getOperationalState(), "operationalState", null, 0, 1, HasOperationalState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(userEClass, User.class, "User", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getUser_PublicKey(), theEcorePackage.getEString(), "publicKey", null, 0, 1, User.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getUser_DeploymentStatus(), this.getDeploymentStatus(), "deploymentStatus", null, 0, 1, User.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); // Initialize enums and add enum literals initEEnum(operationalStateEEnum, OperationalState.class, "OperationalState"); addEEnumLiteral(operationalStateEEnum, OperationalState.OPERATIONAL); addEEnumLiteral(operationalStateEEnum, OperationalState.SUSPENDED); initEEnum(deploymentStatusEEnum, DeploymentStatus.class, "DeploymentStatus"); addEEnumLiteral(deploymentStatusEEnum, DeploymentStatus.UNDEPLOYED); addEEnumLiteral(deploymentStatusEEnum, DeploymentStatus.DEPLOYED); addEEnumLiteral(deploymentStatusEEnum, DeploymentStatus.DEPLOYED_PARTIALLY); addEEnumLiteral(deploymentStatusEEnum, DeploymentStatus.DEPLOYED_ERRORS); // Initialize data types initEDataType(jsonObjectEDataType, JSONObject.class, "JsonObject", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType(remoteContextEDataType, JSONObject.class, "RemoteContext", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType(increasingULongMetricAttributeEDataType, IncreasingULongMetricAttribute.class, "IncreasingULongMetricAttribute", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType(longMetricAttributeEDataType, LongMetricAttribute.class, "LongMetricAttribute", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType(doubleMetricAttributeEDataType, DoubleMetricAttribute.class, "DoubleMetricAttribute", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType(stringMetricAttributeEDataType, StringMetricAttribute.class, "StringMetricAttribute", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType(dateMetricAttributeEDataType, DateMetricAttribute.class, "DateMetricAttribute", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); // Create resource createResource(eNS_URI); // Create annotations // http://www.eclipse.org/emf/2011/Xcore createXcoreAnnotations(); // http://openecomp.org createOpenecompAnnotations(); } /** * Initializes the annotations for http://www.eclipse.org/emf/2011/Xcore. * * * @generated */ protected void createXcoreAnnotations() { String source = "http://www.eclipse.org/emf/2011/Xcore"; addAnnotation (this, source, new String[] { "ecomp", "http://openecomp.org" }); } /** * Initializes the annotations for http://openecomp.org. * * * @generated */ protected void createOpenecompAnnotations() { String source = "http://openecomp.org"; addAnnotation (getNamedEntity_Name(), source, new String[] { "type", "configuration" }); } } //CorePackageImpl