be.personify.iam.model.gateway.RequestHandler 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.gateway;
import java.io.Serializable;
import java.util.Map;
import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ForeignKey;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.MapKeyColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import be.personify.iam.model.util.Persisted;
import be.personify.util.generator.MetaInfo;
@Entity
@MetaInfo( group="gateway", frontendGroup="Site", name="requestHandler", description="A requesthandler", iconClass="bullseye",
sortOrderInGroup=1, showInMenu=false,showOnHomePage=false,
isConcept=false, number=2,
workflowEnabled = false,
afterDeleteGoToLink="site",
afterCreateGoToLink="site",
showDeleteButtonOnSearchResult = false,
showEditButtonOnSearchResult = false
)
@Table(name="request_handler")
public class RequestHandler extends Persisted implements Serializable {
private static final long serialVersionUID = 3074678898971101336L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@MetaInfo(showInSearchResultGrid=false , name="id", description="the id of the request handler")
private long id;
@MetaInfo(name="className",description="the classname of the handler",sampleValue="be.personify.gateway.handlers.ResourceExpiryHandler")
private String className;
@MetaInfo(name="active",description="indicating if the requesthandler is active",sampleValue="true")
private boolean active;
@MetaInfo(name="executionOrder",
description="order in which the hanlers are called",sampleValue="1",
customRenderer = "integer_dropdown|values:1-20|default:1")
private int executionOrder;
@MetaInfo(name="site",description="the site linked to this request handler : see site_",
sampleValue="site1",
searchable=false,
showInSearchResultGrid=false)
@OneToOne
@JoinColumn(name="site_id", foreignKey=@ForeignKey(name = "FK_request_handler_site"))
private Site site;
@ElementCollection(fetch = FetchType.EAGER)
@JoinTable(name="request_handler_configuration", joinColumns=@JoinColumn(name="id"))
@MapKeyColumn (name="kkey")
@Column(name="vvalue")
@MetaInfo(name="configuration", description="the configuration of the request handler")
private Map configuration;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public boolean isActive() {
return active;
}
public void setActive(boolean active) {
this.active = active;
}
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
public Map getConfiguration() {
return configuration;
}
public void setConfiguration(Map configuration) {
this.configuration = configuration;
}
public Site getSite() {
return site;
}
public void setSite(Site site) {
this.site = site;
}
public int getExecutionOrder() {
return executionOrder;
}
public void setExecutionOrder(int executionOrder) {
this.executionOrder = executionOrder;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + (active ? 1231 : 1237);
result = prime * result + ((className == null) ? 0 : className.hashCode());
result = prime * result + ((configuration == null) ? 0 : configuration.hashCode());
result = prime * result + executionOrder;
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + ((site == null) ? 0 : site.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;
RequestHandler other = (RequestHandler) obj;
if (active != other.active)
return false;
if (className == null) {
if (other.className != null)
return false;
} else if (!className.equals(other.className))
return false;
if (configuration == null) {
if (other.configuration != null)
return false;
} else if (!configuration.equals(other.configuration))
return false;
if (executionOrder != other.executionOrder)
return false;
if (id != other.id)
return false;
if (site == null) {
if (other.site != null)
return false;
} else if (!site.equals(other.site))
return false;
return true;
}
}