2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 package org.onap.aai.migration.v13;
22 import java.util.Optional;
23 import org.janusgraph.core.Cardinality;
24 import org.onap.aai.edges.EdgeIngestor;
25 import org.onap.aai.introspection.LoaderFactory;
26 import org.onap.aai.migration.Enabled;
27 import org.onap.aai.migration.MigrationDangerRating;
28 import org.onap.aai.migration.MigrationPriority;
29 import org.onap.aai.migration.PropertyMigrator;
30 import org.onap.aai.serialization.db.EdgeSerializer;
31 import org.onap.aai.serialization.engines.TransactionalGraphEngine;
32 import org.onap.aai.setup.SchemaVersions;
35 @MigrationPriority(19)
36 @MigrationDangerRating(2)
38 public class MigrateVnfcModelVersionId extends PropertyMigrator {
40 private static final String VNFC_NODE_TYPE = "vnfc";
41 private static final String VNFC_MODEL_VERSION_ID_PROPERTY = "model-version-id";
42 private static final String VNFC_MODEL_VERSION_ID_LOCAL_PROPERTY = "model-version-id-local";
44 public MigrateVnfcModelVersionId(TransactionalGraphEngine engine, LoaderFactory loaderFactory, EdgeIngestor edgeIngestor, EdgeSerializer edgeSerializer, SchemaVersions schemaVersions) {
45 super(engine, loaderFactory, edgeIngestor, edgeSerializer, schemaVersions);
46 this.initialize(VNFC_MODEL_VERSION_ID_PROPERTY, VNFC_MODEL_VERSION_ID_LOCAL_PROPERTY, String.class, Cardinality.SINGLE);
50 public Optional<String[]> getAffectedNodeTypes() {
51 return Optional.of(new String[]{this.VNFC_NODE_TYPE});
55 public String getMigrationName() {
56 return "MigrateVnfcModelVersionId";
60 public boolean isIndexed() {