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 * ============LICENSE_START=======================================================
24 * ================================================================================
25 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
26 * ================================================================================
27 * Licensed under the Apache License, Version 2.0 (the "License");
28 * you may not use this file except in compliance with the License.
29 * You may obtain a copy of the License at
31 * http://www.apache.org/licenses/LICENSE-2.0
33 * Unless required by applicable law or agreed to in writing, software
34 * distributed under the License is distributed on an "AS IS" BASIS,
35 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
36 * See the License for the specific language governing permissions and
37 * limitations under the License.
38 * ============LICENSE_END=========================================================
42 import org.janusgraph.core.Cardinality;
43 import org.onap.aai.edges.EdgeIngestor;
44 import org.onap.aai.introspection.LoaderFactory;
45 import org.onap.aai.migration.Enabled;
46 import org.onap.aai.migration.MigrationDangerRating;
47 import org.onap.aai.migration.MigrationPriority;
48 import org.onap.aai.migration.PropertyMigrator;
49 import org.onap.aai.serialization.db.EdgeSerializer;
50 import org.onap.aai.serialization.engines.TransactionalGraphEngine;
51 import org.onap.aai.setup.SchemaVersions;
53 import java.util.Optional;
56 @MigrationPriority(19)
57 @MigrationDangerRating(2)
59 public class MigrateInstanceGroupModelInvariantId extends PropertyMigrator {
61 private static final String INSTANCE_GROUP_NODE_TYPE = "instance-group";
62 private static final String INSTANCE_GROUP_MODEL_INVARIANT_ID_PROPERTY = "model-invariant-id";
63 private static final String INSTANCE_GROUP_MODEL_INVARIANT_ID_LOCAL_PROPERTY = "model-invariant-id-local";
65 public MigrateInstanceGroupModelInvariantId(TransactionalGraphEngine engine, LoaderFactory loaderFactory, EdgeIngestor edgeIngestor, EdgeSerializer edgeSerializer, SchemaVersions schemaVersions) {
66 super(engine, loaderFactory, edgeIngestor, edgeSerializer, schemaVersions);
67 this.initialize(INSTANCE_GROUP_MODEL_INVARIANT_ID_PROPERTY, INSTANCE_GROUP_MODEL_INVARIANT_ID_LOCAL_PROPERTY,
68 String.class, Cardinality.SINGLE);
72 public Optional<String[]> getAffectedNodeTypes() {
73 return Optional.of(new String[]{this.INSTANCE_GROUP_NODE_TYPE});
77 public String getMigrationName() {
78 return "MigrateInstanceGroupModelInvariantId";
82 public boolean isIndexed() {