* ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
- * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017-2018 European Software Marketing Ltd.
+ * Copyright © 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2019 European Software Marketing Ltd.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import java.util.Collections;
import java.util.EnumMap;
import java.util.HashSet;
+import java.util.Map;
import java.util.Properties;
import java.util.Set;
import org.onap.aai.babel.logging.ApplicationMsgs;
public abstract class Widget extends Model {
- public static final String GENERATOR_AAI_CONFIGLPROP_NOT_FOUND = "Cannot generate artifacts. Widget configuration not found for %s";
+ public static final String GENERATOR_AAI_CONFIGLPROP_NOT_FOUND =
+ "Cannot generate artifacts. Widget configuration not found for %s";
public enum Type {
- SERVICE, VF, VFC, VSERVER, VOLUME, FLAVOR, TENANT, VOLUME_GROUP, LINT, L3_NET, VFMODULE, IMAGE, OAM_NETWORK, ALLOTTED_RESOURCE, TUNNEL_XCONNECT, CONFIGURATION, CR;
+ SERVICE, VF, VFC, VSERVER, VOLUME, FLAVOR, TENANT, VOLUME_GROUP, LINT, L3_NET, VFMODULE, IMAGE, OAM_NETWORK, ALLOTTED_RESOURCE, TUNNEL_XCONNECT, CONFIGURATION, CR, INSTANCE_GROUP;
}
private static Logger log = LogHelper.INSTANCE;
typeToWidget.put(Type.TUNNEL_XCONNECT, TunnelXconnectWidget.class);
typeToWidget.put(Type.CONFIGURATION, ConfigurationWidget.class);
typeToWidget.put(Type.CR, CRWidget.class);
+ typeToWidget.put(Type.INSTANCE_GROUP, InstanceGroupWidget.class);
}
/**
return widget;
}
+ @Override
+ public boolean isResource() {
+ return false;
+ }
+
public String getId() {
- Properties properties = WidgetConfigurationUtil.getConfig();
- String id = properties.getProperty(ArtifactType.AAI.name() + ".model-version-id." + getName());
+ String id = WidgetConfigurationUtil.getConfig()
+ .getProperty(ArtifactType.AAI.name() + ".model-version-id." + getName());
if (id == null) {
throw new IllegalArgumentException(String.format(GENERATOR_AAI_CONFIGLPROP_NOT_FOUND,
ArtifactType.AAI.name() + ".model-version-id." + getName()));
}
public String getName() {
- ModelWidget widgetModel = this.getClass().getAnnotation(ModelWidget.class);
- return widgetModel.name();
+ return this.getClass().getAnnotation(ModelWidget.class).name();
}
/**
return true;
}
+ @Override
+ public Map<String, Object> getProperties() {
+ return Collections.emptyMap();
+ }
}