import org.onap.clamp.loop.template.LoopElementModel;
@MappedSuperclass
-@TypeDefs({ @TypeDef(name = "json", typeClass = StringJsonUserType.class) })
+@TypeDefs({@TypeDef(name = "json", typeClass = StringJsonUserType.class)})
public abstract class Policy extends AuditEntity {
@Expose
@Column(columnDefinition = "json", name = "configurations_json")
private JsonObject configurationsJson;
+ /**
+ * This attribute can be null when the user add a policy on the loop instance, not the template.
+ * When null, It therefore indicates that this policy is not by default in the loop template.
+ */
@Expose
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "loop_element_model_id")
@Column(name = "pdp_group")
private String pdpGroup;
+ @Expose
+ @Column(name = "pdp_sub_group")
+ private String pdpSubGroup;
+
public abstract String createPolicyPayload() throws UnsupportedEncodingException;
/**
* Name getter.
- *
+ *
* @return the name
*/
public abstract String getName();
/**
* Name setter.
- *
*/
public abstract void setName(String name);
/**
* jsonRepresentation getter.
- *
+ *
* @return the jsonRepresentation
*/
public JsonObject getJsonRepresentation() {
/**
* jsonRepresentation setter.
- *
+ *
* @param jsonRepresentation The jsonRepresentation to set
*/
public void setJsonRepresentation(JsonObject jsonRepresentation) {
/**
* configurationsJson getter.
- *
+ *
* @return The configurationsJson
*/
public JsonObject getConfigurationsJson() {
/**
* configurationsJson setter.
- *
+ *
* @param configurationsJson the configurationsJson to set
*/
public void setConfigurationsJson(JsonObject configurationsJson) {
/**
* loopElementModel getter.
- *
+ *
* @return the loopElementModel
*/
public LoopElementModel getLoopElementModel() {
/**
* loopElementModel setter.
- *
+ *
* @param loopElementModel the loopElementModel to set
*/
public void setLoopElementModel(LoopElementModel loopElementModel) {
/**
* pdpGroup getter.
- *
+ *
* @return the pdpGroup
*/
public String getPdpGroup() {
/**
* pdpGroup setter.
- *
+ *
* @param pdpGroup the pdpGroup to set
*/
public void setPdpGroup(String pdpGroup) {
this.pdpGroup = pdpGroup;
}
+ /**
+ * pdpSubGroup getter.
+ *
+ * @return the pdpSubGroup
+ */
+ public String getPdpSubGroup() {
+ return pdpSubGroup;
+ }
+
+ /**
+ * pdpSubGroup setter.
+ *
+ * @param pdpSubGroup the pdpSubGroup to set
+ */
+ public void setPdpSubGroup(String pdpSubGroup) {
+ this.pdpSubGroup = pdpSubGroup;
+ }
+
/**
* Generate the policy name.
*
* @return The generated policy name
*/
public static String generatePolicyName(String policyType, String serviceName, String serviceVersion,
- String resourceName, String blueprintFilename) {
+ String resourceName, String blueprintFilename) {
StringBuilder buffer = new StringBuilder(policyType).append("_").append(serviceName).append("_v")
.append(serviceVersion).append("_").append(resourceName).append("_")
.append(blueprintFilename.replaceAll(".yaml", ""));