/*******************************************************************************
* ===========================================================
* Ankush : Big Data Cluster Management Solution
* ===========================================================
*
* (C) Copyright 2014, by Impetus Technologies
*
* This is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License (LGPL v3) as
* published by the Free Software Foundation;
*
* This software is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this software; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
******************************************************************************/
/**
*
*/
package com.impetus.ankush.common.domain;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
import org.hibernate.envers.Audited;
/**
* It is used for saving the configuration values of cluster nodes.
*
* @author hokam
*
*/
@Table
@Audited
@Entity(name = "configuration")
public class Configuration extends BaseObject {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
/** The id. */
private Long id;
/** The cluster id. */
private Long clusterId;
/** The username. */
private String username;
/** The source. */
private String source;
/** The host. */
private String host;
/** The property name. */
private String propertyName;
/** The property value. */
private String propertyValue;
/**
* Gets the id.
*
* @return the id
*/
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
public Long getId() {
return id;
}
/**
* Sets the id.
*
* @param id the id to set
*/
public void setId(Long id) {
this.id = id;
}
/**
* Gets the cluster id.
*
* @return the clusterId
*/
public Long getClusterId() {
return clusterId;
}
/**
* Sets the cluster id.
*
* @param clusterId the clusterId to set
*/
public void setClusterId(Long clusterId) {
this.clusterId = clusterId;
}
/**
* Sets the username.
*
* @param username the username to set
*/
public void setUsername(String username) {
this.username = username;
}
/**
* Gets the username.
*
* @return the username
*/
public String getUsername() {
return username;
}
/**
* Gets the source.
*
* @return the fileName
*/
public String getSource() {
return source;
}
/**
* Sets the source.
*
* @param source the new source
*/
public void setSource(String source) {
this.source = source;
}
/**
* Gets the host.
*
* @return the host
*/
public String getHost() {
return host;
}
/**
* Sets the host.
*
* @param host the host to set
*/
public void setHost(String host) {
this.host = host;
}
/**
* Gets the property name.
*
* @return the propertyName
*/
public String getPropertyName() {
return propertyName;
}
/**
* Sets the property name.
*
* @param propertyName the propertyName to set
*/
public void setPropertyName(String propertyName) {
this.propertyName = propertyName;
}
/**
* Gets the property value.
*
* @return the propertyValue
*/
@Lob
public String getPropertyValue() {
return propertyValue;
}
/**
* Sets the property value.
*
* @param propertyValue the propertyValue to set
*/
public void setPropertyValue(String propertyValue) {
this.propertyValue = propertyValue;
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((clusterId == null) ? 0 : clusterId.hashCode());
result = prime * result + ((host == null) ? 0 : host.hashCode());
result = prime * result
+ ((propertyName == null) ? 0 : propertyName.hashCode());
result = prime * result
+ ((propertyValue == null) ? 0 : propertyValue.hashCode());
result = prime * result + ((source == null) ? 0 : source.hashCode());
result = prime * result
+ ((username == null) ? 0 : username.hashCode());
return result;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof Configuration))
return false;
Configuration other = (Configuration) obj;
if (clusterId == null) {
if (other.clusterId != null)
return false;
} else if (!clusterId.equals(other.clusterId))
return false;
if (host == null) {
if (other.host != null)
return false;
} else if (!host.equals(other.host))
return false;
if (propertyName == null) {
if (other.propertyName != null)
return false;
} else if (!propertyName.equals(other.propertyName))
return false;
if (propertyValue == null) {
if (other.propertyValue != null)
return false;
} else if (!propertyValue.equals(other.propertyValue))
return false;
if (source == null) {
if (other.source != null)
return false;
} else if (!source.equals(other.source))
return false;
if (username == null) {
if (other.username != null)
return false;
} else if (!username.equals(other.username))
return false;
return true;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "Configuration [id=" + id + ", clusterId=" + clusterId
+ ", username=" + username + ", source=" + source + ", host="
+ host + ", propertyName=" + propertyName + ", propertyValue="
+ propertyValue + ", getId()=" + getId() + ", getClusterId()="
+ getClusterId() + ", getUsername()=" + getUsername()
+ ", getSource()=" + getSource() + ", getHost()=" + getHost()
+ ", getPropertyName()=" + getPropertyName()
+ ", getPropertyValue()=" + getPropertyValue()
+ ", hashCode()=" + hashCode() + ", getClass()=" + getClass()
+ ", toString()=" + super.toString() + "]";
}
}