add v16 to local config for graphadmin
[aai/graphadmin.git] / src / main / java / org / onap / aai / migration / v13 / MigrateVnfcModelVersionId.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
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
10  *
11  *    http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  */
20 package org.onap.aai.migration.v13;
21
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;
33
34
35 @MigrationPriority(19)
36 @MigrationDangerRating(2)
37 //@Enabled
38 public class MigrateVnfcModelVersionId extends PropertyMigrator {
39
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";
43
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);
47     }
48
49     @Override
50     public Optional<String[]> getAffectedNodeTypes() {
51         return Optional.of(new String[]{this.VNFC_NODE_TYPE});
52     }
53
54     @Override
55     public String getMigrationName() {
56         return "MigrateVnfcModelVersionId";
57     }
58
59     @Override
60     public boolean isIndexed() {
61         return true;
62     }
63 }