public class Loop implements Serializable {
/**
- *
+ * The serial version id.
*/
private static final long serialVersionUID = -286522707701388642L;
@Column(name = "dcae_blueprint_id")
private String dcaeBlueprintId;
- @Column(name = "svg_representation")
+ @Column(columnDefinition = "MEDIUMTEXT", name = "svg_representation")
private String svgRepresentation;
@Expose
@Expose
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
- @JoinTable(name = "loops_microservicepolicies", joinColumns = @JoinColumn(name = "loop_id"), inverseJoinColumns = @JoinColumn(name = "microservicepolicy_id"))
+ @JoinTable(name = "loops_microservicepolicies", joinColumns = @JoinColumn(name = "loop_id"),
+ inverseJoinColumns = @JoinColumn(name = "microservicepolicy_id"))
private Set<MicroServicePolicy> microServicePolicies = new HashSet<>();
@Expose
public Loop() {
}
+ /**
+ * Constructor.
+ */
public Loop(String name, String blueprint, String svgRepresentation) {
this.name = name;
this.svgRepresentation = svgRepresentation;
return dcaeDeploymentId;
}
- void setDcaeDeploymentId(String dcaeDeploymentId) {
+ public void setDcaeDeploymentId(String dcaeDeploymentId) {
this.dcaeDeploymentId = dcaeDeploymentId;
}
return dcaeDeploymentStatusUrl;
}
- void setDcaeDeploymentStatusUrl(String dcaeDeploymentStatusUrl) {
+ public void setDcaeDeploymentStatusUrl(String dcaeDeploymentStatusUrl) {
this.dcaeDeploymentStatusUrl = dcaeDeploymentStatusUrl;
}
this.blueprint = blueprint;
}
- LoopState getLastComputedState() {
+ public LoopState getLastComputedState() {
return lastComputedState;
}
- void setLastComputedState(LoopState lastComputedState) {
+ public void setLastComputedState(LoopState lastComputedState) {
this.lastComputedState = lastComputedState;
}
this.operationalPolicies = operationalPolicies;
}
- Set<MicroServicePolicy> getMicroServicePolicies() {
+ public Set<MicroServicePolicy> getMicroServicePolicies() {
return microServicePolicies;
}
log.setLoop(this);
}
- String getDcaeBlueprintId() {
+ public String getDcaeBlueprintId() {
return dcaeBlueprintId;
}
this.dcaeBlueprintId = dcaeBlueprintId;
}
- JsonObject getModelPropertiesJson() {
+ public JsonObject getModelPropertiesJson() {
return modelPropertiesJson;
}
this.modelPropertiesJson = modelPropertiesJson;
}
+ /**
+ * Generate the loop name.
+ * @param serviceName The service name
+ * @param serviceVersion The service version
+ * @param resourceName The resource name
+ * @param blueprintFileName The blueprint file name
+ * @return The generated loop name
+ */
public static String generateLoopName(String serviceName, String serviceVersion, String resourceName,
String blueprintFilename) {
StringBuilder buffer = new StringBuilder("LOOP_").append(serviceName).append("_v").append(serviceVersion)
@Override
public boolean equals(Object obj) {
- if (this == obj)
+ if (this == obj) {
return true;
- if (obj == null)
+ }
+ if (obj == null) {
return false;
- if (getClass() != obj.getClass())
+ }
+ if (getClass() != obj.getClass()) {
return false;
+ }
Loop other = (Loop) obj;
if (name == null) {
- if (other.name != null)
+ if (other.name != null) {
return false;
- } else if (!name.equals(other.name))
+ }
+ } else if (!name.equals(other.name)) {
return false;
+ }
return true;
}