be.personify.iam.model.provisioning.PingResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of personify-model Show documentation
Show all versions of personify-model Show documentation
a possible model for personify
package be.personify.iam.model.provisioning;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Lob;
import javax.persistence.Table;
import be.personify.iam.model.util.Persisted;
import be.personify.util.generator.MetaInfo;
@Entity
@Table(name="ping_result", indexes = {@Index(name = "idx_target_system_name", columnList = "targetSystemName", unique=true)})
//use commas in the column list?
@MetaInfo( group="provisioning", frontendGroup="TargetSystem", name="Ping result", description="A pingresult for a targetsystem",
iconClass="table-tennis",
addable=false,
showInMenu=true,
editable=false,
sortOrderInGroup=10,
showEditButtonOnSearchResult = false,
showDeleteButtonOnSearchResult = false,
creatable = false,
number=9 )
public class PingResult extends Persisted implements Serializable {
private static final long serialVersionUID = -8242116343537237180L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@MetaInfo(name="The id of the object", description="The id of the object", searchable=false, showInSearchResultGrid=false)
private long id;
@MetaInfo(name="targetSystemName", description="The name of the targetsystem that is pinged")
private String targetSystemName;
@MetaInfo(searchable=false, name="lastTimePinged", description = "the last time the targetsystem was pinged", dateFormat = "dd/MM/YYYY hh:mm" )
private Date lastTimePinged;
@MetaInfo(searchable=false, showInSearchResultGrid=false, name="lastTimePingedWithSuccess", description = "the last time the targetsystem was pinged with success")
private Date lastTimePingedWithSuccess;
@MetaInfo(searchable=false, showInSearchResultGrid=false, name="lastTimePingedWithError", description = "the last time the targetsystem was pinged with error")
private Date lastTimePingedWithError;
@MetaInfo(searchable=false, showInSearchResultGrid=false, name="responseTimeLastPing", description="The response time of the last ping in milliseconds", unit = "ms")
private long responseTimeLastPing;
@Enumerated(EnumType.STRING)
@MetaInfo(searchable=false, showInSearchResultGrid=true, name="pingStatus", description="The ping status of the last ping (ERROR,SUCCESS)")
private PingStatus pingStatus;
@MetaInfo(searchable=false, showInSearchResultGrid=false, name = "errorStatus", description = "error status of the ping")
@Lob
@Column(length = 20971520)
private String errorStatus;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public Date getLastTimePinged() {
return lastTimePinged;
}
public void setLastTimePinged(Date lastTimePinged) {
this.lastTimePinged = lastTimePinged;
}
public Date getLastTimePingedWithSuccess() {
return lastTimePingedWithSuccess;
}
public void setLastTimePingedWithSuccess(Date lastTimePingedWithSuccess) {
this.lastTimePingedWithSuccess = lastTimePingedWithSuccess;
}
public long getResponseTimeLastPing() {
return responseTimeLastPing;
}
public void setResponseTimeLastPing(long responseTimeLastPing) {
this.responseTimeLastPing = responseTimeLastPing;
}
public String getErrorStatus() {
return errorStatus;
}
public void setErrorStatus(String errorStatus) {
this.errorStatus = errorStatus;
}
public PingStatus getPingStatus() {
return pingStatus;
}
public void setPingStatus(PingStatus pingStatus) {
this.pingStatus = pingStatus;
}
public String getTargetSystemName() {
return targetSystemName;
}
public void setTargetSystemName(String targetSystemName) {
this.targetSystemName = targetSystemName;
}
public Date getLastTimePingedWithError() {
return lastTimePingedWithError;
}
public void setLastTimePingedWithError(Date lastTimePingedWithError) {
this.lastTimePingedWithError = lastTimePingedWithError;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((errorStatus == null) ? 0 : errorStatus.hashCode());
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + ((lastTimePinged == null) ? 0 : lastTimePinged.hashCode());
result = prime * result + ((lastTimePingedWithError == null) ? 0 : lastTimePingedWithError.hashCode());
result = prime * result + ((lastTimePingedWithSuccess == null) ? 0 : lastTimePingedWithSuccess.hashCode());
result = prime * result + ((pingStatus == null) ? 0 : pingStatus.hashCode());
result = prime * result + (int) (responseTimeLastPing ^ (responseTimeLastPing >>> 32));
result = prime * result + ((targetSystemName == null) ? 0 : targetSystemName.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
PingResult other = (PingResult) obj;
if (errorStatus == null) {
if (other.errorStatus != null)
return false;
} else if (!errorStatus.equals(other.errorStatus))
return false;
if (id != other.id)
return false;
if (lastTimePinged == null) {
if (other.lastTimePinged != null)
return false;
} else if (!lastTimePinged.equals(other.lastTimePinged))
return false;
if (lastTimePingedWithError == null) {
if (other.lastTimePingedWithError != null)
return false;
} else if (!lastTimePingedWithError.equals(other.lastTimePingedWithError))
return false;
if (lastTimePingedWithSuccess == null) {
if (other.lastTimePingedWithSuccess != null)
return false;
} else if (!lastTimePingedWithSuccess.equals(other.lastTimePingedWithSuccess))
return false;
if (pingStatus != other.pingStatus)
return false;
if (responseTimeLastPing != other.responseTimeLastPing)
return false;
if (targetSystemName == null) {
if (other.targetSystemName != null)
return false;
} else if (!targetSystemName.equals(other.targetSystemName))
return false;
return true;
}
}