diff options
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src')
10 files changed, 128 insertions, 86 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/EnrichmentArtifactsServiceFactory.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/EnrichmentArtifactsServiceFactory.java deleted file mode 100644 index 63daa03f15..0000000000 --- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/EnrichmentArtifactsServiceFactory.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.core.enrichment; - -import org.openecomp.core.enrichment.enrichmentartifacts.EnrichmentArtifactsService; -import org.openecomp.core.factory.api.AbstractComponentFactory; -import org.openecomp.core.factory.api.AbstractFactory; - -public abstract class EnrichmentArtifactsServiceFactory - extends AbstractComponentFactory<EnrichmentArtifactsService> { - - public static EnrichmentArtifactsServiceFactory getInstance() { - return AbstractFactory.getInstance(EnrichmentArtifactsServiceFactory.class); - } -} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/api/EnrichmentManager.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/api/EnrichmentManager.java index 2ddde6001b..1185527c03 100644 --- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/api/EnrichmentManager.java +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/api/EnrichmentManager.java @@ -27,17 +27,20 @@ import org.openecomp.sdc.versioning.dao.types.Version; import java.util.List; import java.util.Map; -public interface EnrichmentManager<T> { +public interface + +EnrichmentManager<T> { - Map<String, List<ErrorMessage>> enrich(); - void addEntityInput(String type, EntityInfo info); + Map<String, List<ErrorMessage>> enrich(); - void initInput(String key, Version version); + void addEntityInfo(String entityKey, EntityInfo entityInfo); - void addModel(T model); + void init(String key, Version version); T getModel(); + void setModel(T model); + } diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/enrichmentartifacts/EnrichmentArtifactsService.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/enrichmentartifacts/EnrichmentArtifactsService.java deleted file mode 100644 index 0eab0a916c..0000000000 --- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/enrichmentartifacts/EnrichmentArtifactsService.java +++ /dev/null @@ -1,29 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.core.enrichment.enrichmentartifacts; - -import org.openecomp.core.utilities.file.FileContentHandler; -import org.openecomp.sdc.versioning.dao.types.Version; - -public interface EnrichmentArtifactsService { - - FileContentHandler addMibs(String vspId, Version version); -} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/factory/EnrichmentManagerFactory.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/factory/EnrichmentManagerFactory.java index 9199aeff6c..9d72a88fa9 100644 --- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/factory/EnrichmentManagerFactory.java +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/factory/EnrichmentManagerFactory.java @@ -24,6 +24,9 @@ import org.openecomp.core.enrichment.api.EnrichmentManager; import org.openecomp.core.factory.api.AbstractComponentFactory; import org.openecomp.core.factory.api.AbstractFactory; + + + public abstract class EnrichmentManagerFactory extends AbstractComponentFactory<EnrichmentManager> { public static EnrichmentManagerFactory getInstance() { diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ArtifactCategory.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ArtifactCategory.java new file mode 100644 index 0000000000..555debfd34 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ArtifactCategory.java @@ -0,0 +1,77 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.core.enrichment.types; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + + +public enum ArtifactCategory { + + INFORMATIONAL("Informational"), + DEPLOYMENT("Deployment"); + + private static final Map<String, ArtifactCategory> mMap = + Collections.unmodifiableMap(initializeMapping()); + private String displayName; + + ArtifactCategory(String displayName) { + this.displayName = displayName; + } + + /** + * Initialize mapping map. + * + * @return the map + */ + public static Map<String, ArtifactCategory> initializeMapping() { + Map<String, ArtifactCategory> typeMap = new HashMap<>(); + for (ArtifactCategory v : ArtifactCategory.values()) { + typeMap.put(v.displayName, v); + } + return typeMap; + } + + /** + * Gets artifact type by display name. + * + * @param displayName the display name + * @return the artifact type by display name + */ + public static ArtifactCategory getArtifactTypeByDisplayName(String displayName) { + if (mMap.containsKey(displayName)) { + return mMap.get(displayName); + } + return null; + } + + /** + * Gets display name. + * + * @return the display name + */ + public String getDisplayName() { + return displayName; + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentArtifactType.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ArtifactType.java index c91cff0e1e..48805d7ca5 100644 --- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentArtifactType.java +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ArtifactType.java @@ -20,15 +20,11 @@ package org.openecomp.core.enrichment.types; -public enum ComponentArtifactType { +public enum ArtifactType { SNMP_POLL, SNMP_TRAP; - public static ComponentArtifactType getComponentArtifactType(boolean isTrap) { - return isTrap ? SNMP_TRAP : SNMP_POLL; - } - } diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/CeilometerInfo.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/CeilometerMetric.java index 71c1ff5cec..ff75fba780 100644 --- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/CeilometerInfo.java +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/CeilometerMetric.java @@ -20,7 +20,7 @@ package org.openecomp.core.enrichment.types; -public class CeilometerInfo { +public class CeilometerMetric { private String name; private String type; diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentCeilometerInfo.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/CeilometerMetrics.java index a0c1be51e9..f213986bdf 100644 --- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentCeilometerInfo.java +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/CeilometerMetrics.java @@ -22,15 +22,15 @@ package org.openecomp.core.enrichment.types; import java.util.List; -public class ComponentCeilometerInfo { +public class CeilometerMetrics { - private List<CeilometerInfo> ceilometerInfoList; + private List<CeilometerMetric> ceilometerMetricList; - public List<CeilometerInfo> getCeilometerInfoList() { - return ceilometerInfoList; + public List<CeilometerMetric> getCeilometerMetricList() { + return ceilometerMetricList; } - public void setCeilometerInfoList(List<CeilometerInfo> ceilometerInfoList) { - this.ceilometerInfoList = ceilometerInfoList; + public void setCeilometerMetricList(List<CeilometerMetric> ceilometerMetricList) { + this.ceilometerMetricList = ceilometerMetricList; } } diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentProcessInfo.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentProcessInfo.java new file mode 100644 index 0000000000..5bc23da3de --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentProcessInfo.java @@ -0,0 +1,26 @@ +package org.openecomp.core.enrichment.types; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; + +public class ComponentProcessInfo { + private String name; + private byte[] content; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public InputStream getContent() { + return new ByteArrayInputStream(this.content); + } + + public void setContent(byte[] content) { + this.content = content; + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/EnrichmentConstants.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/InformationArtifactFolderNames.java index c3726aa4e9..68f0db3524 100644 --- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/EnrichmentConstants.java +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/InformationArtifactFolderNames.java @@ -18,12 +18,11 @@ * ============LICENSE_END========================================================= */ -package org.openecomp.core.enrichment; +package org.openecomp.core.enrichment.types; -import java.io.File; - -public final class EnrichmentConstants { - public static final String EXTERNAL_ARTIFACTS_DIR = - "Artifacts" + File.separator + "ExternalArtifacts"; - //public static final String HEAT_META_FILNAME = "HEAT.meta"; +/** + * Created by Talio on 12/5/2016. + */ +public enum InformationArtifactFolderNames { + Guide; } |