import java.util.Arrays;
import java.util.Objects;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.EqualsBuilder;
public class VduArtifact {
private byte[] content;
private ArtifactType type;
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof VduArtifact)) {
+ return false;
+ }
+ VduArtifact castOther = (VduArtifact) other;
+ return new EqualsBuilder().append(name, castOther.name).append(content, castOther.content)
+ .append(type, castOther.type).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(name).append(content).append(type).toHashCode();
+ }
+
// Default constructor
public VduArtifact() {}
this.type = type;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- VduArtifact that = (VduArtifact) o;
- return Objects.equals(name, that.name) &&
- Arrays.equals(content, that.content) &&
- type == that.type;
- }
+
}
List<Pserver> getPhysicalServerByVnfId(String vnfId, String transactionLoggingUuid) throws UnsupportedEncodingException, JsonParseException, JsonMappingException, IOException;
- void updateMaintenceFlag(String vnfId,boolean inMaint, String transactionLoggingUuid) throws Exception;
-
void updateMaintenceFlagVnfId(String vnfId, boolean inMaint, String transactionLoggingUuid) throws Exception;
GenericVnf getVnfByName(String vnfId, String transactionLoggingUuid) throws Exception;
return results;
}
- @Override
- public void updateMaintenceFlag(String vnfName, boolean inMaint, String transactionLoggingUuid) throws IOException {
- UUID requestId;
- try {
- requestId = UUID.fromString(transactionLoggingUuid);
- } catch (IllegalArgumentException e) {
- logger.warn("could not parse uuid: " + transactionLoggingUuid + " creating valid uuid automatically");
- requestId = UUID.randomUUID();
- }
- GenericVnfs genericVnfs = new AAIResourcesClient(ENDPOINT_VERSION).get(GenericVnfs.class,
- AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName)).orElse(null);
- if (genericVnfs.getGenericVnf().size() > 1) {
- throw new IndexOutOfBoundsException("Multiple Generic Vnfs Returned");
- }
-
- GenericVnf genericVnf = genericVnfs.getGenericVnf().get(0);
- updateMaintenceFlagVnfId(genericVnf.getVnfId(), inMaint, transactionLoggingUuid);
- }
-
@Override
public void updateMaintenceFlagVnfId(String vnfId, boolean inMaint, String transactionLoggingUuid)
throws IOException {