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;
21 import java.util.Optional;
23 import org.onap.aai.edges.EdgeIngestor;
24 import org.onap.aai.introspection.LoaderFactory;
25 import org.onap.aai.migration.Enabled;
26 import org.onap.aai.migration.MigrationDangerRating;
27 import org.onap.aai.migration.MigrationPriority;
28 import org.onap.aai.migration.PropertyMigrator;
29 import org.onap.aai.serialization.db.EdgeSerializer;
30 import org.onap.aai.serialization.engines.TransactionalGraphEngine;
32 import org.janusgraph.core.Cardinality;
33 import org.onap.aai.setup.SchemaVersions;
35 @MigrationPriority(20)
36 @MigrationDangerRating(2)
38 public class MigrateInstanceGroupSubType extends PropertyMigrator{
40 protected static final String SUB_TYPE_PROPERTY = "sub-type";
41 protected static final String INSTANCE_GROUP_ROLE_PROPERTY = "instance-group-role";
42 protected static final String INSTANCE_GROUP_NODE_TYPE = "instance-group";
44 public MigrateInstanceGroupSubType(TransactionalGraphEngine engine, LoaderFactory loaderFactory, EdgeIngestor edgeIngestor, EdgeSerializer edgeSerializer, SchemaVersions schemaVersions) {
45 super(engine, loaderFactory, edgeIngestor, edgeSerializer, schemaVersions);
46 this.initialize(SUB_TYPE_PROPERTY , INSTANCE_GROUP_ROLE_PROPERTY, String.class,Cardinality.SINGLE);
50 public Optional<String[]> getAffectedNodeTypes() {
51 return Optional.of(new String[]{INSTANCE_GROUP_NODE_TYPE});
55 public String getMigrationName() {
56 return "MigrateInstanceGroupSubType";
60 public boolean isIndexed() {