- package org.onap.vid.model;
-
-
- import com.fasterxml.jackson.annotation.JsonProperty;
- import org.hibernate.annotations.DynamicUpdate;
- import org.hibernate.annotations.SelectBeforeUpdate;
- import org.hibernate.annotations.Type;
- import org.onap.portalsdk.core.domain.support.DomainVo;
- import org.onap.vid.job.Job;
-
- import javax.persistence.*;
- import java.io.Serializable;
- import java.util.Date;
- import java.util.Objects;
- import java.util.Set;
- import java.util.UUID;
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 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.onap.vid.model;
+
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.hibernate.annotations.DynamicUpdate;
+import org.hibernate.annotations.SelectBeforeUpdate;
+import org.hibernate.annotations.Type;
+import org.onap.portalsdk.core.domain.support.DomainVo;
+import org.onap.vid.job.Job;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Objects;
+import java.util.Set;
+import java.util.UUID;
/*
The following 2 annotations let hibernate to update only fields that actually have been changed.
public enum ServiceAction {
INSTANTIATE,
DELETE,
- UPDATE
- }
-
- public void setUserId(String userId) {
- this.userId = userId;
+ UPDATE,
+ RESUME,
+ REPLACE
}
private UUID jobId;
private Date statusModifiedDate;
private boolean hidden;
private boolean pause;
+ private boolean retryEnabled;
private Date deletedAt;
private String owningEntityId;
private String owningEntityName;
}
- public ServiceInfo(String userId, Boolean aLaCarte, Job.JobStatus jobStatus, boolean pause, UUID jobId, UUID templateId, String owningEntityId, String owningEntityName, String project, String aicZoneId, String aicZoneName, String tenantId, String tenantName, String regionId, String regionName, String serviceType, String subscriberName, String subscriberId, String serviceInstanceId, String serviceInstanceName, String serviceModelId, String serviceModelName, String serviceModelVersion, Date createdBulkDate, ServiceAction action) {
+ public ServiceInfo(String userId, Boolean aLaCarte, Job.JobStatus jobStatus, boolean pause, UUID jobId, UUID templateId,
+ String owningEntityId, String owningEntityName, String project, String aicZoneId, String aicZoneName,
+ String tenantId, String tenantName, String regionId, String regionName, String serviceType,
+ String subscriberName, String subscriberId, String serviceInstanceId, String serviceInstanceName,
+ String serviceModelId, String serviceModelName, String serviceModelVersion, Date createdBulkDate,
+ ServiceAction action, boolean retryEnabled) {
this.userId = userId;
this.aLaCarte = aLaCarte;
this.jobStatus = jobStatus;
this.serviceModelVersion = serviceModelVersion;
this.createdBulkDate = createdBulkDate;
this.action = action;
+ this.retryEnabled = retryEnabled;
}
@Column(name = "JOB_ID", columnDefinition = "CHAR(36)")
return pause;
}
+ @Column(name="IS_RETRY_ENABLED")
+ @JsonProperty("isRetryEnabled")
+ public boolean isRetryEnabled() {
+ return retryEnabled;
+ }
+
@Column(name="OWNING_ENTITY_ID")
public String getOwningEntityId() {
return owningEntityId;
@Column(name="DELETED_AT")
public Date getDeletedAt() {
- return deletedAt;
- }
+ return deletedAt;
+ }
@Column(name="ACTION")
@Enumerated(EnumType.STRING)
return super.getAuditTrail();
}
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
public void setJobId(UUID jobId) {
this.jobId = jobId;
}
this.pause = pause;
}
+ public void setRetryEnabled(boolean retryEnabled) {
+ this.retryEnabled = retryEnabled;
+ }
+
public void setOwningEntityId(String owningEntityId) {
this.owningEntityId = owningEntityId;
}
}
public void setDeletedAt(Date deletedAt) {
- this.deletedAt = deletedAt;
- }
+ this.deletedAt = deletedAt;
+ }
public void setAction(ServiceAction action) { this.action = action; }
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof ServiceInfo)) return false;
- ServiceInfo that = (ServiceInfo) o;
- return isHidden() == that.isHidden() &&
- isPause() == that.isPause() &&
- isALaCarte() == that.isALaCarte() &&
- Objects.equals(getDeletedAt(), that.getDeletedAt()) &&
- Objects.equals(getJobId(), that.getJobId()) &&
- Objects.equals(getTemplateId(), that.getTemplateId()) &&
- Objects.equals(getUserId(), that.getUserId()) &&
- Objects.equals(getMsoRequestId(), that.getMsoRequestId()) &&
- getJobStatus() == that.getJobStatus() &&
- Objects.equals(getStatusModifiedDate(), that.getStatusModifiedDate()) &&
- Objects.equals(getOwningEntityId(), that.getOwningEntityId()) &&
- Objects.equals(getOwningEntityName(), that.getOwningEntityName()) &&
- Objects.equals(getProject(), that.getProject()) &&
- Objects.equals(getAicZoneId(), that.getAicZoneId()) &&
- Objects.equals(getAicZoneName(), that.getAicZoneName()) &&
- Objects.equals(getTenantId(), that.getTenantId()) &&
- Objects.equals(getTenantName(), that.getTenantName()) &&
- Objects.equals(getRegionId(), that.getRegionId()) &&
- Objects.equals(getRegionName(), that.getRegionName()) &&
- Objects.equals(getServiceType(), that.getServiceType()) &&
- Objects.equals(getSubscriberName(), that.getSubscriberName()) &&
- Objects.equals(getSubscriberId(), that.getSubscriberId()) &&
- Objects.equals(getServiceInstanceId(), that.getServiceInstanceId()) &&
- Objects.equals(getServiceInstanceName(), that.getServiceInstanceName()) &&
- Objects.equals(getServiceModelId(), that.getServiceModelId()) &&
- Objects.equals(getServiceModelName(), that.getServiceModelName()) &&
- Objects.equals(getServiceModelVersion(), that.getServiceModelVersion()) &&
- Objects.equals(getCreatedBulkDate(), that.getCreatedBulkDate()) &&
- Objects.equals(getAction(), that.getAction());
- }
-
- @Override
- public int hashCode() {
-
- return Objects.hash(getJobId(), getTemplateId(), getUserId(), getMsoRequestId(), isALaCarte(), getJobStatus(), getStatusModifiedDate(),
- isHidden(), isPause(), getDeletedAt(), getOwningEntityId(), getOwningEntityName(), getProject(),
- getAicZoneId(), getAicZoneName(), getTenantId(), getTenantName(), getRegionId(),
- getRegionName(), getServiceType(), getSubscriberName(), getSubscriberId(), getServiceInstanceId(),
- getServiceInstanceName(), getServiceModelId(), getServiceModelName(),
- getServiceModelVersion(), getCreatedBulkDate(), getAction());
- }
- }
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof ServiceInfo)) return false;
+ ServiceInfo that = (ServiceInfo) o;
+ return aLaCarte == that.aLaCarte &&
+ isHidden() == that.isHidden() &&
+ isPause() == that.isPause() &&
+ isRetryEnabled() == that.isRetryEnabled() &&
+ Objects.equals(getJobId(), that.getJobId()) &&
+ Objects.equals(getTemplateId(), that.getTemplateId()) &&
+ Objects.equals(getUserId(), that.getUserId()) &&
+ Objects.equals(getMsoRequestId(), that.getMsoRequestId()) &&
+ getJobStatus() == that.getJobStatus() &&
+ Objects.equals(getStatusModifiedDate(), that.getStatusModifiedDate()) &&
+ Objects.equals(getDeletedAt(), that.getDeletedAt()) &&
+ Objects.equals(getOwningEntityId(), that.getOwningEntityId()) &&
+ Objects.equals(getOwningEntityName(), that.getOwningEntityName()) &&
+ Objects.equals(getProject(), that.getProject()) &&
+ Objects.equals(getAicZoneId(), that.getAicZoneId()) &&
+ Objects.equals(getAicZoneName(), that.getAicZoneName()) &&
+ Objects.equals(getTenantId(), that.getTenantId()) &&
+ Objects.equals(getTenantName(), that.getTenantName()) &&
+ Objects.equals(getRegionId(), that.getRegionId()) &&
+ Objects.equals(getRegionName(), that.getRegionName()) &&
+ Objects.equals(getServiceType(), that.getServiceType()) &&
+ Objects.equals(getSubscriberName(), that.getSubscriberName()) &&
+ Objects.equals(getSubscriberId(), that.getSubscriberId()) &&
+ Objects.equals(getServiceInstanceId(), that.getServiceInstanceId()) &&
+ Objects.equals(getServiceInstanceName(), that.getServiceInstanceName()) &&
+ Objects.equals(getServiceModelId(), that.getServiceModelId()) &&
+ Objects.equals(getServiceModelName(), that.getServiceModelName()) &&
+ Objects.equals(getServiceModelVersion(), that.getServiceModelVersion()) &&
+ Objects.equals(getCreatedBulkDate(), that.getCreatedBulkDate()) &&
+ getAction() == that.getAction();
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(getJobId(), getTemplateId(), getUserId(), getMsoRequestId(), aLaCarte, getJobStatus(),
+ getStatusModifiedDate(), isHidden(), isPause(), isRetryEnabled(), getDeletedAt(), getOwningEntityId(), getOwningEntityName(),
+ getProject(), getAicZoneId(), getAicZoneName(), getTenantId(), getTenantName(), getRegionId(), getRegionName(), getServiceType(),
+ getSubscriberName(), getSubscriberId(), getServiceInstanceId(), getServiceInstanceName(), getServiceModelId(), getServiceModelName(),
+ getServiceModelVersion(), getCreatedBulkDate(), getAction());
+ }
+}