All Downloads are FREE. Search and download functionalities are using the official Maven repository.

be.personify.iam.model.provisioning.ReconciliationChunk Maven / Gradle / Ivy

There is a newer version: 1.5.2.RELEASE
Show newest version
package be.personify.iam.model.provisioning;

import java.io.Serializable;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToOne;
import javax.persistence.MapKeyColumn;
import javax.persistence.Table;

import be.personify.iam.model.util.Persisted;
import be.personify.util.generator.MetaInfo;
	
@Entity
@MetaInfo( group="provisioning", frontendGroup="Provisioning", name="ReconciliationChunk", description="A chunck that has to be processed to finish a reconciliation run", iconClass="th", 
				sortOrderInGroup=2, showInMenu=false,
				number=15,
				workflowEnabled = false,
				addable=false,
				rst_include_description = true
)
@Table(name="reconciliation_chunk")
public class ReconciliationChunk extends Persisted implements Serializable {
	
	private static final long serialVersionUID = 8104918783591219906L;
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@MetaInfo(name="id", description="the id of the reconciliation chunk", searchable=false,showInSearchResultGrid=false)
	private long id;

	@MetaInfo(name="execution",description="the related reconciliationExecution_",sampleValue="FILETOREST", showInSearchResultGrid=false, searchable = false)
	@ManyToOne( targetEntity=ReconciliationExecution.class)
	private ReconciliationExecution reconciliationExecution;
	
	@MetaInfo(name="name",description="the name of this chunk",sampleValue="1-1000")
	private String name;
	
	@MetaInfo(name="reconciliationStatus",description="the current reconciliation status of this reconciliation chunk",sampleValue="WAITING")
	@Enumerated(EnumType.STRING)
	private ReconciliationStatus reconciliationStatus;
	
	@MetaInfo(name="server",description="the server treating this chunk",sampleValue="188.12.33.44")
	private String server;
	
	@MetaInfo(name="start",description="the number of the start record of this chunk",sampleValue="1", showInSearchResultGrid=false, searchable=false)
	private int start;
	
	@MetaInfo(name="end",description="the number of the end record of this chunk",sampleValue="1", showInSearchResultGrid=false, searchable=false)
	private int end;
	
	@MetaInfo(name="totalTime",description="the total time this reconciliation chunk took the last time it was executed",sampleValue="1000", searchable = false, unit = "ms")
	private long totalTime;
	
	@ElementCollection(fetch = FetchType.EAGER)
	@JoinTable(name="reconciliation_chunk_result", joinColumns=@JoinColumn(name="id"))
	@MapKeyColumn (name="result_id")
	@Column(name="result")
	@MetaInfo(name="configuration", description="the result of this reconciliation run")
	private Map result;
	
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}
	
	public ReconciliationStatus getReconciliationStatus() {
		return reconciliationStatus;
	}

	public void setReconciliationStatus(ReconciliationStatus reconciliationStatus) {
		this.reconciliationStatus = reconciliationStatus;
	}


	public String getServer() {
		return server;
	}

	public void setServer(String server) {
		this.server = server;
	}


	public Map getResult() {
		return result;
	}


	public void setResult(Map result) {
		this.result = result;
	}


	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}


	public int getStart() {
		return start;
	}


	public void setStart(int start) {
		this.start = start;
	}


	public int getEnd() {
		return end;
	}


	public void setEnd(int end) {
		this.end = end;
	}


	public long getTotalTime() {
		return totalTime;
	}


	public void setTotalTime(long totalTime) {
		this.totalTime = totalTime;
	}

	public ReconciliationExecution getReconciliationExecution() {
		return reconciliationExecution;
	}

	public void setReconciliationExecution(ReconciliationExecution execution) {
		this.reconciliationExecution = execution;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + end;
		result = prime * result + ((reconciliationExecution == null) ? 0 : reconciliationExecution.hashCode());
		result = prime * result + (int) (id ^ (id >>> 32));
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + ((reconciliationStatus == null) ? 0 : reconciliationStatus.hashCode());
		result = prime * result + ((this.result == null) ? 0 : this.result.hashCode());
		result = prime * result + ((server == null) ? 0 : server.hashCode());
		result = prime * result + start;
		result = prime * result + (int) (totalTime ^ (totalTime >>> 32));
		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;
		ReconciliationChunk other = (ReconciliationChunk) obj;
		if (end != other.end)
			return false;
		if (reconciliationExecution == null) {
			if (other.reconciliationExecution != null)
				return false;
		} else if (!reconciliationExecution.equals(other.reconciliationExecution))
			return false;
		if (id != other.id)
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (reconciliationStatus != other.reconciliationStatus)
			return false;
		if (result == null) {
			if (other.result != null)
				return false;
		} else if (!result.equals(other.result))
			return false;
		if (server == null) {
			if (other.server != null)
				return false;
		} else if (!server.equals(other.server))
			return false;
		if (start != other.start)
			return false;
		if (totalTime != other.totalTime)
			return false;
		return true;
	}


	
	
	
	
	

	

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy