/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2021-2022 Nordix Foundation.
+ * Copyright (C) 2021-2023 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.policy.clamp.models.acm.concepts;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.function.UnaryOperator;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
+import org.onap.policy.models.base.PfUtils;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeTemplate;
// The definition of the Automation Composition Element in TOSCA
private ToscaNodeTemplate automationCompositionElementToscaNodeTemplate;
+ private Map<String, Object> outProperties = new LinkedHashMap<>();
+
/**
* Copy constructor, does a deep copy but as all fields here are immutable, it's just a regular copy.
*
this.acElementDefinitionId = acElementDefinition.acElementDefinitionId;
this.automationCompositionElementToscaNodeTemplate =
new ToscaNodeTemplate(acElementDefinition.automationCompositionElementToscaNodeTemplate);
+ this.outProperties = PfUtils.mapMap(acElementDefinition.outProperties, UnaryOperator.identity());
}
}
package org.onap.policy.clamp.models.acm.concepts;
+import java.util.LinkedHashMap;
+import java.util.Map;
import java.util.UUID;
+import java.util.function.UnaryOperator;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
+import org.onap.policy.models.base.PfUtils;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
@NoArgsConstructor
private String message;
+ private Map<String, Object> outProperties = new LinkedHashMap<>();
+
/**
* Copy constructor, does a deep copy but as all fields here are immutable, it's just a regular copy.
*
this.restarting = copyConstructor.restarting;
this.state = copyConstructor.state;
this.message = copyConstructor.message;
+ this.outProperties = PfUtils.mapMap(copyConstructor.outProperties, UnaryOperator.identity());
}
}
package org.onap.policy.clamp.models.acm.persistence.concepts;
+import java.util.Map;
import java.util.UUID;
+import java.util.function.UnaryOperator;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
+import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
+import javax.persistence.Lob;
import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.onap.policy.clamp.models.acm.concepts.AcTypeState;
import org.onap.policy.clamp.models.acm.concepts.NodeTemplateState;
import org.onap.policy.common.parameters.annotations.NotNull;
+import org.onap.policy.common.parameters.annotations.Valid;
import org.onap.policy.models.base.PfAuthorative;
import org.onap.policy.models.base.PfConceptKey;
+import org.onap.policy.models.base.PfUtils;
import org.onap.policy.models.base.Validated;
import org.onap.policy.models.base.validation.annotations.VerifyKey;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
@Column
private String message;
+ @Lob
+ @NotNull
+ @Valid
+ @Convert(converter = StringToMapConverter.class)
+ private Map<String, Object> outProperties;
+
/**
* The Default Constructor.
*/
this.restarting = copyConcept.getRestarting();
this.state = copyConcept.getState();
this.message = copyConcept.getMessage();
+ this.outProperties = PfUtils.mapMap(copyConcept.getOutProperties(), UnaryOperator.identity());
}
@Override
nodeTemplateState.setRestarting(this.restarting);
nodeTemplateState.setState(this.state);
nodeTemplateState.setMessage(this.message);
+ nodeTemplateState.setOutProperties(PfUtils.mapMap(outProperties, UnaryOperator.identity()));
return nodeTemplateState;
}
}