diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXAccessAudit.java b/security-admin/src/main/java/org/apache/ranger/entity/XXAccessAudit.java index bb6981c0ea..c73d93e362 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXAccessAudit.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXAccessAudit.java @@ -40,7 +40,7 @@ public class XXAccessAudit extends XXAccessAuditBase implements java.io.Serializ //event duration in ms @Column(name = "EVENT_DUR_MS") - protected long eventDuration; + protected long eventDuration; @Column(name = "tags") protected String tags; @@ -82,22 +82,14 @@ public void setTags(String tags) { this.tags = tags; } - /** - * This return the bean content in string format - * @return formatedStr - */ @Override - public String toString() { - String str = super.toString(); - str += "sequenceNumber={" + sequenceNumber + "}"; - str += "eventCount={" + eventCount + "}"; - str += "eventDuration={" + eventDuration + "}"; - str += "tags={" + tags + "}"; - return str; + public int hashCode() { + return super.hashCode(); } /** * Checks for all attributes except referenced db objects + * * @return true if all attributes match */ @Override @@ -108,4 +100,19 @@ public boolean equals(Object obj) { XXAccessAudit other = (XXAccessAudit) obj; return (this.tags != null || other.tags == null) && (this.tags == null || this.tags.equals(other.tags)); } + + /** + * This return the bean content in string format + * + * @return formatedStr + */ + @Override + public String toString() { + String str = super.toString(); + str += "sequenceNumber={" + sequenceNumber + "}"; + str += "eventCount={" + eventCount + "}"; + str += "eventDuration={" + eventDuration + "}"; + str += "tags={" + tags + "}"; + return str; + } } diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXAccessAuditBase.java b/security-admin/src/main/java/org/apache/ranger/entity/XXAccessAuditBase.java index b92f49c7e2..8467c246d1 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXAccessAuditBase.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXAccessAuditBase.java @@ -46,31 +46,28 @@ public class XXAccessAuditBase extends XXDBBase implements java.io.Serializable @SequenceGenerator(name = "XA_ACCESS_AUDIT_SEQ", sequenceName = "XA_ACCESS_AUDIT_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.AUTO, generator = "XA_ACCESS_AUDIT_SEQ") @Column(name = "ID") - protected Long id; + protected Long id; /** * Repository Type * - * */ @Column(name = "AUDIT_TYPE", nullable = false) - protected int auditType = AppConstants.ASSET_UNKNOWN; + protected int auditType = AppConstants.ASSET_UNKNOWN; /** * Access Result * - * */ @Column(name = "ACCESS_RESULT") - protected int accessResult = RangerConstants.ACCESS_RESULT_DENIED; + protected int accessResult = RangerConstants.ACCESS_RESULT_DENIED; /** * Access Type * - * */ @Column(name = "ACCESS_TYPE", length = 255) protected String accessType; @@ -79,7 +76,6 @@ public class XXAccessAuditBase extends XXDBBase implements java.io.Serializable * - * */ @Column(name = "ACL_ENFORCER", length = 255) protected String aclEnforcer; @@ -88,7 +84,6 @@ public class XXAccessAuditBase extends XXDBBase implements java.io.Serializable * - * */ @Column(name = "AGENT_ID", length = 255) protected String agentId; @@ -97,7 +92,6 @@ public class XXAccessAuditBase extends XXDBBase implements java.io.Serializable * - * */ @Column(name = "CLIENT_IP", length = 255) protected String clientIP; @@ -106,7 +100,6 @@ public class XXAccessAuditBase extends XXDBBase implements java.io.Serializable * - * */ @Column(name = "CLIENT_TYPE", length = 255) protected String clientType; @@ -114,16 +107,14 @@ public class XXAccessAuditBase extends XXDBBase implements java.io.Serializable * Policy Id * - * */ @Column(name = "POLICY_ID") - protected long policyId; + protected long policyId; /** * Repository Name * - * */ @Column(name = "REPO_NAME", length = 255) protected String repoName; @@ -131,16 +122,14 @@ public class XXAccessAuditBase extends XXDBBase implements java.io.Serializable * Repository Type * - * */ @Column(name = "REPO_TYPE") - protected int repoType; + protected int repoType; /** * Reason of result * - * */ @Column(name = "RESULT_REASON", length = 255) protected String resultReason; @@ -149,7 +138,6 @@ public class XXAccessAuditBase extends XXDBBase implements java.io.Serializable * - * */ @Column(name = "SESSION_ID", length = 255) protected String sessionId; @@ -157,17 +145,15 @@ public class XXAccessAuditBase extends XXDBBase implements java.io.Serializable * Event Time * - * */ @Temporal(TemporalType.TIMESTAMP) @Column(name = "EVENT_TIME") - protected Date eventTime = DateUtil.getUTCDate(); + protected Date eventTime = DateUtil.getUTCDate(); /** * Requesting User * - * */ @Column(name = "REQUEST_USER", length = 255) protected String requestUser; @@ -176,7 +162,6 @@ public class XXAccessAuditBase extends XXDBBase implements java.io.Serializable * - * */ @Column(name = "ACTION", length = 2000) protected String action; @@ -185,7 +170,6 @@ public class XXAccessAuditBase extends XXDBBase implements java.io.Serializable * - * */ @Column(name = "REQUEST_DATA", length = 2000) protected String requestData; @@ -194,7 +178,6 @@ public class XXAccessAuditBase extends XXDBBase implements java.io.Serializable * - * */ @Column(name = "RESOURCE_PATH", length = 2000) protected String resourcePath; @@ -203,7 +186,6 @@ public class XXAccessAuditBase extends XXDBBase implements java.io.Serializable * - * */ @Column(name = "RESOURCE_TYPE", length = 255) protected String resourceType; @@ -241,8 +223,14 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /** * Checks for all attributes except referenced db objects + * * @return true if all attributes match */ @Override @@ -307,6 +295,7 @@ public boolean equals(Object obj) { /** * This return the bean content in string format + * * @return formatedStr */ @Override @@ -336,6 +325,7 @@ public String toString() { /** * Returns the value for the member attribute auditType + * * @return int - value of member attribute auditType. */ public int getAuditType() { @@ -345,6 +335,7 @@ public int getAuditType() { /** * This method sets the value to the member attribute auditType. * You cannot set null to the attribute. + * * @param auditType Value to set member attribute auditType */ public void setAuditType(int auditType) { @@ -353,6 +344,7 @@ public void setAuditType(int auditType) { /** * Returns the value for the member attribute accessResult + * * @return int - value of member attribute accessResult. */ public int getAccessResult() { @@ -362,6 +354,7 @@ public int getAccessResult() { /** * This method sets the value to the member attribute accessResult. * You cannot set null to the attribute. + * * @param accessResult Value to set member attribute accessResult */ public void setAccessResult(int accessResult) { @@ -370,6 +363,7 @@ public void setAccessResult(int accessResult) { /** * Returns the value for the member attribute accessType + * * @return String - value of member attribute accessType. */ public String getAccessType() { @@ -379,6 +373,7 @@ public String getAccessType() { /** * This method sets the value to the member attribute accessType. * You cannot set null to the attribute. + * * @param accessType Value to set member attribute accessType */ public void setAccessType(String accessType) { @@ -387,6 +382,7 @@ public void setAccessType(String accessType) { /** * Returns the value for the member attribute aclEnforcer + * * @return String - value of member attribute aclEnforcer. */ public String getAclEnforcer() { @@ -396,6 +392,7 @@ public String getAclEnforcer() { /** * This method sets the value to the member attribute aclEnforcer. * You cannot set null to the attribute. + * * @param aclEnforcer Value to set member attribute aclEnforcer */ public void setAclEnforcer(String aclEnforcer) { @@ -404,6 +401,7 @@ public void setAclEnforcer(String aclEnforcer) { /** * Returns the value for the member attribute agentId + * * @return String - value of member attribute agentId. */ public String getAgentId() { @@ -413,6 +411,7 @@ public String getAgentId() { /** * This method sets the value to the member attribute agentId. * You cannot set null to the attribute. + * * @param agentId Value to set member attribute agentId */ public void setAgentId(String agentId) { @@ -421,6 +420,7 @@ public void setAgentId(String agentId) { /** * Returns the value for the member attribute clientIP + * * @return String - value of member attribute clientIP. */ public String getClientIP() { @@ -430,6 +430,7 @@ public String getClientIP() { /** * This method sets the value to the member attribute clientIP. * You cannot set null to the attribute. + * * @param clientIP Value to set member attribute clientIP */ public void setClientIP(String clientIP) { @@ -438,6 +439,7 @@ public void setClientIP(String clientIP) { /** * Returns the value for the member attribute clientType + * * @return String - value of member attribute clientType. */ public String getClientType() { @@ -447,6 +449,7 @@ public String getClientType() { /** * This method sets the value to the member attribute clientType. * You cannot set null to the attribute. + * * @param clientType Value to set member attribute clientType */ public void setClientType(String clientType) { @@ -455,6 +458,7 @@ public void setClientType(String clientType) { /** * Returns the value for the member attribute policyId + * * @return long - value of member attribute policyId. */ public long getPolicyId() { @@ -464,6 +468,7 @@ public long getPolicyId() { /** * This method sets the value to the member attribute policyId. * You cannot set null to the attribute. + * * @param policyId Value to set member attribute policyId */ public void setPolicyId(long policyId) { @@ -472,6 +477,7 @@ public void setPolicyId(long policyId) { /** * Returns the value for the member attribute repoName + * * @return String - value of member attribute repoName. */ public String getRepoName() { @@ -481,6 +487,7 @@ public String getRepoName() { /** * This method sets the value to the member attribute repoName. * You cannot set null to the attribute. + * * @param repoName Value to set member attribute repoName */ public void setRepoName(String repoName) { @@ -489,6 +496,7 @@ public void setRepoName(String repoName) { /** * Returns the value for the member attribute repoType + * * @return int - value of member attribute repoType. */ public int getRepoType() { @@ -498,6 +506,7 @@ public int getRepoType() { /** * This method sets the value to the member attribute repoType. * You cannot set null to the attribute. + * * @param repoType Value to set member attribute repoType */ public void setRepoType(int repoType) { @@ -506,6 +515,7 @@ public void setRepoType(int repoType) { /** * Returns the value for the member attribute resultReason + * * @return String - value of member attribute resultReason. */ public String getResultReason() { @@ -515,6 +525,7 @@ public String getResultReason() { /** * This method sets the value to the member attribute resultReason. * You cannot set null to the attribute. + * * @param resultReason Value to set member attribute resultReason */ public void setResultReason(String resultReason) { @@ -523,6 +534,7 @@ public void setResultReason(String resultReason) { /** * Returns the value for the member attribute sessionId + * * @return String - value of member attribute sessionId. */ public String getSessionId() { @@ -532,6 +544,7 @@ public String getSessionId() { /** * This method sets the value to the member attribute sessionId. * You cannot set null to the attribute. + * * @param sessionId Value to set member attribute sessionId */ public void setSessionId(String sessionId) { @@ -540,6 +553,7 @@ public void setSessionId(String sessionId) { /** * Returns the value for the member attribute eventTime + * * @return Date - value of member attribute eventTime. */ public Date getEventTime() { @@ -549,6 +563,7 @@ public Date getEventTime() { /** * This method sets the value to the member attribute eventTime. * You cannot set null to the attribute. + * * @param eventTime Value to set member attribute eventTime */ public void setEventTime(Date eventTime) { @@ -557,6 +572,7 @@ public void setEventTime(Date eventTime) { /** * Returns the value for the member attribute requestUser + * * @return String - value of member attribute requestUser. */ public String getRequestUser() { @@ -566,6 +582,7 @@ public String getRequestUser() { /** * This method sets the value to the member attribute requestUser. * You cannot set null to the attribute. + * * @param requestUser Value to set member attribute requestUser */ public void setRequestUser(String requestUser) { @@ -574,6 +591,7 @@ public void setRequestUser(String requestUser) { /** * Returns the value for the member attribute action + * * @return String - value of member attribute action. */ public String getAction() { @@ -583,6 +601,7 @@ public String getAction() { /** * This method sets the value to the member attribute action. * You cannot set null to the attribute. + * * @param action Value to set member attribute action */ public void setAction(String action) { @@ -591,6 +610,7 @@ public void setAction(String action) { /** * Returns the value for the member attribute requestData + * * @return String - value of member attribute requestData. */ public String getRequestData() { @@ -600,6 +620,7 @@ public String getRequestData() { /** * This method sets the value to the member attribute requestData. * You cannot set null to the attribute. + * * @param requestData Value to set member attribute requestData */ public void setRequestData(String requestData) { @@ -608,6 +629,7 @@ public void setRequestData(String requestData) { /** * Returns the value for the member attribute resourcePath + * * @return String - value of member attribute resourcePath. */ public String getResourcePath() { @@ -617,6 +639,7 @@ public String getResourcePath() { /** * This method sets the value to the member attribute resourcePath. * You cannot set null to the attribute. + * * @param resourcePath Value to set member attribute resourcePath */ public void setResourcePath(String resourcePath) { @@ -625,6 +648,7 @@ public void setResourcePath(String resourcePath) { /** * Returns the value for the member attribute resourceType + * * @return String - value of member attribute resourceType. */ public String getResourceType() { @@ -634,6 +658,7 @@ public String getResourceType() { /** * This method sets the value to the member attribute resourceType. * You cannot set null to the attribute. + * * @param resourceType Value to set member attribute resourceType */ public void setResourceType(String resourceType) { diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXAccessAuditV5.java b/security-admin/src/main/java/org/apache/ranger/entity/XXAccessAuditV5.java index 7ecf24e915..8426cdc199 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXAccessAuditV5.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXAccessAuditV5.java @@ -34,12 +34,12 @@ public class XXAccessAuditV5 extends XXAccessAuditBase implements java.io.Serializable { private static final long serialVersionUID = 1L; @Column(name = "SEQ_NUM") - protected long sequenceNumber; + protected long sequenceNumber; @Column(name = "EVENT_COUNT") - protected long eventCount; + protected long eventCount; //event duration in ms @Column(name = "EVENT_DUR_MS") - protected long eventDuration; + protected long eventDuration; @Override public int getMyClassType() { @@ -48,6 +48,7 @@ public int getMyClassType() { /** * This return the bean content in string format + * * @return formatedStr */ @Override diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXAccessTypeDef.java b/security-admin/src/main/java/org/apache/ranger/entity/XXAccessTypeDef.java index 90aeb29251..015040477b 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXAccessTypeDef.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXAccessTypeDef.java @@ -134,6 +134,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /* * (non-Javadoc) * @@ -306,7 +311,11 @@ public void setDataMaskOptions(String dataMaskOptions) { this.dataMaskOptions = dataMaskOptions; } - public String getRowFilterOptions() {return rowFilterOptions;} + public String getRowFilterOptions() { + return rowFilterOptions; + } - public void setRowFilterOptions(String rowFilterOptions) {this.rowFilterOptions = rowFilterOptions;} + public void setRowFilterOptions(String rowFilterOptions) { + this.rowFilterOptions = rowFilterOptions; + } } diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXAccessTypeDefGrants.java b/security-admin/src/main/java/org/apache/ranger/entity/XXAccessTypeDefGrants.java index aa88b05b5b..3a63ca1e92 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXAccessTypeDefGrants.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXAccessTypeDefGrants.java @@ -30,8 +30,7 @@ @Entity @Cacheable @Table(name = "x_access_type_def_grants") -public class XXAccessTypeDefGrants extends XXDBBase implements - java.io.Serializable { +public class XXAccessTypeDefGrants extends XXDBBase implements java.io.Serializable { private static final long serialVersionUID = 1L; /** * id of the XXAccessTypeDefGrants @@ -79,6 +78,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /* * (non-Javadoc) * @@ -115,8 +119,9 @@ public boolean equals(Object obj) { } if (impliedGrant == null) { return other.impliedGrant == null; - } else + } else { return impliedGrant.equals(other.impliedGrant); + } } /* @@ -126,8 +131,7 @@ public boolean equals(Object obj) { */ @Override public String toString() { - return "XXAccessTypeDefGrants [" + super.toString() + " id=" + id - + ", atdId=" + atdId + ", impliedGrant=" + impliedGrant + "]"; + return "XXAccessTypeDefGrants [" + super.toString() + " id=" + id + ", atdId=" + atdId + ", impliedGrant=" + impliedGrant + "]"; } /** diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXAsset.java b/security-admin/src/main/java/org/apache/ranger/entity/XXAsset.java index 55e9449e6f..4867406c25 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXAsset.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXAsset.java @@ -43,66 +43,55 @@ public class XXAsset extends XXDBBase implements java.io.Serializable { @SequenceGenerator(name = "X_ASSET_SEQ", sequenceName = "X_ASSET_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.AUTO, generator = "X_ASSET_SEQ") @Column(name = "ID") - protected Long id; + protected Long id; /** * Name * - * */ @Column(name = "ASSET_NAME", nullable = false, length = 1024) - protected String name; @Override - public void setId(Long id) { - this.id = id; - } + protected String name; /** * Description * - * */ @Column(name = "DESCR", nullable = false, length = 4000) - protected String description; @Override - public Long getId() { - return id; - } + protected String description; /** * Status * - * */ @Column(name = "ACT_STATUS", nullable = false) - protected int activeStatus = RangerConstants.STATUS_DISABLED; + protected int activeStatus = RangerConstants.STATUS_DISABLED; /** * Type of asset * - * */ @Column(name = "ASSET_TYPE", nullable = false) - protected int assetType = AppConstants.ASSET_UNKNOWN; + protected int assetType = AppConstants.ASSET_UNKNOWN; /** * Config in json format * - * */ @Column(name = "CONFIG", length = 10000) protected String config; + /** * Support native authorization * - * */ @Column(name = "SUP_NATIVE", nullable = false) - protected boolean supportNative = false; + protected boolean supportNative; /** * Default constructor. This will set all the attributes to default value. @@ -134,8 +123,72 @@ public String getMyDisplayValue() { return getDescription(); } + @Override + public Long getId() { + return id; + } + + @Override + public void setId(Long id) { + this.id = id; + } + + @Override + public int hashCode() { + return super.hashCode(); + } + + /** + * Checks for all attributes except referenced db objects + * + * @return true if all attributes match + */ + @Override + public boolean equals(Object obj) { + if (!super.equals(obj)) { + return false; + } + XXAsset other = (XXAsset) obj; + if ((this.name == null && other.name != null) || (this.name != null && !this.name.equals(other.name))) { + return false; + } + if ((this.description == null && other.description != null) || (this.description != null && !this.description.equals(other.description))) { + return false; + } + if (this.activeStatus != other.activeStatus) { + return false; + } + if (this.assetType != other.assetType) { + return false; + } + if ((this.config == null && other.config != null) || (this.config != null && !this.config.equals(other.config))) { + return false; + } + return this.supportNative == other.supportNative; + } + + /** + * This return the bean content in string format + * + * @return formatedStr + */ + @Override + public String toString() { + String str = "XXAsset={"; + str += super.toString(); + str += "name={" + name + "} "; + str += "description={" + description + "} "; + str += "activeStatus={" + activeStatus + "} "; + str += "assetType={" + assetType + "} "; + str += "config={" + config + "} "; + str += "supportNative={" + supportNative + "} "; + str += "}"; + return str; + } + /** * Returns the value for the member attribute name + * * @return String - value of member attribute name. */ public String getName() { @@ -145,6 +198,7 @@ public String getName() { /** * This method sets the value to the member attribute name. * You cannot set null to the attribute. + * * @param name Value to set member attribute name */ public void setName(String name) { @@ -153,6 +207,7 @@ public void setName(String name) { /** * Returns the value for the member attribute description + * * @return String - value of member attribute description. */ public String getDescription() { @@ -162,6 +217,7 @@ public String getDescription() { /** * This method sets the value to the member attribute description. * You cannot set null to the attribute. + * * @param description Value to set member attribute description */ public void setDescription(String description) { @@ -170,6 +226,7 @@ public void setDescription(String description) { /** * Returns the value for the member attribute activeStatus + * * @return int - value of member attribute activeStatus. */ public int getActiveStatus() { @@ -179,6 +236,7 @@ public int getActiveStatus() { /** * This method sets the value to the member attribute activeStatus. * You cannot set null to the attribute. + * * @param activeStatus Value to set member attribute activeStatus */ public void setActiveStatus(int activeStatus) { @@ -187,6 +245,7 @@ public void setActiveStatus(int activeStatus) { /** * Returns the value for the member attribute assetType + * * @return int - value of member attribute assetType. */ public int getAssetType() { @@ -196,6 +255,7 @@ public int getAssetType() { /** * This method sets the value to the member attribute assetType. * You cannot set null to the attribute. + * * @param assetType Value to set member attribute assetType */ public void setAssetType(int assetType) { @@ -204,6 +264,7 @@ public void setAssetType(int assetType) { /** * Returns the value for the member attribute config + * * @return String - value of member attribute config. */ public String getConfig() { @@ -213,6 +274,7 @@ public String getConfig() { /** * This method sets the value to the member attribute config. * You cannot set null to the attribute. + * * @param config Value to set member attribute config */ public void setConfig(String config) { @@ -221,6 +283,7 @@ public void setConfig(String config) { /** * Returns the value for the member attribute supportNative + * * @return boolean - value of member attribute supportNative. */ public boolean isSupportNative() { @@ -230,59 +293,10 @@ public boolean isSupportNative() { /** * This method sets the value to the member attribute supportNative. * You cannot set null to the attribute. + * * @param supportNative Value to set member attribute supportNative */ public void setSupportNative(boolean supportNative) { this.supportNative = supportNative; } - - - - /** - * This return the bean content in string format - * @return formatedStr - */ - @Override - public String toString() { - String str = "XXAsset={"; - str += super.toString(); - str += "name={" + name + "} "; - str += "description={" + description + "} "; - str += "activeStatus={" + activeStatus + "} "; - str += "assetType={" + assetType + "} "; - str += "config={" + config + "} "; - str += "supportNative={" + supportNative + "} "; - str += "}"; - return str; - } - - /** - * Checks for all attributes except referenced db objects - * @return true if all attributes match - */ - @Override - public boolean equals(Object obj) { - if (!super.equals(obj)) { - return false; - } - XXAsset other = (XXAsset) obj; - if ((this.name == null && other.name != null) || (this.name != null && !this.name.equals(other.name))) { - return false; - } - if ((this.description == null && other.description != null) || (this.description != null && !this.description.equals(other.description))) { - return false; - } - if (this.activeStatus != other.activeStatus) { - return false; - } - if (this.assetType != other.assetType) { - return false; - } - if ((this.config == null && other.config != null) || (this.config != null && !this.config.equals(other.config))) { - return false; - } - return this.supportNative == other.supportNative; - } - - } diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXAuditMap.java b/security-admin/src/main/java/org/apache/ranger/entity/XXAuditMap.java index bc9dc4b558..2b5a955ae2 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXAuditMap.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXAuditMap.java @@ -47,7 +47,6 @@ public class XXAuditMap extends XXDBBase implements java.io.Serializable { * Id of the resource * - * */ @Column(name = "RES_ID") protected Long resourceId; @@ -55,7 +54,6 @@ public class XXAuditMap extends XXDBBase implements java.io.Serializable { * Id of the group * - * */ @Column(name = "GROUP_ID") protected Long groupId; @@ -63,7 +61,6 @@ public class XXAuditMap extends XXDBBase implements java.io.Serializable { * Id of the user * - * */ @Column(name = "USER_ID") protected Long userId; @@ -72,10 +69,9 @@ public class XXAuditMap extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "AUDIT_TYPE", nullable = false) - protected int auditType = AppConstants.XA_AUDIT_TYPE_UNKNOWN; + protected int auditType = AppConstants.XA_AUDIT_TYPE_UNKNOWN; /** * Default constructor. This will set all the attributes to default value. @@ -108,8 +104,14 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /** * Checks for all attributes except referenced db objects + * * @return true if all attributes match */ @Override @@ -132,6 +134,7 @@ public boolean equals(Object obj) { /** * This return the bean content in string format + * * @return formatedStr */ @Override @@ -148,6 +151,7 @@ public String toString() { /** * Returns the value for the member attribute resourceId + * * @return Long - value of member attribute resourceId. */ public Long getResourceId() { @@ -157,6 +161,7 @@ public Long getResourceId() { /** * This method sets the value to the member attribute resourceId. * You cannot set null to the attribute. + * * @param resourceId Value to set member attribute resourceId */ public void setResourceId(Long resourceId) { @@ -165,6 +170,7 @@ public void setResourceId(Long resourceId) { /** * Returns the value for the member attribute groupId + * * @return Long - value of member attribute groupId. */ public Long getGroupId() { @@ -174,6 +180,7 @@ public Long getGroupId() { /** * This method sets the value to the member attribute groupId. * You cannot set null to the attribute. + * * @param groupId Value to set member attribute groupId */ public void setGroupId(Long groupId) { @@ -182,6 +189,7 @@ public void setGroupId(Long groupId) { /** * Returns the value for the member attribute userId + * * @return Long - value of member attribute userId. */ public Long getUserId() { @@ -191,6 +199,7 @@ public Long getUserId() { /** * This method sets the value to the member attribute userId. * You cannot set null to the attribute. + * * @param userId Value to set member attribute userId */ public void setUserId(Long userId) { @@ -199,6 +208,7 @@ public void setUserId(Long userId) { /** * Returns the value for the member attribute auditType + * * @return int - value of member attribute auditType. */ public int getAuditType() { @@ -208,6 +218,7 @@ public int getAuditType() { /** * This method sets the value to the member attribute auditType. * You cannot set null to the attribute. + * * @param auditType Value to set member attribute auditType */ public void setAuditType(int auditType) { diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXAuthSession.java b/security-admin/src/main/java/org/apache/ranger/entity/XXAuthSession.java index 2842a57252..e8748b91d2 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXAuthSession.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXAuthSession.java @@ -76,23 +76,23 @@ public class XXAuthSession extends XXDBBase implements java.io.Serializable { /** * Max value for enum AuthStatus_MAX */ - public static final int AuthStatus_MAX = 6; + public static final int AuthStatus_MAX = 6; /** * AUTH_TYPE_UNKNOWN is an element of enum AuthType. Its value is "AUTH_TYPE_UNKNOWN". */ - public static final int AUTH_TYPE_UNKNOWN = 0; + public static final int AUTH_TYPE_UNKNOWN = 0; /** * AUTH_TYPE_PASSWORD is an element of enum AuthType. Its value is "AUTH_TYPE_PASSWORD". */ - public static final int AUTH_TYPE_PASSWORD = 1; + public static final int AUTH_TYPE_PASSWORD = 1; /** * AUTH_TYPE_KERBEROS is an element of enum AuthType. Its value is "AUTH_TYPE_KERBEROS". */ - public static final int AUTH_TYPE_KERBEROS = 2; + public static final int AUTH_TYPE_KERBEROS = 2; /** * AUTH_TYPE_SSO is an element of enum AuthType. Its value is "AUTH_TYPE_SSO". */ - public static final int AUTH_TYPE_SSO = 3; + public static final int AUTH_TYPE_SSO = 3; /** * Enum values for AuthType @@ -100,106 +100,96 @@ public class XXAuthSession extends XXDBBase implements java.io.Serializable { /** * AUTH_TYPE_TRUSTED_PROXY is an element of enum AuthType. Its value is "AUTH_TYPE_TRUSTED_PROXY". */ - public static final int AUTH_TYPE_TRUSTED_PROXY = 4; + public static final int AUTH_TYPE_TRUSTED_PROXY = 4; /** * Max value for enum AuthType_MAX */ - public static final int AuthType_MAX = 4; - private static final long serialVersionUID = 1L; + public static final int AuthType_MAX = 4; + private static final long serialVersionUID = 1L; @Id @SequenceGenerator(name = "X_AUTH_SESS_SEQ", sequenceName = "X_AUTH_SESS_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.AUTO, generator = "X_AUTH_SESS_SEQ") @Column(name = "ID") - protected Long id; + protected Long id; /** * Login ID of the user * - * */ @Column(name = "LOGIN_ID", nullable = false, length = 767) - protected String loginId; + protected String loginId; /** * Id of the user * - * */ @Column(name = "USER_ID") - protected Long userId; + protected Long userId; /** * External session id. Currently spring/http session * - * */ @Column(name = "EXT_SESS_ID", length = 512) - protected String extSessionId; + protected String extSessionId; /** * Date and time of authentication * - * */ @Temporal(TemporalType.TIMESTAMP) @Column(name = "AUTH_TIME", nullable = false) - protected Date authTime = DateUtil.getUTCDate(); + protected Date authTime = DateUtil.getUTCDate(); /** * Authentication status * - * */ @Column(name = "AUTH_STATUS", nullable = false) - protected int authStatus = AUTH_STATUS_UNKNOWN; + protected int authStatus = AUTH_STATUS_UNKNOWN; /** * Authentication type * - * */ @Column(name = "AUTH_TYPE", nullable = false) - protected int authType = AUTH_TYPE_UNKNOWN; + protected int authType = AUTH_TYPE_UNKNOWN; /** * Authentication provider * - * */ @Column(name = "AUTH_PROVIDER", nullable = false) - protected int authProvider = AUTH_TYPE_UNKNOWN; + protected int authProvider = AUTH_TYPE_UNKNOWN; /** * Type of the device * - * */ @Column(name = "DEVICE_TYPE", nullable = false) - protected int deviceType = RangerConstants.DEVICE_UNKNOWN; + protected int deviceType = RangerConstants.DEVICE_UNKNOWN; /** * IP where the request came from * - * */ @Column(name = "REQ_IP", nullable = false, length = 48) - protected String requestIP; + protected String requestIP; /** * UserAgent of the requesting device * - * */ @Column(name = "REQ_UA", length = 1024) - protected String requestUserAgent; + protected String requestUserAgent; /** * Default constructor. This will set all the attributes to default value. @@ -244,8 +234,14 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /** * Checks for all attributes except referenced db objects + * * @return true if all attributes match */ @Override @@ -286,6 +282,7 @@ public boolean equals(Object obj) { /** * This return the bean content in string format + * * @return formatedStr */ @Override @@ -307,6 +304,7 @@ public String toString() { /** * Returns the value for the member attribute loginId + * * @return String - value of member attribute loginId. */ public String getLoginId() { @@ -316,6 +314,7 @@ public String getLoginId() { /** * This method sets the value to the member attribute loginId. * You cannot set null to the attribute. + * * @param loginId Value to set member attribute loginId */ public void setLoginId(String loginId) { @@ -324,6 +323,7 @@ public void setLoginId(String loginId) { /** * Returns the value for the member attribute userId + * * @return Long - value of member attribute userId. */ public Long getUserId() { @@ -333,6 +333,7 @@ public Long getUserId() { /** * This method sets the value to the member attribute userId. * You cannot set null to the attribute. + * * @param userId Value to set member attribute userId */ public void setUserId(Long userId) { @@ -341,6 +342,7 @@ public void setUserId(Long userId) { /** * Returns the value for the member attribute extSessionId + * * @return String - value of member attribute extSessionId. */ public String getExtSessionId() { @@ -350,6 +352,7 @@ public String getExtSessionId() { /** * This method sets the value to the member attribute extSessionId. * You cannot set null to the attribute. + * * @param extSessionId Value to set member attribute extSessionId */ public void setExtSessionId(String extSessionId) { @@ -358,6 +361,7 @@ public void setExtSessionId(String extSessionId) { /** * Returns the value for the member attribute authTime + * * @return Date - value of member attribute authTime. */ public Date getAuthTime() { @@ -367,6 +371,7 @@ public Date getAuthTime() { /** * This method sets the value to the member attribute authTime. * You cannot set null to the attribute. + * * @param authTime Value to set member attribute authTime */ public void setAuthTime(Date authTime) { @@ -375,6 +380,7 @@ public void setAuthTime(Date authTime) { /** * Returns the value for the member attribute authStatus + * * @return int - value of member attribute authStatus. */ public int getAuthStatus() { @@ -384,6 +390,7 @@ public int getAuthStatus() { /** * This method sets the value to the member attribute authStatus. * You cannot set null to the attribute. + * * @param authStatus Value to set member attribute authStatus */ public void setAuthStatus(int authStatus) { @@ -392,6 +399,7 @@ public void setAuthStatus(int authStatus) { /** * Returns the value for the member attribute authType + * * @return int - value of member attribute authType. */ public int getAuthType() { @@ -401,6 +409,7 @@ public int getAuthType() { /** * This method sets the value to the member attribute authType. * You cannot set null to the attribute. + * * @param authType Value to set member attribute authType */ public void setAuthType(int authType) { @@ -409,6 +418,7 @@ public void setAuthType(int authType) { /** * Returns the value for the member attribute authProvider + * * @return int - value of member attribute authProvider. */ public int getAuthProvider() { @@ -418,6 +428,7 @@ public int getAuthProvider() { /** * This method sets the value to the member attribute authProvider. * You cannot set null to the attribute. + * * @param authProvider Value to set member attribute authProvider */ public void setAuthProvider(int authProvider) { @@ -426,6 +437,7 @@ public void setAuthProvider(int authProvider) { /** * Returns the value for the member attribute deviceType + * * @return int - value of member attribute deviceType. */ public int getDeviceType() { @@ -435,6 +447,7 @@ public int getDeviceType() { /** * This method sets the value to the member attribute deviceType. * You cannot set null to the attribute. + * * @param deviceType Value to set member attribute deviceType */ public void setDeviceType(int deviceType) { @@ -443,6 +456,7 @@ public void setDeviceType(int deviceType) { /** * Returns the value for the member attribute requestIP + * * @return String - value of member attribute requestIP. */ public String getRequestIP() { @@ -452,6 +466,7 @@ public String getRequestIP() { /** * This method sets the value to the member attribute requestIP. * You cannot set null to the attribute. + * * @param requestIP Value to set member attribute requestIP */ public void setRequestIP(String requestIP) { @@ -460,6 +475,7 @@ public void setRequestIP(String requestIP) { /** * Returns the value for the member attribute requestUserAgent + * * @return String - value of member attribute requestUserAgent. */ public String getRequestUserAgent() { @@ -469,6 +485,7 @@ public String getRequestUserAgent() { /** * This method sets the value to the member attribute requestUserAgent. * You cannot set null to the attribute. + * * @param requestUserAgent Value to set member attribute requestUserAgent */ public void setRequestUserAgent(String requestUserAgent) { diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXContextEnricherDef.java b/security-admin/src/main/java/org/apache/ranger/entity/XXContextEnricherDef.java index bef10038f3..8660882f98 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXContextEnricherDef.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXContextEnricherDef.java @@ -30,8 +30,7 @@ @Entity @Cacheable @Table(name = "x_context_enricher_def") -public class XXContextEnricherDef extends XXDBBase implements - java.io.Serializable { +public class XXContextEnricherDef extends XXDBBase implements java.io.Serializable { private static final long serialVersionUID = 1L; /** * id of the XXContextEnricherDef @@ -111,6 +110,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /* * (non-Javadoc) * @@ -175,8 +179,9 @@ public boolean equals(Object obj) { } if (order == null) { return other.order == null; - } else + } else { return order.equals(other.order); + } } /* @@ -188,10 +193,7 @@ public boolean equals(Object obj) { public String toString() { String str = "XXContextEnricherDef={"; str += super.toString(); - str += " [id=" + id + ", defId=" + defId + ", itemId=" + itemId - + ", name=" + name + ", enricher=" + enricherOptions - + ", enricherOptions=" + enricherOptions + ", order=" + order - + "]"; + str += " [id=" + id + ", defId=" + defId + ", itemId=" + itemId + ", name=" + name + ", enricher=" + enricherOptions + ", enricherOptions=" + enricherOptions + ", order=" + order + "]"; str += "}"; return str; } diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXCredentialStore.java b/security-admin/src/main/java/org/apache/ranger/entity/XXCredentialStore.java index 6b11ec0629..7fff020cab 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXCredentialStore.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXCredentialStore.java @@ -42,13 +42,12 @@ public class XXCredentialStore extends XXDBBase implements java.io.Serializable @SequenceGenerator(name = "X_CRED_STORE_SEQ", sequenceName = "X_CRED_STORE_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.AUTO, generator = "X_CRED_STORE_SEQ") @Column(name = "ID") - protected Long id; + protected Long id; /** * Name * - * */ @Column(name = "STORE_NAME", nullable = false, length = 1024) protected String name; @@ -57,7 +56,6 @@ public class XXCredentialStore extends XXDBBase implements java.io.Serializable * - * */ @Column(name = "DESCR", nullable = false, length = 4000) protected String description; @@ -94,8 +92,14 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /** * Checks for all attributes except referenced db objects + * * @return true if all attributes match */ @Override @@ -112,6 +116,7 @@ public boolean equals(Object obj) { /** * This return the bean content in string format + * * @return formatedStr */ @Override @@ -126,6 +131,7 @@ public String toString() { /** * Returns the value for the member attribute name + * * @return String - value of member attribute name. */ public String getName() { @@ -135,6 +141,7 @@ public String getName() { /** * This method sets the value to the member attribute name. * You cannot set null to the attribute. + * * @param name Value to set member attribute name */ public void setName(String name) { @@ -143,6 +150,7 @@ public void setName(String name) { /** * Returns the value for the member attribute description + * * @return String - value of member attribute description. */ public String getDescription() { @@ -152,6 +160,7 @@ public String getDescription() { /** * This method sets the value to the member attribute description. * You cannot set null to the attribute. + * * @param description Value to set member attribute description */ public void setDescription(String description) { diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXDBBase.java b/security-admin/src/main/java/org/apache/ranger/entity/XXDBBase.java index e99d10a206..c91575b010 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXDBBase.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXDBBase.java @@ -52,7 +52,6 @@ public abstract class XXDBBase implements java.io.Serializable { * Date/Time creation of this user. * - * */ @Temporal(TemporalType.TIMESTAMP) @Column(name = "CREATE_TIME") @@ -62,7 +61,6 @@ public abstract class XXDBBase implements java.io.Serializable { * Date value. * - * */ @Temporal(TemporalType.TIMESTAMP) @Column(name = "UPDATE_TIME") @@ -72,7 +70,6 @@ public abstract class XXDBBase implements java.io.Serializable { * Added by * - * */ @Column(name = "ADDED_BY_ID") protected Long addedByUserId; @@ -81,7 +78,6 @@ public abstract class XXDBBase implements java.io.Serializable { * Last updated by * - * */ @Column(name = "UPD_BY_ID") protected Long updatedByUserId; @@ -118,6 +114,7 @@ public String getMyDisplayValue() { /** * Returns the value for the member attribute id + * * @return Long - value of member attribute id. */ public abstract Long getId(); @@ -125,12 +122,14 @@ public String getMyDisplayValue() { /** * This method sets the value to the member attribute id. * You cannot set null to the attribute. + * * @param id Value to set member attribute id */ public abstract void setId(Long id); /** * Returns the value for the member attribute createTime + * * @return Date - value of member attribute createTime. */ public Date getCreateTime() { @@ -140,6 +139,7 @@ public Date getCreateTime() { /** * This method sets the value to the member attribute createTime. * You cannot set null to the attribute. + * * @param createTime Value to set member attribute createTime */ public void setCreateTime(Date createTime) { @@ -148,6 +148,7 @@ public void setCreateTime(Date createTime) { /** * Returns the value for the member attribute updateTime + * * @return Date - value of member attribute updateTime. */ public Date getUpdateTime() { @@ -157,6 +158,7 @@ public Date getUpdateTime() { /** * This method sets the value to the member attribute updateTime. * You cannot set null to the attribute. + * * @param updateTime Value to set member attribute updateTime */ public void setUpdateTime(Date updateTime) { @@ -165,6 +167,7 @@ public void setUpdateTime(Date updateTime) { /** * Returns the value for the member attribute addedByUserId + * * @return Long - value of member attribute addedByUserId. */ public Long getAddedByUserId() { @@ -174,6 +177,7 @@ public Long getAddedByUserId() { /** * This method sets the value to the member attribute addedByUserId. * You cannot set null to the attribute. + * * @param addedByUserId Value to set member attribute addedByUserId */ public void setAddedByUserId(Long addedByUserId) { @@ -182,6 +186,7 @@ public void setAddedByUserId(Long addedByUserId) { /** * Returns the value for the member attribute updatedByUserId + * * @return Long - value of member attribute updatedByUserId. */ public Long getUpdatedByUserId() { @@ -191,6 +196,7 @@ public Long getUpdatedByUserId() { /** * This method sets the value to the member attribute updatedByUserId. * You cannot set null to the attribute. + * * @param updatedByUserId Value to set member attribute updatedByUserId */ public void setUpdatedByUserId(Long updatedByUserId) { @@ -204,14 +210,12 @@ public int hashCode() { /** * Checks for all attributes except referenced db objects + * * @return true if all attributes match */ @Override public boolean equals(Object obj) { XXDBBase other = (XXDBBase) obj; -// if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { -// return false; -// } if ((this.createTime == null && other.createTime != null) || (this.createTime != null && !this.createTime.equals(other.createTime))) { return false; } @@ -226,6 +230,7 @@ public boolean equals(Object obj) { /** * This return the bean content in string format + * * @return formatedStr */ @Override diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXDataHist.java b/security-admin/src/main/java/org/apache/ranger/entity/XXDataHist.java index fe35b39468..091c7b9474 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXDataHist.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXDataHist.java @@ -349,6 +349,11 @@ public void setContent(String content) { this.content = content; } + @Override + public int hashCode() { + return super.hashCode(); + } + /* * (non-Javadoc) * @@ -434,8 +439,9 @@ public boolean equals(Object obj) { } if (version == null) { return other.version == null; - } else + } else { return version.equals(other.version); + } } /* diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXDataMaskTypeDef.java b/security-admin/src/main/java/org/apache/ranger/entity/XXDataMaskTypeDef.java index 4492e3aaa2..bfcb5472b7 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXDataMaskTypeDef.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXDataMaskTypeDef.java @@ -142,6 +142,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /* * (non-Javadoc) * @@ -234,8 +239,9 @@ public boolean equals(Object obj) { } if (order == null) { return other.order == null; - } else + } else { return order.equals(other.order); + } } /* diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXEnumDef.java b/security-admin/src/main/java/org/apache/ranger/entity/XXEnumDef.java index b7d5daa4db..c3aaab6133 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXEnumDef.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXEnumDef.java @@ -94,6 +94,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /* * (non-Javadoc) * @@ -144,8 +149,9 @@ public boolean equals(Object obj) { } if (name == null) { return other.name == null; - } else + } else { return name.equals(other.name); + } } /* diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXEnumElementDef.java b/security-admin/src/main/java/org/apache/ranger/entity/XXEnumElementDef.java index 17175e5717..e25e5a5675 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXEnumElementDef.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXEnumElementDef.java @@ -110,6 +110,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /* * (non-Javadoc) * @@ -167,8 +172,9 @@ public boolean equals(Object obj) { } if (rbKeyLabel == null) { return other.rbKeyLabel == null; - } else + } else { return rbKeyLabel.equals(other.rbKeyLabel); + } } /* diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXGdsDataShare.java b/security-admin/src/main/java/org/apache/ranger/entity/XXGdsDataShare.java index a2bcb0af3a..5be604e243 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXGdsDataShare.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXGdsDataShare.java @@ -91,70 +91,132 @@ public class XXGdsDataShare extends XXDBBase implements Serializable { @Column(name = "additional_info") protected String additionalInfo; - public String getGuid() {return guid;} + public String getGuid() { + return guid; + } - public void setGuid(String guid) {this.guid = guid;} + public void setGuid(String guid) { + this.guid = guid; + } - public Long getVersion() {return version;} + public Long getVersion() { + return version; + } - public void setVersion(Long version) {this.version = version;} + public void setVersion(Long version) { + this.version = version; + } - public Boolean getIsEnabled() {return isEnabled;} + public Boolean getIsEnabled() { + return isEnabled; + } - public void setIsEnabled(Boolean isEnabled) {this.isEnabled = isEnabled;} + public void setIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + } - public Long getServiceId() {return serviceId;} + public Long getServiceId() { + return serviceId; + } - public void setServiceId(Long serviceId) {this.serviceId = serviceId;} + public void setServiceId(Long serviceId) { + this.serviceId = serviceId; + } - public Long getZoneId() {return zoneId;} + public Long getZoneId() { + return zoneId; + } - public void setZoneId(Long zoneId) {this.zoneId = zoneId;} + public void setZoneId(Long zoneId) { + this.zoneId = zoneId; + } - public String getName() {return name;} + public String getName() { + return name; + } - public void setName(String name) {this.name = name;} + public void setName(String name) { + this.name = name; + } - public String getDescription() {return description;} + public String getDescription() { + return description; + } - public void setDescription(String description) {this.description = description;} + public void setDescription(String description) { + this.description = description; + } - public String getAcl() {return acl;} + public String getAcl() { + return acl; + } - public void setAcl(String acl) {this.acl = acl;} + public void setAcl(String acl) { + this.acl = acl; + } - public String getConditionExpr() {return conditionExpr;} + public String getConditionExpr() { + return conditionExpr; + } - public void setConditionExpr(String conditionExpr) {this.conditionExpr = conditionExpr;} + public void setConditionExpr(String conditionExpr) { + this.conditionExpr = conditionExpr; + } - public String getDefaultAccessTypes() {return defaultAccessTypes;} + public String getDefaultAccessTypes() { + return defaultAccessTypes; + } - public void setDefaultAccessTypes(String defaultAccessTypes) {this.defaultAccessTypes = defaultAccessTypes;} + public void setDefaultAccessTypes(String defaultAccessTypes) { + this.defaultAccessTypes = defaultAccessTypes; + } - public String getDefaultTagMasks() {return defaultTagMasks;} + public String getDefaultTagMasks() { + return defaultTagMasks; + } - public void setDefaultTagMasks(String defaultMasks) {this.defaultTagMasks = defaultMasks;} + public void setDefaultTagMasks(String defaultMasks) { + this.defaultTagMasks = defaultMasks; + } - public String getTermsOfUse() {return termsOfUse;} + public String getTermsOfUse() { + return termsOfUse; + } - public void setTermsOfUse(String termsOfUse) {this.termsOfUse = termsOfUse;} + public void setTermsOfUse(String termsOfUse) { + this.termsOfUse = termsOfUse; + } - public String getOptions() {return options;} + public String getOptions() { + return options; + } - public void setOptions(String options) {this.options = options;} + public void setOptions(String options) { + this.options = options; + } - public String getAdditionalInfo() {return additionalInfo;} + public String getAdditionalInfo() { + return additionalInfo; + } - public void setAdditionalInfo(String additionalInfo) {this.additionalInfo = additionalInfo;} + public void setAdditionalInfo(String additionalInfo) { + this.additionalInfo = additionalInfo; + } @Override - public int getMyClassType() {return AppConstants.CLASS_TYPE_GDS_DATA_SHARE;} + public int getMyClassType() { + return AppConstants.CLASS_TYPE_GDS_DATA_SHARE; + } @Override - public Long getId() {return id;} + public Long getId() { + return id; + } @Override - public void setId(Long id) {this.id = id;} + public void setId(Long id) { + this.id = id; + } @Override public int hashCode() { diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXGdsDataShareInDataset.java b/security-admin/src/main/java/org/apache/ranger/entity/XXGdsDataShareInDataset.java index 014cf9389d..a273ed573e 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXGdsDataShareInDataset.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXGdsDataShareInDataset.java @@ -85,62 +85,116 @@ public class XXGdsDataShareInDataset extends XXDBBase implements Serializable { @Column(name = "approver_id") protected Long approverId; - public String getGuid() {return guid;} + public String getGuid() { + return guid; + } - public void setGuid(String guid) {this.guid = guid;} + public void setGuid(String guid) { + this.guid = guid; + } - public Long getVersion() {return version;} + public Long getVersion() { + return version; + } - public void setVersion(Long version) {this.version = version;} + public void setVersion(Long version) { + this.version = version; + } - public Boolean getIsEnabled() {return isEnabled;} + public Boolean getIsEnabled() { + return isEnabled; + } - public void setIsEnabled(Boolean isEnabled) {this.isEnabled = isEnabled;} + public void setIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + } - public String getDescription() {return description;} + public String getDescription() { + return description; + } - public void setDescription(String description) {this.description = description;} + public void setDescription(String description) { + this.description = description; + } - public Long getDataShareId() {return dataShareId;} + public Long getDataShareId() { + return dataShareId; + } - public void setDataShareId(Long dataShareId) {this.dataShareId = dataShareId;} + public void setDataShareId(Long dataShareId) { + this.dataShareId = dataShareId; + } - public Long getDatasetId() {return datasetId;} + public Long getDatasetId() { + return datasetId; + } - public void setDatasetId(Long datasetId) {this.datasetId = datasetId;} + public void setDatasetId(Long datasetId) { + this.datasetId = datasetId; + } - public Short getStatus() {return status;} + public Short getStatus() { + return status; + } - public void setStatus(Short status) {this.status = status;} + public void setStatus(Short status) { + this.status = status; + } - public String getValidityPeriod() {return validityPeriod;} + public String getValidityPeriod() { + return validityPeriod; + } - public void setValidityPeriod(String validityPeriod) {this.validityPeriod = validityPeriod;} + public void setValidityPeriod(String validityPeriod) { + this.validityPeriod = validityPeriod; + } - public String getProfiles() {return profiles;} + public String getProfiles() { + return profiles; + } - public void setProfiles(String profiles) {this.profiles = profiles;} + public void setProfiles(String profiles) { + this.profiles = profiles; + } - public String getOptions() {return options;} + public String getOptions() { + return options; + } - public void setOptions(String options) {this.options = options;} + public void setOptions(String options) { + this.options = options; + } - public String getAdditionalInfo() {return additionalInfo;} + public String getAdditionalInfo() { + return additionalInfo; + } - public void setAdditionalInfo(String additionalInfo) {this.additionalInfo = additionalInfo;} + public void setAdditionalInfo(String additionalInfo) { + this.additionalInfo = additionalInfo; + } - public Long getApproverId() {return approverId;} + public Long getApproverId() { + return approverId; + } - public void setApproverId(Long approverId) {this.approverId = approverId;} + public void setApproverId(Long approverId) { + this.approverId = approverId; + } @Override - public int getMyClassType() {return AppConstants.CLASS_TYPE_GDS_DATA_SHARE_IN_DATASET;} + public int getMyClassType() { + return AppConstants.CLASS_TYPE_GDS_DATA_SHARE_IN_DATASET; + } @Override - public Long getId() {return id;} + public Long getId() { + return id; + } @Override - public void setId(Long id) {this.id = id;} + public void setId(Long id) { + this.id = id; + } @Override public int hashCode() { diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXGdsDataset.java b/security-admin/src/main/java/org/apache/ranger/entity/XXGdsDataset.java index 3052be4c3f..b3fb531bac 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXGdsDataset.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXGdsDataset.java @@ -85,41 +85,77 @@ public class XXGdsDataset extends XXDBBase implements Serializable { @Column(name = "keywords") protected String keywords; - public String getGuid() {return guid;} + public String getGuid() { + return guid; + } - public void setGuid(String guid) {this.guid = guid;} + public void setGuid(String guid) { + this.guid = guid; + } - public Long getVersion() {return version;} + public Long getVersion() { + return version; + } - public void setVersion(Long version) {this.version = version;} + public void setVersion(Long version) { + this.version = version; + } - public Boolean getIsEnabled() {return isEnabled;} + public Boolean getIsEnabled() { + return isEnabled; + } - public void setIsEnabled(Boolean isEnabled) {this.isEnabled = isEnabled;} + public void setIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + } - public String getName() {return name;} + public String getName() { + return name; + } - public void setName(String name) {this.name = name;} + public void setName(String name) { + this.name = name; + } - public String getDescription() {return description;} + public String getDescription() { + return description; + } - public void setDescription(String description) {this.description = description;} + public void setDescription(String description) { + this.description = description; + } - public String getAcl() {return acl;} + public String getAcl() { + return acl; + } - public void setAcl(String acl) {this.acl = acl;} + public void setAcl(String acl) { + this.acl = acl; + } - public String getTermsOfUse() {return termsOfUse;} + public String getTermsOfUse() { + return termsOfUse; + } - public void setTermsOfUse(String termsOfUse) {this.termsOfUse = termsOfUse;} + public void setTermsOfUse(String termsOfUse) { + this.termsOfUse = termsOfUse; + } - public String getOptions() {return options;} + public String getOptions() { + return options; + } - public void setOptions(String options) {this.options = options;} + public void setOptions(String options) { + this.options = options; + } - public String getAdditionalInfo() {return additionalInfo;} + public String getAdditionalInfo() { + return additionalInfo; + } - public void setAdditionalInfo(String additionalInfo) {this.additionalInfo = additionalInfo;} + public void setAdditionalInfo(String additionalInfo) { + this.additionalInfo = additionalInfo; + } public String getValiditySchedule() { return validitySchedule; @@ -146,13 +182,19 @@ public void setKeywords(String keywords) { } @Override - public int getMyClassType() {return AppConstants.CLASS_TYPE_GDS_DATASET;} + public int getMyClassType() { + return AppConstants.CLASS_TYPE_GDS_DATASET; + } @Override - public Long getId() {return id;} + public Long getId() { + return id; + } @Override - public void setId(Long id) {this.id = id;} + public void setId(Long id) { + this.id = id; + } @Override public int hashCode() { diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXGdsDatasetInProject.java b/security-admin/src/main/java/org/apache/ranger/entity/XXGdsDatasetInProject.java index f27552d862..1732f34b68 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXGdsDatasetInProject.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXGdsDatasetInProject.java @@ -85,62 +85,116 @@ public class XXGdsDatasetInProject extends XXDBBase implements Serializable { @Column(name = "approver_id") protected Long approverId; - public String getGuid() {return guid;} + public String getGuid() { + return guid; + } - public void setGuid(String guid) {this.guid = guid;} + public void setGuid(String guid) { + this.guid = guid; + } - public Long getVersion() {return version;} + public Long getVersion() { + return version; + } - public void setVersion(Long version) {this.version = version;} + public void setVersion(Long version) { + this.version = version; + } - public Boolean getIsEnabled() {return isEnabled;} + public Boolean getIsEnabled() { + return isEnabled; + } - public void setIsEnabled(Boolean isEnabled) {this.isEnabled = isEnabled;} + public void setIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + } - public String getDescription() {return description;} + public String getDescription() { + return description; + } - public void setDescription(String description) {this.description = description;} + public void setDescription(String description) { + this.description = description; + } - public Long getDatasetId() {return datasetId;} + public Long getDatasetId() { + return datasetId; + } - public void setDatasetId(Long datasetId) {this.datasetId = datasetId;} + public void setDatasetId(Long datasetId) { + this.datasetId = datasetId; + } - public Long getProjectId() {return projectId;} + public Long getProjectId() { + return projectId; + } - public void setProjectId(Long projectId) {this.projectId = projectId;} + public void setProjectId(Long projectId) { + this.projectId = projectId; + } - public Short getStatus() {return status;} + public Short getStatus() { + return status; + } - public void setStatus(Short status) {this.status = status;} + public void setStatus(Short status) { + this.status = status; + } - public String getValidityPeriod() {return validityPeriod;} + public String getValidityPeriod() { + return validityPeriod; + } - public void setValidityPeriod(String validityPeriod) {this.validityPeriod = validityPeriod;} + public void setValidityPeriod(String validityPeriod) { + this.validityPeriod = validityPeriod; + } - public String getProfiles() {return profiles;} + public String getProfiles() { + return profiles; + } - public void setProfiles(String profiles) {this.profiles = profiles;} + public void setProfiles(String profiles) { + this.profiles = profiles; + } - public String getOptions() {return options;} + public String getOptions() { + return options; + } - public void setOptions(String options) {this.options = options;} + public void setOptions(String options) { + this.options = options; + } - public String getAdditionalInfo() {return additionalInfo;} + public String getAdditionalInfo() { + return additionalInfo; + } - public void setAdditionalInfo(String additionalInfo) {this.additionalInfo = additionalInfo;} + public void setAdditionalInfo(String additionalInfo) { + this.additionalInfo = additionalInfo; + } - public Long getApproverId() {return approverId;} + public Long getApproverId() { + return approverId; + } - public void setApproverId(Long approverId) {this.approverId = approverId;} + public void setApproverId(Long approverId) { + this.approverId = approverId; + } @Override - public int getMyClassType() {return AppConstants.CLASS_TYPE_GDS_DATASET_IN_PROJECT;} + public int getMyClassType() { + return AppConstants.CLASS_TYPE_GDS_DATASET_IN_PROJECT; + } @Override - public Long getId() {return id;} + public Long getId() { + return id; + } @Override - public void setId(Long id) {this.id = id;} + public void setId(Long id) { + this.id = id; + } @Override public int hashCode() { diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXGdsDatasetPolicyMap.java b/security-admin/src/main/java/org/apache/ranger/entity/XXGdsDatasetPolicyMap.java index 3f638cc0c3..2166eb87be 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXGdsDatasetPolicyMap.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXGdsDatasetPolicyMap.java @@ -60,19 +60,33 @@ public XXGdsDatasetPolicyMap(Long datasetId, Long policyId) { setPolicyId(policyId); } - public Long getId() {return id;} + public Long getId() { + return id; + } - public void setId(Long id) {this.id = id;} + public void setId(Long id) { + this.id = id; + } - public Long getDatasetId() {return datasetId;} + public Long getDatasetId() { + return datasetId; + } - public void setDatasetId(Long datasetId) {this.datasetId = datasetId;} + public void setDatasetId(Long datasetId) { + this.datasetId = datasetId; + } - public Long getPolicyId() {return policyId;} + public Long getPolicyId() { + return policyId; + } - public void setPolicyId(Long policyId) {this.policyId = policyId;} + public void setPolicyId(Long policyId) { + this.policyId = policyId; + } - public int getMyClassType() {return AppConstants.CLASS_TYPE_GDS_DATASET_POLICY_MAP;} + public int getMyClassType() { + return AppConstants.CLASS_TYPE_GDS_DATASET_POLICY_MAP; + } @Override public int hashCode() { diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXGdsProject.java b/security-admin/src/main/java/org/apache/ranger/entity/XXGdsProject.java index ea3b83a070..c3684b2a98 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXGdsProject.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXGdsProject.java @@ -76,50 +76,92 @@ public class XXGdsProject extends XXDBBase implements Serializable { @Column(name = "additional_info") protected String additionalInfo; - public String getGuid() {return guid;} + public String getGuid() { + return guid; + } - public void setGuid(String guid) {this.guid = guid;} + public void setGuid(String guid) { + this.guid = guid; + } - public Long getVersion() {return version;} + public Long getVersion() { + return version; + } - public void setVersion(Long version) {this.version = version;} + public void setVersion(Long version) { + this.version = version; + } - public Boolean getIsEnabled() {return isEnabled;} + public Boolean getIsEnabled() { + return isEnabled; + } - public void setIsEnabled(Boolean isEnabled) {this.isEnabled = isEnabled;} + public void setIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + } - public String getName() {return name;} + public String getName() { + return name; + } - public void setName(String name) {this.name = name;} + public void setName(String name) { + this.name = name; + } - public String getDescription() {return description;} + public String getDescription() { + return description; + } - public void setDescription(String description) {this.description = description;} + public void setDescription(String description) { + this.description = description; + } - public String getAcl() {return acl;} + public String getAcl() { + return acl; + } - public void setAcl(String acl) {this.acl = acl;} + public void setAcl(String acl) { + this.acl = acl; + } - public String getTermsOfUse() {return termsOfUse;} + public String getTermsOfUse() { + return termsOfUse; + } - public void setTermsOfUse(String termsOfUse) {this.termsOfUse = termsOfUse;} + public void setTermsOfUse(String termsOfUse) { + this.termsOfUse = termsOfUse; + } - public String getOptions() {return options;} + public String getOptions() { + return options; + } - public void setOptions(String options) {this.options = options;} + public void setOptions(String options) { + this.options = options; + } - public String getAdditionalInfo() {return additionalInfo;} + public String getAdditionalInfo() { + return additionalInfo; + } - public void setAdditionalInfo(String additionalInfo) {this.additionalInfo = additionalInfo;} + public void setAdditionalInfo(String additionalInfo) { + this.additionalInfo = additionalInfo; + } @Override - public int getMyClassType() {return AppConstants.CLASS_TYPE_GDS_PROJECT;} + public int getMyClassType() { + return AppConstants.CLASS_TYPE_GDS_PROJECT; + } @Override - public Long getId() {return id;} + public Long getId() { + return id; + } @Override - public void setId(Long id) {this.id = id;} + public void setId(Long id) { + this.id = id; + } @Override public int hashCode() { diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXGdsProjectPolicyMap.java b/security-admin/src/main/java/org/apache/ranger/entity/XXGdsProjectPolicyMap.java index a7853ca3bd..4b503188fc 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXGdsProjectPolicyMap.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXGdsProjectPolicyMap.java @@ -60,19 +60,33 @@ public XXGdsProjectPolicyMap(Long projectId, Long policyId) { setPolicyId(policyId); } - public Long getId() {return id;} + public Long getId() { + return id; + } - public void setId(Long id) {this.id = id;} + public void setId(Long id) { + this.id = id; + } - public Long getProjectId() {return projectId;} + public Long getProjectId() { + return projectId; + } - public void setProjectId(Long projectId) {this.projectId = projectId;} + public void setProjectId(Long projectId) { + this.projectId = projectId; + } - public Long getPolicyId() {return policyId;} + public Long getPolicyId() { + return policyId; + } - public void setPolicyId(Long policyId) {this.policyId = policyId;} + public void setPolicyId(Long policyId) { + this.policyId = policyId; + } - public int getMyClassType() {return AppConstants.CLASS_TYPE_GDS_PROJECT_POLICY_MAP;} + public int getMyClassType() { + return AppConstants.CLASS_TYPE_GDS_PROJECT_POLICY_MAP; + } @Override public int hashCode() { diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXGdsSharedResource.java b/security-admin/src/main/java/org/apache/ranger/entity/XXGdsSharedResource.java index c7c01b26aa..297e1021f7 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXGdsSharedResource.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXGdsSharedResource.java @@ -100,82 +100,156 @@ public class XXGdsSharedResource extends XXDBBase implements Serializable { @Column(name = "additional_info") protected String additionalInfo; - public String getGuid() {return guid;} + public String getGuid() { + return guid; + } - public void setGuid(String guid) {this.guid = guid;} + public void setGuid(String guid) { + this.guid = guid; + } - public Long getVersion() {return version;} + public Long getVersion() { + return version; + } - public void setVersion(Long version) {this.version = version;} + public void setVersion(Long version) { + this.version = version; + } - public Boolean getIsEnabled() {return isEnabled;} + public Boolean getIsEnabled() { + return isEnabled; + } - public void setIsEnabled(Boolean isEnabled) {this.isEnabled = isEnabled;} + public void setIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + } - public String getName() {return name;} + public String getName() { + return name; + } - public void setName(String name) {this.name = name;} + public void setName(String name) { + this.name = name; + } - public String getDescription() {return description;} + public String getDescription() { + return description; + } - public void setDescription(String description) {this.description = description;} + public void setDescription(String description) { + this.description = description; + } - public Long getDataShareId() {return dataShareId;} + public Long getDataShareId() { + return dataShareId; + } - public void setDataShareId(Long dataShareId) {this.dataShareId = dataShareId;} + public void setDataShareId(Long dataShareId) { + this.dataShareId = dataShareId; + } - public String getResource() {return resource;} + public String getResource() { + return resource; + } - public void setResource(String resource) {this.resource = resource;} + public void setResource(String resource) { + this.resource = resource; + } - public String getSubResource() {return subResource;} + public String getSubResource() { + return subResource; + } - public void setSubResource(String subResource) {this.subResource = subResource;} + public void setSubResource(String subResource) { + this.subResource = subResource; + } - public String getSubResourceType() {return subResourceType;} + public String getSubResourceType() { + return subResourceType; + } - public void setSubResourceType(String subResourceType) {this.subResourceType = subResourceType;} + public void setSubResourceType(String subResourceType) { + this.subResourceType = subResourceType; + } - public String getResourceSignature() {return resourceSignature;} + public String getResourceSignature() { + return resourceSignature; + } - public void setResourceSignature(String resourceSignature) {this.resourceSignature = resourceSignature;} + public void setResourceSignature(String resourceSignature) { + this.resourceSignature = resourceSignature; + } - public String getConditionExpr() {return conditionExpr;} + public String getConditionExpr() { + return conditionExpr; + } - public void setConditionExpr(String conditionExpr) {this.conditionExpr = conditionExpr;} + public void setConditionExpr(String conditionExpr) { + this.conditionExpr = conditionExpr; + } - public String getAccessTypes() {return accessTypes;} + public String getAccessTypes() { + return accessTypes; + } - public void setAccessTypes(String accessTypes) {this.accessTypes = accessTypes;} + public void setAccessTypes(String accessTypes) { + this.accessTypes = accessTypes; + } - public String getRowFilter() {return rowFilter;} + public String getRowFilter() { + return rowFilter; + } - public void setRowFilter(String rowFilter) {this.rowFilter = rowFilter;} + public void setRowFilter(String rowFilter) { + this.rowFilter = rowFilter; + } - public String getSubResourceMasks() {return subResourceMasks;} + public String getSubResourceMasks() { + return subResourceMasks; + } - public void setSubResourceMasks(String subResourceMasks) {this.subResourceMasks = subResourceMasks;} + public void setSubResourceMasks(String subResourceMasks) { + this.subResourceMasks = subResourceMasks; + } - public String getProfiles() {return profiles;} + public String getProfiles() { + return profiles; + } - public void setProfiles(String profiles) {this.profiles = profiles;} + public void setProfiles(String profiles) { + this.profiles = profiles; + } - public String getOptions() {return options;} + public String getOptions() { + return options; + } - public void setOptions(String options) {this.options = options;} + public void setOptions(String options) { + this.options = options; + } - public String getAdditionalInfo() {return additionalInfo;} + public String getAdditionalInfo() { + return additionalInfo; + } - public void setAdditionalInfo(String additionalInfo) {this.additionalInfo = additionalInfo;} + public void setAdditionalInfo(String additionalInfo) { + this.additionalInfo = additionalInfo; + } @Override - public int getMyClassType() {return AppConstants.CLASS_TYPE_GDS_SHARED_RESOURCE;} + public int getMyClassType() { + return AppConstants.CLASS_TYPE_GDS_SHARED_RESOURCE; + } @Override - public Long getId() {return id;} + public Long getId() { + return id; + } @Override - public void setId(Long id) {this.id = id;} + public void setId(Long id) { + this.id = id; + } @Override public int hashCode() { diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXGlobalState.java b/security-admin/src/main/java/org/apache/ranger/entity/XXGlobalState.java index c487122294..7fa88168c7 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXGlobalState.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXGlobalState.java @@ -49,6 +49,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), id); + } + @Override public boolean equals(Object obj) { if (this == obj) { @@ -66,14 +71,8 @@ public boolean equals(Object obj) { return Objects.equals(id, other.id); } - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), id); - } - @Override public String toString() { return "GlobalState [id=" + id + "]"; } } - diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXGlobalStateBase.java b/security-admin/src/main/java/org/apache/ranger/entity/XXGlobalStateBase.java index 88fc443ef6..2e5a476599 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXGlobalStateBase.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXGlobalStateBase.java @@ -37,17 +37,25 @@ public abstract class XXGlobalStateBase extends XXDBBase { @Column(name = "app_data") protected String appData; - public Long getVersion() {return version;} + public Long getVersion() { + return version; + } - public String getStateName() {return stateName;} + public String getStateName() { + return stateName; + } public void setStateName(String stateName) { this.stateName = stateName; } - public String getAppData() {return appData;} + public String getAppData() { + return appData; + } - public void setAppData(String appData) {this.appData = appData;} + public void setAppData(String appData) { + this.appData = appData; + } @Override public int hashCode() { @@ -82,4 +90,3 @@ public String toString() { return str; } } - diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXGroup.java b/security-admin/src/main/java/org/apache/ranger/entity/XXGroup.java index adb6587d7e..d9367037ba 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXGroup.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXGroup.java @@ -44,46 +44,36 @@ public class XXGroup extends XXDBBase implements java.io.Serializable { @SequenceGenerator(name = "X_GROUP_SEQ", sequenceName = "X_GROUP_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.AUTO, generator = "X_GROUP_SEQ") @Column(name = "ID") - protected Long id; + protected Long id; /** * Name * - * */ @Column(name = "GROUP_NAME", nullable = false, length = 1024) - protected String name; @Override - public void setId(Long id) { - this.id = id; - } + protected String name; /** * Description * - * */ @Column(name = "DESCR", nullable = false, length = 4000) - protected String description; @Override - public Long getId() { - return id; - } + protected String description; /** * Status * - * */ @Column(name = "STATUS", nullable = false) - protected int status = RangerConstants.STATUS_DISABLED; + protected int status = RangerConstants.STATUS_DISABLED; /** * IsVisible * - * */ @Column(name = "IS_VISIBLE", nullable = false) protected Integer isVisible; @@ -92,36 +82,32 @@ public Long getId() { * - * */ @Column(name = "GROUP_TYPE", nullable = false) - protected int groupType = AppConstants.XA_GROUP_UNKNOWN; + protected int groupType = AppConstants.XA_GROUP_UNKNOWN; @Column(name = "GROUP_SRC", nullable = false) - protected int groupSource = RangerCommonEnums.GROUP_INTERNAL; + protected int groupSource = RangerCommonEnums.GROUP_INTERNAL; /** * Id of the credential store * - * */ @Column(name = "CRED_STORE_ID") - protected Long credStoreId; + protected Long credStoreId; /** * Additional store attributes. * - * */ @Column(name = "OTHER_ATTRIBUTES") - protected String otherAttributes; + protected String otherAttributes; /** * Sync Source Attribute. * - * */ @Column(name = "SYNC_SOURCE") - protected String syncSource; + protected String syncSource; /** * Default constructor. This will set all the attributes to default value. @@ -155,8 +141,72 @@ public String getMyDisplayValue() { return getDescription(); } + @Override + public Long getId() { + return id; + } + + @Override + public void setId(Long id) { + this.id = id; + } + + @Override + public int hashCode() { + return super.hashCode(); + } + + /** + * Checks for all attributes except referenced db objects + * + * @return true if all attributes match + */ + @Override + public boolean equals(Object obj) { + if (!super.equals(obj)) { + return false; + } + XXGroup other = (XXGroup) obj; + if ((this.name == null && other.name != null) || (this.name != null && !this.name.equals(other.name))) { + return false; + } + if ((this.description == null && other.description != null) || (this.description != null && !this.description.equals(other.description))) { + return false; + } + if (this.status != other.status) { + return false; + } + if (this.groupType != other.groupType) { + return false; + } + return (this.credStoreId != null || other.credStoreId == null) && (this.credStoreId == null || this.credStoreId.equals(other.credStoreId)); + } + + /** + * This return the bean content in string format + * + * @return formatedStr + */ + @Override + public String toString() { + String str = "XXGroup={"; + str += super.toString(); + str += "name={" + name + "} "; + str += "description={" + description + "} "; + str += "status={" + status + "} "; + str += "isvisible={" + isVisible + "} "; + str += "groupType={" + groupType + "} "; + str += "credStoreId={" + credStoreId + "} "; + str += "groupSrc={" + groupSource + "} "; + str += "otherAttributes={" + otherAttributes + "} "; + str += "syncSource={" + syncSource + "} "; + str += "}"; + return str; + } + /** * Returns the value for the member attribute name + * * @return String - value of member attribute name. */ public String getName() { @@ -166,6 +216,7 @@ public String getName() { /** * This method sets the value to the member attribute name. * You cannot set null to the attribute. + * * @param name Value to set member attribute name */ public void setName(String name) { @@ -174,6 +225,7 @@ public void setName(String name) { /** * Returns the value for the member attribute description + * * @return String - value of member attribute description. */ public String getDescription() { @@ -183,6 +235,7 @@ public String getDescription() { /** * This method sets the value to the member attribute description. * You cannot set null to the attribute. + * * @param description Value to set member attribute description */ public void setDescription(String description) { @@ -191,6 +244,7 @@ public void setDescription(String description) { /** * Returns the value for the member attribute status + * * @return int - value of member attribute status. */ public int getStatus() { @@ -200,6 +254,7 @@ public int getStatus() { /** * This method sets the value to the member attribute status. * You cannot set null to the attribute. + * * @param status Value to set member attribute status */ public void setStatus(int status) { @@ -222,6 +277,7 @@ public void setIsVisible(Integer isVisible) { /** * Returns the value for the member attribute groupType + * * @return int - value of member attribute groupType. */ public int getGroupType() { @@ -231,6 +287,7 @@ public int getGroupType() { /** * This method sets the value to the member attribute groupType. * You cannot set null to the attribute. + * * @param groupType Value to set member attribute groupType */ public void setGroupType(int groupType) { @@ -239,6 +296,7 @@ public void setGroupType(int groupType) { /** * Returns the value for the member attribute credStoreId + * * @return Long - value of member attribute credStoreId. */ public Long getCredStoreId() { @@ -248,6 +306,7 @@ public Long getCredStoreId() { /** * This method sets the value to the member attribute credStoreId. * You cannot set null to the attribute. + * * @param credStoreId Value to set member attribute credStoreId */ public void setCredStoreId(Long credStoreId) { @@ -265,6 +324,7 @@ public String getOtherAttributes() { /** * This method sets JSON {@link String} representation of additional store attributes. * This method accepts null values. + * * @param otherAttributes */ public void setOtherAttributes(String otherAttributes) { @@ -275,11 +335,14 @@ public void setOtherAttributes(String otherAttributes) { * @return JSON {@link String} representation of sync source attribute if available, * null otherwise. */ - public String getSyncSource() {return syncSource;} + public String getSyncSource() { + return syncSource; + } /** * This method sets JSON {@link String} representation of sync source attribute. * This method accepts null values. + * * @param syncSource */ public void setSyncSource(String syncSource) { @@ -292,55 +355,5 @@ public int getGroupSource() { public void setGroupSource(int groupSource) { this.groupSource = groupSource; - } /** - * This return the bean content in string format - * @return formatedStr - */ - @Override - public String toString() { - String str = "XXGroup={"; - str += super.toString(); - str += "name={" + name + "} "; - str += "description={" + description + "} "; - str += "status={" + status + "} "; - str += "isvisible={" + isVisible + "} "; - str += "groupType={" + groupType + "} "; - str += "credStoreId={" + credStoreId + "} "; - str += "groupSrc={" + groupSource + "} "; - str += "otherAttributes={" + otherAttributes + "} "; - str += "syncSource={" + syncSource + "} "; - str += "}"; - return str; - } - - - - - - /** - * Checks for all attributes except referenced db objects - * @return true if all attributes match - */ - @Override - public boolean equals(Object obj) { - if (!super.equals(obj)) { - return false; - } - XXGroup other = (XXGroup) obj; - if ((this.name == null && other.name != null) || (this.name != null && !this.name.equals(other.name))) { - return false; - } - if ((this.description == null && other.description != null) || (this.description != null && !this.description.equals(other.description))) { - return false; - } - if (this.status != other.status) { - return false; - } - if (this.groupType != other.groupType) { - return false; - } - return (this.credStoreId != null || other.credStoreId == null) && (this.credStoreId == null || this.credStoreId.equals(other.credStoreId)); } - - } diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXGroupGroup.java b/security-admin/src/main/java/org/apache/ranger/entity/XXGroupGroup.java index 0e3127da33..54828ce031 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXGroupGroup.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXGroupGroup.java @@ -42,13 +42,12 @@ public class XXGroupGroup extends XXDBBase implements java.io.Serializable { @SequenceGenerator(name = "X_GROUP_GROUPS_SEQ", sequenceName = "X_GROUP_GROUPS_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.AUTO, generator = "X_GROUP_GROUPS_SEQ") @Column(name = "ID") - protected Long id; + protected Long id; /** * Name * - * */ @Column(name = "GROUP_NAME", nullable = false, length = 1024) protected String name; @@ -56,18 +55,16 @@ public class XXGroupGroup extends XXDBBase implements java.io.Serializable { * Id of the parent group * - * */ @Column(name = "P_GROUP_ID") - protected Long parentGroupId; + protected Long parentGroupId; /** * Id of the group * - * */ @Column(name = "GROUP_ID") - protected Long groupId; + protected Long groupId; /** * Default constructor. This will set all the attributes to default value. @@ -101,8 +98,14 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /** * Checks for all attributes except referenced db objects + * * @return true if all attributes match */ @Override @@ -122,6 +125,7 @@ public boolean equals(Object obj) { /** * This return the bean content in string format + * * @return formatedStr */ @Override @@ -137,6 +141,7 @@ public String toString() { /** * Returns the value for the member attribute name + * * @return String - value of member attribute name. */ public String getName() { @@ -146,6 +151,7 @@ public String getName() { /** * This method sets the value to the member attribute name. * You cannot set null to the attribute. + * * @param name Value to set member attribute name */ public void setName(String name) { @@ -154,6 +160,7 @@ public void setName(String name) { /** * Returns the value for the member attribute parentGroupId + * * @return Long - value of member attribute parentGroupId. */ public Long getParentGroupId() { @@ -163,6 +170,7 @@ public Long getParentGroupId() { /** * This method sets the value to the member attribute parentGroupId. * You cannot set null to the attribute. + * * @param parentGroupId Value to set member attribute parentGroupId */ public void setParentGroupId(Long parentGroupId) { @@ -171,6 +179,7 @@ public void setParentGroupId(Long parentGroupId) { /** * Returns the value for the member attribute groupId + * * @return Long - value of member attribute groupId. */ public Long getGroupId() { @@ -180,6 +189,7 @@ public Long getGroupId() { /** * This method sets the value to the member attribute groupId. * You cannot set null to the attribute. + * * @param groupId Value to set member attribute groupId */ public void setGroupId(Long groupId) { diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXGroupPermission.java b/security-admin/src/main/java/org/apache/ranger/entity/XXGroupPermission.java index 5f7a726f43..8814b3611b 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXGroupPermission.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXGroupPermission.java @@ -31,7 +31,6 @@ @Entity @Table(name = "x_group_module_perm") public class XXGroupPermission extends XXDBBase implements java.io.Serializable { - private static final long serialVersionUID = 1L; @Id @@ -114,6 +113,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + @Override public boolean equals(Object obj) { if (this == obj) { @@ -149,13 +153,13 @@ public boolean equals(Object obj) { } if (moduleId == null) { return other.moduleId == null; - } else + } else { return moduleId.equals(other.moduleId); + } } @Override public String toString() { - String str = "XXGroupPermission={"; str += super.toString(); str += "id={" + id + "} "; diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXGroupUser.java b/security-admin/src/main/java/org/apache/ranger/entity/XXGroupUser.java index 5b35fc6c7f..cd15be1fb9 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXGroupUser.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXGroupUser.java @@ -42,13 +42,12 @@ public class XXGroupUser extends XXDBBase implements java.io.Serializable { @SequenceGenerator(name = "X_GROUP_USERS_SEQ", sequenceName = "X_GROUP_USERS_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.AUTO, generator = "X_GROUP_USERS_SEQ") @Column(name = "ID") - protected Long id; + protected Long id; /** * Name * - * */ @Column(name = "GROUP_NAME", nullable = false, length = 1024) protected String name; @@ -56,18 +55,16 @@ public class XXGroupUser extends XXDBBase implements java.io.Serializable { * Id of the group * - * */ @Column(name = "P_GROUP_ID") - protected Long parentGroupId; + protected Long parentGroupId; /** * Id of the user * - * */ @Column(name = "USER_ID") - protected Long userId; + protected Long userId; /** * Default constructor. This will set all the attributes to default value. @@ -101,8 +98,14 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /** * Checks for all attributes except referenced db objects + * * @return true if all attributes match */ @Override @@ -122,6 +125,7 @@ public boolean equals(Object obj) { /** * This return the bean content in string format + * * @return formatedStr */ @Override @@ -137,6 +141,7 @@ public String toString() { /** * Returns the value for the member attribute name + * * @return String - value of member attribute name. */ public String getName() { @@ -146,6 +151,7 @@ public String getName() { /** * This method sets the value to the member attribute name. * You cannot set null to the attribute. + * * @param name Value to set member attribute name */ public void setName(String name) { @@ -154,6 +160,7 @@ public void setName(String name) { /** * Returns the value for the member attribute parentGroupId + * * @return Long - value of member attribute parentGroupId. */ public Long getParentGroupId() { @@ -163,6 +170,7 @@ public Long getParentGroupId() { /** * This method sets the value to the member attribute parentGroupId. * You cannot set null to the attribute. + * * @param parentGroupId Value to set member attribute parentGroupId */ public void setParentGroupId(Long parentGroupId) { @@ -171,6 +179,7 @@ public void setParentGroupId(Long parentGroupId) { /** * Returns the value for the member attribute userId + * * @return Long - value of member attribute userId. */ public Long getUserId() { @@ -180,6 +189,7 @@ public Long getUserId() { /** * This method sets the value to the member attribute userId. * You cannot set null to the attribute. + * * @param userId Value to set member attribute userId */ public void setUserId(Long userId) { diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXModuleDef.java b/security-admin/src/main/java/org/apache/ranger/entity/XXModuleDef.java index f21f42f4d8..d064a63f6d 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXModuleDef.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXModuleDef.java @@ -30,14 +30,13 @@ @Entity @Table(name = "x_modules_master") public class XXModuleDef extends XXDBBase implements java.io.Serializable { - private static final long serialVersionUID = 1L; @Id @SequenceGenerator(name = "X_MODULES_MASTER_SEQ", sequenceName = "X_MODULES_MASTER_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.AUTO, generator = "X_MODULES_MASTER_SEQ") @Column(name = "ID") - protected Long id; + protected Long id; @Column(name = "MODULE", nullable = false) protected String module; @Column(name = "URL", nullable = false) @@ -90,6 +89,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + @Override public boolean equals(Object obj) { if (this == obj) { @@ -118,8 +122,9 @@ public boolean equals(Object obj) { } if (url == null) { return other.url == null; - } else + } else { return url.equals(other.url); + } } @Override diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPermMap.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPermMap.java index c46480839d..a0c36fa3ca 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPermMap.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPermMap.java @@ -43,80 +43,71 @@ public class XXPermMap extends XXDBBase implements java.io.Serializable { @SequenceGenerator(name = "X_PERM_MAP_SEQ", sequenceName = "X_PERM_MAP_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.AUTO, generator = "X_PERM_MAP_SEQ") @Column(name = "ID") - protected Long id; + protected Long id; /** * Group to which the permission belongs to * - * */ @Column(name = "PERM_GROUP", length = 1024) - protected String permGroup; + protected String permGroup; /** * Id of the resource * - * */ @Column(name = "RES_ID") - protected Long resourceId; + protected Long resourceId; /** * Id of the group * - * */ @Column(name = "GROUP_ID") - protected Long groupId; + protected Long groupId; /** * Id of the user * - * */ @Column(name = "USER_ID") - protected Long userId; + protected Long userId; /** * Permission for user or group * - * */ @Column(name = "PERM_FOR", nullable = false) - protected int permFor = AppConstants.XA_PERM_FOR_UNKNOWN; + protected int permFor = AppConstants.XA_PERM_FOR_UNKNOWN; /** * Type of permission * - * */ @Column(name = "PERM_TYPE", nullable = false) - protected int permType = AppConstants.XA_PERM_TYPE_UNKNOWN; + protected int permType = AppConstants.XA_PERM_TYPE_UNKNOWN; /** * Is recursive * - * */ @Column(name = "IS_RECURSIVE", nullable = false) - protected int isRecursive = RangerConstants.BOOL_NONE; + protected int isRecursive = RangerConstants.BOOL_NONE; /** * Is wild card * - * */ @Column(name = "IS_WILD_CARD", nullable = false) - protected boolean isWildCard = true; + protected boolean isWildCard = true; /** * Grant is true and revoke is false * - * */ @Column(name = "GRANT_REVOKE", nullable = false) protected boolean grantOrRevoke = true; @@ -125,7 +116,6 @@ public class XXPermMap extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "IP_ADDRESS", length = 1024) protected String ipAddress; @@ -169,8 +159,14 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /** * Checks for all attributes except referenced db objects + * * @return true if all attributes match */ @Override @@ -208,6 +204,7 @@ public boolean equals(Object obj) { /** * This return the bean content in string format + * * @return formatedStr */ @Override @@ -229,6 +226,7 @@ public String toString() { /** * Returns the value for the member attribute permGroup + * * @return String - value of member attribute permGroup. */ public String getPermGroup() { @@ -238,6 +236,7 @@ public String getPermGroup() { /** * This method sets the value to the member attribute permGroup. * You cannot set null to the attribute. + * * @param permGroup Value to set member attribute permGroup */ public void setPermGroup(String permGroup) { @@ -246,6 +245,7 @@ public void setPermGroup(String permGroup) { /** * Returns the value for the member attribute resourceId + * * @return Long - value of member attribute resourceId. */ public Long getResourceId() { @@ -255,6 +255,7 @@ public Long getResourceId() { /** * This method sets the value to the member attribute resourceId. * You cannot set null to the attribute. + * * @param resourceId Value to set member attribute resourceId */ public void setResourceId(Long resourceId) { @@ -263,6 +264,7 @@ public void setResourceId(Long resourceId) { /** * Returns the value for the member attribute groupId + * * @return Long - value of member attribute groupId. */ public Long getGroupId() { @@ -272,6 +274,7 @@ public Long getGroupId() { /** * This method sets the value to the member attribute groupId. * You cannot set null to the attribute. + * * @param groupId Value to set member attribute groupId */ public void setGroupId(Long groupId) { @@ -280,6 +283,7 @@ public void setGroupId(Long groupId) { /** * Returns the value for the member attribute userId + * * @return Long - value of member attribute userId. */ public Long getUserId() { @@ -289,6 +293,7 @@ public Long getUserId() { /** * This method sets the value to the member attribute userId. * You cannot set null to the attribute. + * * @param userId Value to set member attribute userId */ public void setUserId(Long userId) { @@ -297,6 +302,7 @@ public void setUserId(Long userId) { /** * Returns the value for the member attribute permFor + * * @return int - value of member attribute permFor. */ public int getPermFor() { @@ -306,6 +312,7 @@ public int getPermFor() { /** * This method sets the value to the member attribute permFor. * You cannot set null to the attribute. + * * @param permFor Value to set member attribute permFor */ public void setPermFor(int permFor) { @@ -314,6 +321,7 @@ public void setPermFor(int permFor) { /** * Returns the value for the member attribute permType + * * @return int - value of member attribute permType. */ public int getPermType() { @@ -323,6 +331,7 @@ public int getPermType() { /** * This method sets the value to the member attribute permType. * You cannot set null to the attribute. + * * @param permType Value to set member attribute permType */ public void setPermType(int permType) { @@ -331,6 +340,7 @@ public void setPermType(int permType) { /** * Returns the value for the member attribute isRecursive + * * @return int - value of member attribute isRecursive. */ public int getIsRecursive() { @@ -340,6 +350,7 @@ public int getIsRecursive() { /** * This method sets the value to the member attribute isRecursive. * You cannot set null to the attribute. + * * @param isRecursive Value to set member attribute isRecursive */ public void setIsRecursive(int isRecursive) { @@ -348,6 +359,7 @@ public void setIsRecursive(int isRecursive) { /** * Returns the value for the member attribute isWildCard + * * @return boolean - value of member attribute isWildCard. */ public boolean isIsWildCard() { @@ -357,6 +369,7 @@ public boolean isIsWildCard() { /** * This method sets the value to the member attribute isWildCard. * You cannot set null to the attribute. + * * @param isWildCard Value to set member attribute isWildCard */ public void setIsWildCard(boolean isWildCard) { @@ -365,6 +378,7 @@ public void setIsWildCard(boolean isWildCard) { /** * Returns the value for the member attribute grantOrRevoke + * * @return boolean - value of member attribute grantOrRevoke. */ public boolean isGrantOrRevoke() { @@ -374,6 +388,7 @@ public boolean isGrantOrRevoke() { /** * This method sets the value to the member attribute grantOrRevoke. * You cannot set null to the attribute. + * * @param grantOrRevoke Value to set member attribute grantOrRevoke */ public void setGrantOrRevoke(boolean grantOrRevoke) { diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPluginInfo.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPluginInfo.java index 1dfe954de0..40d8df2ddf 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPluginInfo.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPluginInfo.java @@ -85,6 +85,72 @@ public static boolean equals(Object object1, Object object2) { return object1.equals(object2); } + @Override + public int hashCode() { + return super.hashCode(); + } + + /** + * Checks for all attributes except referenced db objects + * + * @return true if all attributes match + */ + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (this == obj) { + return true; + } + if (getClass() != obj.getClass()) { + return false; + } + XXPluginInfo other = (XXPluginInfo) obj; + if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { + return false; + } + if ((this.createTime == null && other.createTime != null) || (this.createTime != null && !this.createTime.equals(other.createTime))) { + return false; + } + if ((this.updateTime == null && other.updateTime != null) || (this.updateTime != null && !this.updateTime.equals(other.updateTime))) { + return false; + } + if ((this.serviceName == null && other.serviceName != null) || (this.serviceName != null && !this.serviceName.equals(other.serviceName))) { + return false; + } + if ((this.hostName == null && other.hostName != null) || (this.hostName != null && !this.hostName.equals(other.hostName))) { + return false; + } + if ((this.appType == null && other.appType != null) || (this.appType != null && !this.appType.equals(other.appType))) { + return false; + } + if ((this.ipAddress == null && other.ipAddress != null) || (this.ipAddress != null && !this.ipAddress.equals(other.ipAddress))) { + return false; + } + return (this.info != null || other.info == null) && (this.info == null || this.info.equals(other.info)); + } + + /** + * This return the bean content in string format + * + * @return formatedStr + */ + @Override + public String toString() { + String str = "XXPluginInfo={"; + str += "id={" + id + "} "; + str += "createTime={" + createTime + "} "; + str += "updateTime={" + updateTime + "} "; + str += "serviceName={" + serviceName + "} "; + str += "hostName={" + hostName + "} "; + str += "appType={" + appType + "} "; + str += "ipAddress={" + ipAddress + "} "; + str += "info={" + info + "} "; + str += "}"; + return str; + } + public int getMyClassType() { return AppConstants.CLASS_TYPE_NONE; } @@ -156,65 +222,4 @@ public String getInfo() { public void setInfo(String info) { this.info = info; } - - /** - * Checks for all attributes except referenced db objects - * - * @return true if all attributes match - */ - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (this == obj) { - return true; - } - if (getClass() != obj.getClass()) { - return false; - } - XXPluginInfo other = (XXPluginInfo) obj; - if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { - return false; - } - if ((this.createTime == null && other.createTime != null) || (this.createTime != null && !this.createTime.equals(other.createTime))) { - return false; - } - if ((this.updateTime == null && other.updateTime != null) || (this.updateTime != null && !this.updateTime.equals(other.updateTime))) { - return false; - } - if ((this.serviceName == null && other.serviceName != null) || (this.serviceName != null && !this.serviceName.equals(other.serviceName))) { - return false; - } - if ((this.hostName == null && other.hostName != null) || (this.hostName != null && !this.hostName.equals(other.hostName))) { - return false; - } - if ((this.appType == null && other.appType != null) || (this.appType != null && !this.appType.equals(other.appType))) { - return false; - } - if ((this.ipAddress == null && other.ipAddress != null) || (this.ipAddress != null && !this.ipAddress.equals(other.ipAddress))) { - return false; - } - return (this.info != null || other.info == null) && (this.info == null || this.info.equals(other.info)); - } - - /** - * This return the bean content in string format - * - * @return formatedStr - */ - @Override - public String toString() { - String str = "XXPluginInfo={"; - str += "id={" + id + "} "; - str += "createTime={" + createTime + "} "; - str += "updateTime={" + updateTime + "} "; - str += "serviceName={" + serviceName + "} "; - str += "hostName={" + hostName + "} "; - str += "appType={" + appType + "} "; - str += "ipAddress={" + ipAddress + "} "; - str += "info={" + info + "} "; - str += "}"; - return str; - } } diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicy.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicy.java index 211c5a31e3..f884d85115 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicy.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicy.java @@ -53,6 +53,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + @Override public boolean equals(Object obj) { if (this == obj) { @@ -67,8 +72,9 @@ public boolean equals(Object obj) { XXPolicy other = (XXPolicy) obj; if (id == null) { return other.id == null; - } else + } else { return id.equals(other.id); + } } @Override diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyBase.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyBase.java index 05607a03f5..df1907fb51 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyBase.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyBase.java @@ -304,12 +304,19 @@ public void setPolicyText(String policyText) { this.policyText = policyText; } - public Long getZoneId() {return zoneId;} + public Long getZoneId() { + return zoneId; + } public void setZoneId(Long zoneId) { this.zoneId = zoneId; } + @Override + public int hashCode() { + return super.hashCode(); + } + /* * (non-Javadoc) * @@ -409,8 +416,9 @@ public boolean equals(Object obj) { if (zoneId == null) { return other.zoneId == null; - } else + } else { return zoneId.equals(other.zoneId); + } } /* diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyChangeLog.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyChangeLog.java index 5c971ff08d..00b22333b3 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyChangeLog.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyChangeLog.java @@ -132,25 +132,33 @@ public void setChangeType(Integer changeType) { this.changeType = changeType; } - public String getServiceType() {return this.serviceType;} + public String getServiceType() { + return this.serviceType; + } public void setServiceType(String serviceType) { this.serviceType = serviceType; } - public Integer getPolicyType() {return this.policyType;} + public Integer getPolicyType() { + return this.policyType; + } public void setPolicyType(Integer policyType) { this.policyType = policyType; } - public String getZoneName() {return this.zoneName;} + public String getZoneName() { + return this.zoneName; + } public void setZoneName(String zoneName) { this.zoneName = zoneName; } - public Long getPolicyId() {return this.policyId;} + public Long getPolicyId() { + return this.policyId; + } public void setPolicyId(Long policyId) { this.policyId = policyId; @@ -164,6 +172,11 @@ public void setPolicyGuid(String policyGuid) { this.policyGuid = policyGuid; } + @Override + public int hashCode() { + return super.hashCode(); + } + /** * Checks for all attributes except referenced db objects * @@ -186,10 +199,7 @@ public boolean equals(Object obj) { XXPolicyChangeLog other = (XXPolicyChangeLog) obj; - return Objects.equals(this.id, other.id) && Objects.equals(this.serviceId, other.serviceId) && Objects.equals(this.policyVersion, other.policyVersion) - && Objects.equals(this.createTime, other.createTime) && Objects.equals(this.changeType, other.changeType) && Objects.equals(this.serviceType, other.serviceType) - && Objects.equals(this.policyType, other.policyType) && Objects.equals(this.zoneName, other.zoneName) && Objects.equals(this.policyId, other.policyId) - && Objects.equals(this.policyGuid, other.policyGuid); + return Objects.equals(this.id, other.id) && Objects.equals(this.serviceId, other.serviceId) && Objects.equals(this.policyVersion, other.policyVersion) && Objects.equals(this.createTime, other.createTime) && Objects.equals(this.changeType, other.changeType) && Objects.equals(this.serviceType, other.serviceType) && Objects.equals(this.policyType, other.policyType) && Objects.equals(this.zoneName, other.zoneName) && Objects.equals(this.policyId, other.policyId) && Objects.equals(this.policyGuid, other.policyGuid); } /** @@ -214,4 +224,3 @@ public String toString() { return str; } } - diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyConditionDef.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyConditionDef.java index 37d6e68845..09d3a63245 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyConditionDef.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyConditionDef.java @@ -30,8 +30,7 @@ @Entity @Cacheable @Table(name = "x_policy_condition_def") -public class XXPolicyConditionDef extends XXDBBase implements - java.io.Serializable { +public class XXPolicyConditionDef extends XXDBBase implements java.io.Serializable { private static final long serialVersionUID = 1L; /** * id of the XXPolicyConditionDef @@ -175,6 +174,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /* * (non-Javadoc) * @@ -275,8 +279,9 @@ public boolean equals(Object obj) { } if (rbKeyLabel == null) { return other.rbKeyLabel == null; - } else + } else { return rbKeyLabel.equals(other.rbKeyLabel); + } } /* diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyExportAudit.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyExportAudit.java index d5c7706220..77a9641d32 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyExportAudit.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyExportAudit.java @@ -46,13 +46,12 @@ public class XXPolicyExportAudit extends XXDBBase implements java.io.Serializabl @SequenceGenerator(name = "X_POLICY_EXPORT_SEQ", sequenceName = "X_POLICY_EXPORT_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.AUTO, generator = "X_POLICY_EXPORT_SEQ") @Column(name = "ID") - protected Long id; + protected Long id; /** * XA Agent IP Address * - * */ @Column(name = "CLIENT_IP", nullable = false, length = 255) protected String clientIP; @@ -61,7 +60,6 @@ public class XXPolicyExportAudit extends XXDBBase implements java.io.Serializabl * - * */ @Column(name = "AGENT_ID", length = 255) protected String agentId; @@ -69,25 +67,22 @@ public class XXPolicyExportAudit extends XXDBBase implements java.io.Serializabl * Last update timestamp in request * - * */ @Column(name = "REQ_EPOCH", nullable = false) - protected Long requestedEpoch; + protected Long requestedEpoch; /** * Date and time of the last policy update * - * */ @Temporal(TemporalType.TIMESTAMP) @Column(name = "LAST_UPDATED") - protected Date lastUpdated; + protected Date lastUpdated; /** * Name of the Asset * - * */ @Column(name = "REPOSITORY_NAME", length = 1024) protected String repositoryName; @@ -96,7 +91,6 @@ public class XXPolicyExportAudit extends XXDBBase implements java.io.Serializabl * - * */ @Column(name = "EXPORTED_JSON", length = 30000) protected String exportedJson; @@ -104,16 +98,14 @@ public class XXPolicyExportAudit extends XXDBBase implements java.io.Serializabl * HTTP Response Code * - * */ @Column(name = "HTTP_RET_CODE", nullable = false) - protected int httpRetCode; + protected int httpRetCode; /** * Name of the Cluster * - * */ @Column(name = "CLUSTER_NAME", nullable = false, length = 255) protected String clusterName; @@ -122,7 +114,6 @@ public class XXPolicyExportAudit extends XXDBBase implements java.io.Serializabl * - * */ @Column(name = "ZONE_NAME", nullable = false, length = 255) protected String zoneName; @@ -132,7 +123,7 @@ public class XXPolicyExportAudit extends XXDBBase implements java.io.Serializabl * */ @Column(name = "POLICY_VERSION") - protected Long policyVersion; + protected Long policyVersion; /** * Default constructor. This will set all the attributes to default value. @@ -161,8 +152,14 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /** * Checks for all attributes except referenced db objects + * * @return true if all attributes match */ @Override @@ -203,6 +200,7 @@ public boolean equals(Object obj) { /** * This return the bean content in string format + * * @return formatedStr */ @Override @@ -225,6 +223,7 @@ public String toString() { /** * Returns the value for the member attribute clientIP + * * @return String - value of member attribute clientIP. */ public String getClientIP() { @@ -234,6 +233,7 @@ public String getClientIP() { /** * This method sets the value to the member attribute clientIP. * You cannot set null to the attribute. + * * @param clientIP Value to set member attribute clientIP */ public void setClientIP(String clientIP) { @@ -242,6 +242,7 @@ public void setClientIP(String clientIP) { /** * Returns the value for the member attribute agentId + * * @return String - value of member attribute agentId. */ public String getAgentId() { @@ -251,6 +252,7 @@ public String getAgentId() { /** * This method sets the value to the member attribute agentId. * You cannot set null to the attribute. + * * @param agentId Value to set member attribute agentId */ public void setAgentId(String agentId) { @@ -259,6 +261,7 @@ public void setAgentId(String agentId) { /** * Returns the value for the member attribute requestedEpoch + * * @return Long - value of member attribute requestedEpoch. */ public Long getRequestedEpoch() { @@ -268,6 +271,7 @@ public Long getRequestedEpoch() { /** * This method sets the value to the member attribute requestedEpoch. * You cannot set null to the attribute. + * * @param requestedEpoch Value to set member attribute requestedEpoch */ public void setRequestedEpoch(Long requestedEpoch) { @@ -276,6 +280,7 @@ public void setRequestedEpoch(Long requestedEpoch) { /** * Returns the value for the member attribute lastUpdated + * * @return Date - value of member attribute lastUpdated. */ public Date getLastUpdated() { @@ -285,6 +290,7 @@ public Date getLastUpdated() { /** * This method sets the value to the member attribute lastUpdated. * You cannot set null to the attribute. + * * @param lastUpdated Value to set member attribute lastUpdated */ public void setLastUpdated(Date lastUpdated) { @@ -293,6 +299,7 @@ public void setLastUpdated(Date lastUpdated) { /** * Returns the value for the member attribute repositoryName + * * @return String - value of member attribute repositoryName. */ public String getRepositoryName() { @@ -302,6 +309,7 @@ public String getRepositoryName() { /** * This method sets the value to the member attribute repositoryName. * You cannot set null to the attribute. + * * @param repositoryName Value to set member attribute repositoryName */ public void setRepositoryName(String repositoryName) { @@ -310,6 +318,7 @@ public void setRepositoryName(String repositoryName) { /** * Returns the value for the member attribute exportedJson + * * @return String - value of member attribute exportedJson. */ public String getExportedJson() { @@ -319,6 +328,7 @@ public String getExportedJson() { /** * This method sets the value to the member attribute exportedJson. * You cannot set null to the attribute. + * * @param exportedJson Value to set member attribute exportedJson */ public void setExportedJson(String exportedJson) { @@ -327,6 +337,7 @@ public void setExportedJson(String exportedJson) { /** * Returns the value for the member attribute httpRetCode + * * @return int - value of member attribute httpRetCode. */ public int getHttpRetCode() { @@ -336,6 +347,7 @@ public int getHttpRetCode() { /** * This method sets the value to the member attribute httpRetCode. * You cannot set null to the attribute. + * * @param httpRetCode Value to set member attribute httpRetCode */ public void setHttpRetCode(int httpRetCode) { @@ -344,6 +356,7 @@ public void setHttpRetCode(int httpRetCode) { /** * Returns the value for the member attribute clusterName + * * @return String - value of member attribute clusterName. */ public String getClusterName() { @@ -353,6 +366,7 @@ public String getClusterName() { /** * This method sets the value to the member attribute clusterName. * You cannot set null to the attribute. + * * @param clusterName Value to set member attribute clusterName */ public void setClusterName(String clusterName) { @@ -361,6 +375,7 @@ public void setClusterName(String clusterName) { /** * Returns the value for the member attribute zoneName + * * @return String - value of member attribute zoneName. */ public String getZoneName() { @@ -370,6 +385,7 @@ public String getZoneName() { /** * This method sets the value to the member attribute zoneName. * You cannot set null to the attribute. + * * @param zoneName Value to set member attribute zoneName */ public void setZoneName(String zoneName) { @@ -378,6 +394,7 @@ public void setZoneName(String zoneName) { /** * Returns the value for the member attribute policyVersion + * * @return String - value of member attribute policyVersion. */ public Long getPolicyVersion() { @@ -386,6 +403,7 @@ public Long getPolicyVersion() { /** * This method sets the value to the member attribute policyVersion. + * * @param policyVersion Value to set member attribute policyVersion */ public void setPolicyVersion(Long policyVersion) { diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItem.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItem.java index ac327d4713..b01dc2d3ed 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItem.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItem.java @@ -50,7 +50,7 @@ public class XXPolicyItem extends XXDBBase implements java.io.Serializable { * */ @Column(name = "guid", unique = true, nullable = false, length = 512) - protected String GUID; + protected String guid; /** * policyId of the XXPolicyItem @@ -119,6 +119,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /* * (non-Javadoc) * @@ -142,11 +147,11 @@ public boolean equals(Object obj) { if (delegateAdmin != other.delegateAdmin) { return false; } - if (GUID == null) { - if (other.GUID != null) { + if (guid == null) { + if (other.guid != null) { return false; } - } else if (!GUID.equals(other.GUID)) { + } else if (!guid.equals(other.guid)) { return false; } if (id == null) { @@ -186,8 +191,9 @@ public boolean equals(Object obj) { } if (comments == null) { return other.comments == null; - } else + } else { return comments.equals(other.comments); + } } /* @@ -198,7 +204,7 @@ public boolean equals(Object obj) { @Override public String toString() { return "XXPolicyItem [" + super.toString() + " id=" + id + ", guid=" - + GUID + ", policyId=" + policyId + + guid + ", policyId=" + policyId + ", delegateAdmin=" + delegateAdmin + ", itemType=" + itemType + ", order=" + order + "]"; } @@ -206,14 +212,14 @@ public String toString() { * @return the gUID */ public String getGUID() { - return GUID; + return guid; } /** * @param gUID the gUID to set */ public void setGUID(String gUID) { - GUID = gUID; + guid = gUID; } /** diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemAccess.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemAccess.java index 3ec0ac325c..338e3fa470 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemAccess.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemAccess.java @@ -30,8 +30,7 @@ @Entity @Cacheable @Table(name = "x_policy_item_access") -public class XXPolicyItemAccess extends XXDBBase implements - java.io.Serializable { +public class XXPolicyItemAccess extends XXDBBase implements java.io.Serializable { private static final long serialVersionUID = 1L; /** * id of the XXPolicyItemAccess @@ -51,7 +50,7 @@ public class XXPolicyItemAccess extends XXDBBase implements * */ @Column(name = "guid", unique = true, nullable = false, length = 512) - protected String GUID; + protected String guid; /** * policyItemId of the XXPolicyItemAccess @@ -104,6 +103,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /* * (non-Javadoc) * @@ -159,10 +163,11 @@ public boolean equals(Object obj) { } else if (!type.equals(other.type)) { return false; } - if (GUID == null) { - return other.GUID == null; - } else - return GUID.equals(other.GUID); + if (guid == null) { + return other.guid == null; + } else { + return guid.equals(other.guid); + } } /* @@ -173,7 +178,7 @@ public boolean equals(Object obj) { @Override public String toString() { return "XXPolicyItemAccess [" + super.toString() + " id=" + id - + ", guid=" + GUID + ", policyItemId=" + + ", guid=" + guid + ", policyItemId=" + policyItemId + ", type=" + type + ", isAllowed=" + isAllowed + ", order=" + order + "]"; } @@ -182,14 +187,14 @@ public String toString() { * @return the gUID */ public String getGUID() { - return GUID; + return guid; } /** * @param gUID the gUID to set */ public void setGUID(String gUID) { - GUID = gUID; + guid = gUID; } /** diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemCondition.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemCondition.java index fb373b6839..85de6746d7 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemCondition.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemCondition.java @@ -30,8 +30,7 @@ @Entity @Cacheable @Table(name = "x_policy_item_condition") -public class XXPolicyItemCondition extends XXDBBase implements - java.io.Serializable { +public class XXPolicyItemCondition extends XXDBBase implements java.io.Serializable { private static final long serialVersionUID = 1L; /** * id of the XXPolicyItemCondition @@ -51,7 +50,7 @@ public class XXPolicyItemCondition extends XXDBBase implements * */ @Column(name = "guid", unique = true, nullable = false, length = 512) - protected String GUID; + protected String guid; /** * policyItemId of the XXPolicyItemCondition @@ -104,6 +103,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /* * (non-Javadoc) * @@ -159,10 +163,11 @@ public boolean equals(Object obj) { } else if (!value.equals(other.value)) { return false; } - if (GUID == null) { - return other.GUID == null; - } else - return GUID.equals(other.GUID); + if (guid == null) { + return other.guid == null; + } else { + return guid.equals(other.guid); + } } /* @@ -173,7 +178,7 @@ public boolean equals(Object obj) { @Override public String toString() { return "XXPolicyItemCondition [" + super.toString() + " id=" + id - + ", guid=" + GUID + ", policyItemId=" + + ", guid=" + guid + ", policyItemId=" + policyItemId + ", type=" + type + ", value=" + value + ", order=" + order + "]"; } @@ -258,13 +263,13 @@ public void setOrder(Integer order) { * @return the gUID */ public String getGUID() { - return GUID; + return guid; } /** * @param gUID the gUID to set */ public void setGUID(String gUID) { - GUID = gUID; + guid = gUID; } } diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemDataMaskInfo.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemDataMaskInfo.java index 4b78383460..7f01418b3c 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemDataMaskInfo.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemDataMaskInfo.java @@ -30,8 +30,7 @@ @Entity @Cacheable @Table(name = "x_policy_item_datamask") -public class XXPolicyItemDataMaskInfo extends XXDBBase implements - java.io.Serializable { +public class XXPolicyItemDataMaskInfo extends XXDBBase implements java.io.Serializable { private static final long serialVersionUID = 1L; /** * id of the XXPolicyItemDataMaskInfo @@ -95,6 +94,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /* * (non-Javadoc) * @@ -145,8 +149,9 @@ public boolean equals(Object obj) { } if (type == null) { return other.type == null; - } else + } else { return type.equals(other.type); + } } /* diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemGroupPerm.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemGroupPerm.java index d26d4837a2..0cbf409fa0 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemGroupPerm.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemGroupPerm.java @@ -30,8 +30,7 @@ @Entity @Cacheable @Table(name = "x_policy_item_group_perm") -public class XXPolicyItemGroupPerm extends XXDBBase implements - java.io.Serializable { +public class XXPolicyItemGroupPerm extends XXDBBase implements java.io.Serializable { private static final long serialVersionUID = 1L; /** * id of the XXPolicyItemGroupPerm @@ -87,6 +86,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /* * (non-Javadoc) * @@ -130,8 +134,9 @@ public boolean equals(Object obj) { } if (policyItemId == null) { return other.policyItemId == null; - } else + } else { return policyItemId.equals(other.policyItemId); + } } /* diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemRowFilterInfo.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemRowFilterInfo.java index 4b20854c08..17cd05f54d 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemRowFilterInfo.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemRowFilterInfo.java @@ -30,8 +30,7 @@ @Entity @Cacheable @Table(name = "x_policy_item_rowfilter") -public class XXPolicyItemRowFilterInfo extends XXDBBase implements - java.io.Serializable { +public class XXPolicyItemRowFilterInfo extends XXDBBase implements java.io.Serializable { private static final long serialVersionUID = 1L; /** * id of the XXPolicyItemRowFilterInfo @@ -79,6 +78,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /* * (non-Javadoc) * @@ -115,8 +119,9 @@ public boolean equals(Object obj) { } if (policyItemId == null) { return other.policyItemId == null; - } else + } else { return policyItemId.equals(other.policyItemId); + } } /* @@ -126,8 +131,7 @@ public boolean equals(Object obj) { */ @Override public String toString() { - return "XXPolicyItemDataMaskInfo [" + super.toString() + " id=" + id - + ", policyItemId=" + policyItemId + ", filterExpr=" + filterExpr + "]"; + return "XXPolicyItemDataMaskInfo [" + super.toString() + " id=" + id + ", policyItemId=" + policyItemId + ", filterExpr=" + filterExpr + "]"; } /** diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemUserPerm.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemUserPerm.java index 02585a7872..0554852021 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemUserPerm.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyItemUserPerm.java @@ -30,8 +30,7 @@ @Entity @Cacheable @Table(name = "x_policy_item_user_perm") -public class XXPolicyItemUserPerm extends XXDBBase implements - java.io.Serializable { +public class XXPolicyItemUserPerm extends XXDBBase implements java.io.Serializable { private static final long serialVersionUID = 1L; /** * id of the XXPolicyItemUserPerm @@ -87,6 +86,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /* * (non-Javadoc) * @@ -130,8 +134,9 @@ public boolean equals(Object obj) { } if (userId == null) { return other.userId == null; - } else + } else { return userId.equals(other.userId); + } } /* @@ -143,9 +148,7 @@ public boolean equals(Object obj) { public String toString() { String str = "XXPolicyItemUserPerm={"; str += super.toString(); - str += " [id=" + id + ", policyItemId=" - + policyItemId + ", userId=" + userId + ", order=" + order - + "]"; + str += " [id=" + id + ", policyItemId=" + policyItemId + ", userId=" + userId + ", order=" + order + "]"; str += "}"; return str; } diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyLabel.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyLabel.java index 944b1c35f3..77b0821ddc 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyLabel.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyLabel.java @@ -72,6 +72,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + @Override public boolean equals(Object obj) { if (this == obj) { @@ -100,8 +105,9 @@ public boolean equals(Object obj) { } if (policyLabel == null) { return other.policyLabel == null; - } else + } else { return policyLabel.equals(other.policyLabel); + } } @Override diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyLabelMap.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyLabelMap.java index 1f3d33c5fa..01ca081d05 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyLabelMap.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyLabelMap.java @@ -80,6 +80,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + @Override public boolean equals(Object obj) { if (this == obj) { @@ -115,8 +120,9 @@ public boolean equals(Object obj) { } if (policyLabelId == null) { return other.policyLabelId == null; - } else + } else { return policyLabelId.equals(other.policyLabelId); + } } @Override diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefAccessType.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefAccessType.java index 3b56e193d1..1ebe545a4c 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefAccessType.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefAccessType.java @@ -32,8 +32,7 @@ @Entity @Cacheable @Table(name = "x_policy_ref_access_type") -public class XXPolicyRefAccessType extends XXDBBase implements - java.io.Serializable { +public class XXPolicyRefAccessType extends XXDBBase implements java.io.Serializable { private static final long serialVersionUID = 1L; /** * id of the XXPolicyRefAccessType @@ -123,8 +122,7 @@ public boolean equals(Object obj) { */ @Override public String toString() { - return "XXPolicyRefAccessType [" + super.toString() + " id=" + id + ", policyId=" + policyId + ", accessDefId=" - + accessDefId + ", accessTypeName=" + accessTypeName + "]"; + return "XXPolicyRefAccessType [" + super.toString() + " id=" + id + ", policyId=" + policyId + ", accessDefId=" + accessDefId + ", accessTypeName=" + accessTypeName + "]"; } /** diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefCondition.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefCondition.java index e340af255f..929c913c45 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefCondition.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefCondition.java @@ -32,8 +32,7 @@ @Entity @Cacheable @Table(name = "x_policy_ref_condition") -public class XXPolicyRefCondition extends XXDBBase implements - java.io.Serializable { +public class XXPolicyRefCondition extends XXDBBase implements java.io.Serializable { private static final long serialVersionUID = 1L; /** * id of the XXPolicyRefCondition @@ -123,8 +122,7 @@ public boolean equals(Object obj) { */ @Override public String toString() { - return "XXPolicyRefCondition [" + super.toString() + " id=" + id + ", policyId=" + policyId + ", conditionDefId=" - + conditionDefId + ", conditionName=" + conditionName + "]"; + return "XXPolicyRefCondition [" + super.toString() + " id=" + id + ", policyId=" + policyId + ", conditionDefId=" + conditionDefId + ", conditionName=" + conditionName + "]"; } /** diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefDataMaskType.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefDataMaskType.java index 56ef025bea..2e3db08d10 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefDataMaskType.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefDataMaskType.java @@ -32,8 +32,7 @@ @Entity @Cacheable @Table(name = "x_policy_ref_datamask_type") -public class XXPolicyRefDataMaskType extends XXDBBase implements - java.io.Serializable { +public class XXPolicyRefDataMaskType extends XXDBBase implements java.io.Serializable { private static final long serialVersionUID = 1L; /** * id of the XXPolicyRefDataMaskType @@ -123,8 +122,7 @@ public boolean equals(Object obj) { */ @Override public String toString() { - return "XXPolicyRefDataMaskType [" + super.toString() + " id=" + id + ", policyId=" + policyId + ", dataMaskDefId=" - + dataMaskDefId + ", dataMaskTypeName=" + dataMaskTypeName + "]"; + return "XXPolicyRefDataMaskType [" + super.toString() + " id=" + id + ", policyId=" + policyId + ", dataMaskDefId=" + dataMaskDefId + ", dataMaskTypeName=" + dataMaskTypeName + "]"; } /** diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefGroup.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefGroup.java index a6fcedc474..46160ab3fc 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefGroup.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefGroup.java @@ -38,7 +38,6 @@ @Cacheable @Table(name = "x_policy_ref_group") public class XXPolicyRefGroup extends XXDBBase implements Serializable { - private static final long serialVersionUID = 1L; /** * id of the XXPolicyRefGroup @@ -130,8 +129,7 @@ public boolean equals(Object obj) { */ @Override public String toString() { - return "XXPolicyRefGroup [" + super.toString() + " id=" + id + ", policyId=" + policyId + ", groupId=" + groupId - + ", groupName=" + groupName + "]"; + return "XXPolicyRefGroup [" + super.toString() + " id=" + id + ", policyId=" + policyId + ", groupId=" + groupId + ", groupName=" + groupName + "]"; } /** diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefResource.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefResource.java index adf5f34a54..bf18e37e9d 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefResource.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefResource.java @@ -32,8 +32,7 @@ @Entity @Cacheable @Table(name = "x_policy_ref_resource") -public class XXPolicyRefResource extends XXDBBase implements - java.io.Serializable { +public class XXPolicyRefResource extends XXDBBase implements java.io.Serializable { private static final long serialVersionUID = 1L; /** * id of the XXPolicyRefResource @@ -123,8 +122,7 @@ public boolean equals(Object obj) { */ @Override public String toString() { - return "XXPolicyRefResource [" + super.toString() + " id=" + id + ", policyId=" + policyId + ", resourceDefId=" - + resourceDefId + ", resource_name=" + resourceName + "]"; + return "XXPolicyRefResource [" + super.toString() + " id=" + id + ", policyId=" + policyId + ", resourceDefId=" + resourceDefId + ", resource_name=" + resourceName + "]"; } /** diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefRole.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefRole.java index 783257b324..99ea3b28e7 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefRole.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefRole.java @@ -38,7 +38,6 @@ @Cacheable @Table(name = "x_policy_ref_role") public class XXPolicyRefRole extends XXDBBase implements Serializable { - private static final long serialVersionUID = 1L; /** * id of the XXPolicyRefRole @@ -130,8 +129,7 @@ public boolean equals(Object obj) { */ @Override public String toString() { - return "XXPolicyRefRole [" + super.toString() + " id=" + id + ", policyId=" + policyId + ", roleId=" + roleId - + ", roleName=" + roleName + "]"; + return "XXPolicyRefRole [" + super.toString() + " id=" + id + ", policyId=" + policyId + ", roleId=" + roleId + ", roleName=" + roleName + "]"; } /** @@ -189,4 +187,3 @@ public void setRoleName(String roleName) { this.roleName = roleName; } } - diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefUser.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefUser.java index 62ec3dfdcd..67d4541f94 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefUser.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefUser.java @@ -32,8 +32,7 @@ @Entity @Cacheable @Table(name = "x_policy_ref_user") -public class XXPolicyRefUser extends XXDBBase implements - java.io.Serializable { +public class XXPolicyRefUser extends XXDBBase implements java.io.Serializable { private static final long serialVersionUID = 1L; /** * id of the XXPolicyRefUser @@ -123,8 +122,7 @@ public boolean equals(Object obj) { */ @Override public String toString() { - return "XXPolicyRefUser [" + super.toString() + " id=" + id + ", policyId=" + policyId + ", userId=" - + userId + ", userName=" + userName + "]"; + return "XXPolicyRefUser [" + super.toString() + " id=" + id + ", policyId=" + policyId + ", userId=" + userId + ", userName=" + userName + "]"; } /** diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyResource.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyResource.java index b1f2212645..6247bf8093 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyResource.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyResource.java @@ -94,6 +94,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /* * (non-Javadoc) * @@ -136,8 +141,9 @@ public boolean equals(Object obj) { } if (resDefId == null) { return other.resDefId == null; - } else + } else { return resDefId.equals(other.resDefId); + } } /* diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyResourceMap.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyResourceMap.java index 90a13e7a55..0e00344171 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyResourceMap.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyResourceMap.java @@ -30,8 +30,7 @@ @Entity @Cacheable @Table(name = "x_policy_resource_map") -public class XXPolicyResourceMap extends XXDBBase implements - java.io.Serializable { +public class XXPolicyResourceMap extends XXDBBase implements java.io.Serializable { private static final long serialVersionUID = 1L; /** * id of the XXPolicyResourceMap @@ -87,6 +86,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /* * (non-Javadoc) * @@ -130,8 +134,9 @@ public boolean equals(Object obj) { } if (value == null) { return other.value == null; - } else + } else { return value.equals(other.value); + } } /* diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyWithAssignedId.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyWithAssignedId.java index 0dcaf962a4..f1460ee22d 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyWithAssignedId.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyWithAssignedId.java @@ -46,6 +46,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + @Override public boolean equals(Object obj) { if (this == obj) { @@ -60,8 +65,9 @@ public boolean equals(Object obj) { XXPolicyWithAssignedId other = (XXPolicyWithAssignedId) obj; if (id == null) { return other.id == null; - } else + } else { return id.equals(other.id); + } } @Override diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPortalUser.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPortalUser.java index cf47fc0798..1531e31d13 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPortalUser.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPortalUser.java @@ -48,13 +48,12 @@ public class XXPortalUser extends XXDBBase implements java.io.Serializable { @SequenceGenerator(name = "X_PORTAL_USER_SEQ", sequenceName = "X_PORTAL_USER_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.AUTO, generator = "X_PORTAL_USER_SEQ") @Column(name = "ID") - protected Long id; + protected Long id; /** * First name of the user * - * */ @Column(name = "FIRST_NAME", length = 1022) protected String firstName; @@ -63,7 +62,6 @@ public class XXPortalUser extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "LAST_NAME", length = 1022) protected String lastName; @@ -72,7 +70,6 @@ public class XXPortalUser extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "PUB_SCR_NAME", length = 2048) protected String publicScreenName; @@ -81,7 +78,6 @@ public class XXPortalUser extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "LOGIN_ID", unique = true, length = 767) protected String loginId; @@ -89,7 +85,6 @@ public class XXPortalUser extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "PASSWORD", nullable = false, length = 512) protected String password; @@ -98,7 +93,6 @@ public class XXPortalUser extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "EMAIL", unique = true, length = 512) protected String emailAddress; @@ -107,25 +101,22 @@ public class XXPortalUser extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "STATUS", nullable = false) - protected int status = RangerConstants.ACT_STATUS_DISABLED; + protected int status = RangerConstants.ACT_STATUS_DISABLED; /** * Source of the user * - * */ @Column(name = "USER_SRC", nullable = false) - protected int userSource = RangerConstants.USER_APP; + protected int userSource = RangerConstants.USER_APP; /** * Note * - * */ @Column(name = "NOTES", length = 4000) protected String notes; @@ -133,7 +124,6 @@ public class XXPortalUser extends XXDBBase implements java.io.Serializable { * Additional store attributes. * - * */ @Column(name = "OTHER_ATTRIBUTES") protected String otherAttributes; @@ -141,7 +131,6 @@ public class XXPortalUser extends XXDBBase implements java.io.Serializable { * Sync Source Attribute. * - * */ @Column(name = "SYNC_SOURCE") protected String syncSource; @@ -149,7 +138,7 @@ public class XXPortalUser extends XXDBBase implements java.io.Serializable { protected String oldPasswords; @Temporal(TemporalType.TIMESTAMP) @Column(name = "PASSWORD_UPDATED_TIME") - protected Date passwordUpdatedTime = DateUtil.getUTCDate(); + protected Date passwordUpdatedTime = DateUtil.getUTCDate(); /** * Default constructor. This will set all the attributes to default value. @@ -188,8 +177,14 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /** * Checks for all attributes except referenced db objects + * * @return true if all attributes match */ @Override @@ -227,6 +222,7 @@ public boolean equals(Object obj) { /** * This return the bean content in string format + * * @return formatedStr */ @Override @@ -250,6 +246,7 @@ public String toString() { /** * Returns the value for the member attribute firstName + * * @return String - value of member attribute firstName. */ public String getFirstName() { @@ -259,6 +256,7 @@ public String getFirstName() { /** * This method sets the value to the member attribute firstName. * You cannot set null to the attribute. + * * @param firstName Value to set member attribute firstName */ public void setFirstName(String firstName) { @@ -267,6 +265,7 @@ public void setFirstName(String firstName) { /** * Returns the value for the member attribute lastName + * * @return String - value of member attribute lastName. */ public String getLastName() { @@ -276,6 +275,7 @@ public String getLastName() { /** * This method sets the value to the member attribute lastName. * You cannot set null to the attribute. + * * @param lastName Value to set member attribute lastName */ public void setLastName(String lastName) { @@ -284,6 +284,7 @@ public void setLastName(String lastName) { /** * Returns the value for the member attribute publicScreenName + * * @return String - value of member attribute publicScreenName. */ public String getPublicScreenName() { @@ -293,6 +294,7 @@ public String getPublicScreenName() { /** * This method sets the value to the member attribute publicScreenName. * You cannot set null to the attribute. + * * @param publicScreenName Value to set member attribute publicScreenName */ public void setPublicScreenName(String publicScreenName) { @@ -301,6 +303,7 @@ public void setPublicScreenName(String publicScreenName) { /** * Returns the value for the member attribute loginId + * * @return String - value of member attribute loginId. */ public String getLoginId() { @@ -310,6 +313,7 @@ public String getLoginId() { /** * This method sets the value to the member attribute loginId. * You cannot set null to the attribute. + * * @param loginId Value to set member attribute loginId */ public void setLoginId(String loginId) { @@ -318,6 +322,7 @@ public void setLoginId(String loginId) { /** * Returns the value for the member attribute password + * * @return String - value of member attribute password. */ public String getPassword() { @@ -327,6 +332,7 @@ public String getPassword() { /** * This method sets the value to the member attribute password. * You cannot set null to the attribute. + * * @param password Value to set member attribute password */ public void setPassword(String password) { @@ -335,6 +341,7 @@ public void setPassword(String password) { /** * Returns the value for the member attribute emailAddress + * * @return String - value of member attribute emailAddress. */ public String getEmailAddress() { @@ -344,6 +351,7 @@ public String getEmailAddress() { /** * This method sets the value to the member attribute emailAddress. * You cannot set null to the attribute. + * * @param emailAddress Value to set member attribute emailAddress */ public void setEmailAddress(String emailAddress) { @@ -352,6 +360,7 @@ public void setEmailAddress(String emailAddress) { /** * Returns the value for the member attribute status + * * @return int - value of member attribute status. */ public int getStatus() { @@ -361,6 +370,7 @@ public int getStatus() { /** * This method sets the value to the member attribute status. * You cannot set null to the attribute. + * * @param status Value to set member attribute status */ public void setStatus(int status) { @@ -369,6 +379,7 @@ public void setStatus(int status) { /** * Returns the value for the member attribute userSource + * * @return int - value of member attribute userSource. */ public int getUserSource() { @@ -378,6 +389,7 @@ public int getUserSource() { /** * This method sets the value to the member attribute userSource. * You cannot set null to the attribute. + * * @param userSource Value to set member attribute userSource */ public void setUserSource(int userSource) { @@ -386,6 +398,7 @@ public void setUserSource(int userSource) { /** * Returns the value for the member attribute notes + * * @return String - value of member attribute notes. */ public String getNotes() { @@ -395,6 +408,7 @@ public String getNotes() { /** * This method sets the value to the member attribute notes. * You cannot set null to the attribute. + * * @param notes Value to set member attribute notes */ public void setNotes(String notes) { @@ -412,6 +426,7 @@ public String getOtherAttributes() { /** * This method sets JSON {@link String} representation of additional store attributes. * This method accepts null values. + * * @param otherAttributes */ public void setOtherAttributes(String otherAttributes) { @@ -422,11 +437,14 @@ public void setOtherAttributes(String otherAttributes) { * @return JSON {@link String} representation of sync source attribute if available, * null otherwise. */ - public String getSyncSource() {return syncSource;} + public String getSyncSource() { + return syncSource; + } /** * This method sets JSON {@link String} representation of sync source attribute. * This method accepts null values. + * * @param syncSource */ public void setSyncSource(String syncSource) { diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPortalUserRole.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPortalUserRole.java index d94c819db9..973284472e 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXPortalUserRole.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPortalUserRole.java @@ -42,21 +42,19 @@ public class XXPortalUserRole extends XXDBBase implements java.io.Serializable { @SequenceGenerator(name = "X_PORTAL_USER_ROLE_SEQ", sequenceName = "X_PORTAL_USER_ROLE_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.AUTO, generator = "X_PORTAL_USER_ROLE_SEQ") @Column(name = "ID") - protected Long id; + protected Long id; /** * Id of the user * - * */ @Column(name = "USER_ID", nullable = false) - protected Long userId; + protected Long userId; /** * Role of the user * - * */ @Column(name = "USER_ROLE", length = 128) protected String userRole; @@ -65,10 +63,9 @@ public class XXPortalUserRole extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "STATUS", nullable = false) - protected int status = RangerConstants.STATUS_DISABLED; + protected int status = RangerConstants.STATUS_DISABLED; /** * Default constructor. This will set all the attributes to default value. @@ -96,8 +93,14 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /** * Checks for all attributes except referenced db objects + * * @return true if all attributes match */ @Override @@ -117,6 +120,7 @@ public boolean equals(Object obj) { /** * This return the bean content in string format + * * @return formatedStr */ @Override @@ -132,6 +136,7 @@ public String toString() { /** * Returns the value for the member attribute userId + * * @return Long - value of member attribute userId. */ public Long getUserId() { @@ -141,6 +146,7 @@ public Long getUserId() { /** * This method sets the value to the member attribute userId. * You cannot set null to the attribute. + * * @param userId Value to set member attribute userId */ public void setUserId(Long userId) { @@ -149,6 +155,7 @@ public void setUserId(Long userId) { /** * Returns the value for the member attribute userRole + * * @return String - value of member attribute userRole. */ public String getUserRole() { @@ -158,6 +165,7 @@ public String getUserRole() { /** * This method sets the value to the member attribute userRole. * You cannot set null to the attribute. + * * @param userRole Value to set member attribute userRole */ public void setUserRole(String userRole) { @@ -166,6 +174,7 @@ public void setUserRole(String userRole) { /** * Returns the value for the member attribute status + * * @return int - value of member attribute status. */ public int getStatus() { @@ -175,6 +184,7 @@ public int getStatus() { /** * This method sets the value to the member attribute status. * You cannot set null to the attribute. + * * @param status Value to set member attribute status */ public void setStatus(int status) { diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXRMSMappingProvider.java b/security-admin/src/main/java/org/apache/ranger/entity/XXRMSMappingProvider.java index c742215e2d..32b3b25340 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXRMSMappingProvider.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXRMSMappingProvider.java @@ -45,14 +45,14 @@ public class XXRMSMappingProvider implements Serializable { @SequenceGenerator(name = "X_RMS_MAPPING_PROVIDER_SEQ", sequenceName = "X_RMS_MAPPING_PROVIDER_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.AUTO, generator = "X_RMS_MAPPING_PROVIDER_SEQ") @Column(name = "id") - protected Long id; + protected Long id; @Temporal(TemporalType.TIMESTAMP) @Column(name = "change_timestamp") - protected Date changeTimestamp; + protected Date changeTimestamp; @Column(name = "name") protected String name; @Column(name = "last_known_version") - protected Long lastKnownVersion; + protected Long lastKnownVersion; public XXRMSMappingProvider() {} @@ -157,8 +157,9 @@ public boolean equals(Object obj) { } if (lastKnownVersion == null) { return other.lastKnownVersion == null; - } else + } else { return lastKnownVersion.equals(other.lastKnownVersion); + } } /* diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXRMSNotification.java b/security-admin/src/main/java/org/apache/ranger/entity/XXRMSNotification.java index 87a8291fcc..9c0d0e90e4 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXRMSNotification.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXRMSNotification.java @@ -44,24 +44,24 @@ public class XXRMSNotification implements Serializable { @SequenceGenerator(name = "X_RMS_NOTIFICATION_SEQ", sequenceName = "X_RMS_NOTIFICATION_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.AUTO, generator = "X_RMS_NOTIFICATION_SEQ") @Column(name = "ID") - protected Long id; + protected Long id; @Column(name = "hms_name", length = 128) protected String hmsName; @Column(name = "notification_id") - protected Long notificationId; + protected Long notificationId; @Temporal(TemporalType.TIMESTAMP) @Column(name = "change_timestamp") - protected Date changeTimestamp; + protected Date changeTimestamp; @Column(name = "change_type", length = 64) protected String changeType; @Column(name = "hl_resource_id") - protected Long hlResourceId; + protected Long hlResourceId; @Column(name = "hl_service_id") - protected Long hlServiceId; + protected Long hlServiceId; @Column(name = "ll_resource_id") - protected Long llResourceId; + protected Long llResourceId; @Column(name = "ll_service_id") - protected Long llServiceId; + protected Long llServiceId; public Long getId() { return id; @@ -127,7 +127,9 @@ public void setLlResourceId(Long llResourceId) { this.llResourceId = llResourceId; } - public Long getLlServiceId() {return llServiceId;} + public Long getLlServiceId() { + return llServiceId; + } public void setLlServiceId(Long llServiceId) { this.llServiceId = llServiceId; diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXRMSServiceResource.java b/security-admin/src/main/java/org/apache/ranger/entity/XXRMSServiceResource.java index 463e8216f6..f4eb4f0a67 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXRMSServiceResource.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXRMSServiceResource.java @@ -132,7 +132,9 @@ public void setIsEnabled(Boolean isEnabled) { this.isEnabled = isEnabled; } - public String getServiceResourceElements() {return serviceResourceElements;} + public String getServiceResourceElements() { + return serviceResourceElements; + } public void setServiceResourceElements(String serviceResourceElements) { this.serviceResourceElements = serviceResourceElements; @@ -230,8 +232,9 @@ public boolean equals(Object obj) { } if (serviceResourceElements == null) { return other.serviceResourceElements == null; - } else + } else { return serviceResourceElements.equals(other.serviceResourceElements); + } } /* diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXResource.java b/security-admin/src/main/java/org/apache/ranger/entity/XXResource.java index f4759e0c0c..3b850617bb 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXResource.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXResource.java @@ -43,13 +43,12 @@ public class XXResource extends XXDBBase implements java.io.Serializable { @SequenceGenerator(name = "X_RESOURCE_SEQ", sequenceName = "X_RESOURCE_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.AUTO, generator = "X_RESOURCE_SEQ") @Column(name = "ID") - protected Long id; + protected Long id; /** * Name * - * */ @Column(name = "RES_NAME", length = 4000) protected String name; @@ -60,7 +59,6 @@ public class XXResource extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "DESCR", length = 4000) protected String description; @@ -69,32 +67,28 @@ public class XXResource extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "RES_TYPE", nullable = false) - protected int resourceType = AppConstants.RESOURCE_PATH; + protected int resourceType = AppConstants.RESOURCE_PATH; /** * Id of the asset * - * */ @Column(name = "ASSET_ID", nullable = false) - protected Long assetId; + protected Long assetId; /** * Id of the parent * - * */ @Column(name = "PARENT_ID") - protected Long parentId; + protected Long parentId; /** * Path for the parent * - * */ @Column(name = "PARENT_PATH", length = 4000) protected String parentPath; @@ -103,25 +97,22 @@ public class XXResource extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "IS_ENCRYPT", nullable = false) - protected int isEncrypt = RangerConstants.BOOL_FALSE; + protected int isEncrypt = RangerConstants.BOOL_FALSE; /** * Is recursive * - * */ @Column(name = "IS_RECURSIVE", nullable = false) - protected int isRecursive = RangerConstants.BOOL_NONE; + protected int isRecursive = RangerConstants.BOOL_NONE; /** * Group to which this resource belongs to * - * */ @Column(name = "RES_GROUP", length = 1024) protected String resourceGroup; @@ -130,7 +121,6 @@ public class XXResource extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "RES_DBS", length = 10000) protected String databases; @@ -139,7 +129,6 @@ public class XXResource extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "RES_TABLES", length = 10000) protected String tables; @@ -148,7 +137,6 @@ public class XXResource extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "RES_COL_FAMS", length = 10000) protected String columnFamilies; @@ -157,7 +145,6 @@ public class XXResource extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "RES_COLS", length = 10000) protected String columns; @@ -166,7 +153,6 @@ public class XXResource extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "RES_UDFS", length = 10000) protected String udfs; @@ -175,34 +161,30 @@ public class XXResource extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "RES_STATUS", nullable = false) - protected int resourceStatus = RangerConstants.STATUS_ENABLED; + protected int resourceStatus = RangerConstants.STATUS_ENABLED; /** * Table Type * - * */ @Column(name = "TABLE_TYPE", nullable = false) - protected int tableType = AppConstants.POLICY_INCLUSION; + protected int tableType = AppConstants.POLICY_INCLUSION; /** * Resource Status * - * */ @Column(name = "COL_TYPE", nullable = false) - protected int columnType = AppConstants.POLICY_INCLUSION; + protected int columnType = AppConstants.POLICY_INCLUSION; /** * Topologoies * - * */ @Column(name = "RES_TOPOLOGIES", length = 10000) protected String topologies; @@ -211,10 +193,10 @@ public class XXResource extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "RES_SERVICES", length = 10000) protected String services; + /** * Default constructor. This will set all the attributes to default value. */ @@ -274,8 +256,14 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /** * Checks for all attributes except referenced db objects + * * @return true if all attributes match */ @Override @@ -336,16 +324,15 @@ public boolean equals(Object obj) { return false; } - if ((this.topologies == null && other.topologies != null) - || (this.topologies != null && !this.topologies.equals(other.topologies))) { + if ((this.topologies == null && other.topologies != null) || (this.topologies != null && !this.topologies.equals(other.topologies))) { return false; } - return (this.services != null || other.services == null) - && (this.services == null || this.services.equals(other.services)); + return (this.services != null || other.services == null) && (this.services == null || this.services.equals(other.services)); } /** * This return the bean content in string format + * * @return formatedStr */ @Override @@ -386,6 +373,7 @@ public void setPolicyName(String policyName) { /** * Returns the value for the member attribute name + * * @return String - value of member attribute name. */ public String getName() { @@ -395,6 +383,7 @@ public String getName() { /** * This method sets the value to the member attribute name. * You cannot set null to the attribute. + * * @param name Value to set member attribute name */ public void setName(String name) { @@ -403,6 +392,7 @@ public void setName(String name) { /** * Returns the value for the member attribute description + * * @return String - value of member attribute description. */ public String getDescription() { @@ -412,6 +402,7 @@ public String getDescription() { /** * This method sets the value to the member attribute description. * You cannot set null to the attribute. + * * @param description Value to set member attribute description */ public void setDescription(String description) { @@ -420,6 +411,7 @@ public void setDescription(String description) { /** * Returns the value for the member attribute resourceType + * * @return int - value of member attribute resourceType. */ public int getResourceType() { @@ -429,6 +421,7 @@ public int getResourceType() { /** * This method sets the value to the member attribute resourceType. * You cannot set null to the attribute. + * * @param resourceType Value to set member attribute resourceType */ public void setResourceType(int resourceType) { @@ -437,6 +430,7 @@ public void setResourceType(int resourceType) { /** * Returns the value for the member attribute assetId + * * @return Long - value of member attribute assetId. */ public Long getAssetId() { @@ -446,6 +440,7 @@ public Long getAssetId() { /** * This method sets the value to the member attribute assetId. * You cannot set null to the attribute. + * * @param assetId Value to set member attribute assetId */ public void setAssetId(Long assetId) { @@ -454,6 +449,7 @@ public void setAssetId(Long assetId) { /** * Returns the value for the member attribute parentId + * * @return Long - value of member attribute parentId. */ public Long getParentId() { @@ -463,6 +459,7 @@ public Long getParentId() { /** * This method sets the value to the member attribute parentId. * You cannot set null to the attribute. + * * @param parentId Value to set member attribute parentId */ public void setParentId(Long parentId) { @@ -471,6 +468,7 @@ public void setParentId(Long parentId) { /** * Returns the value for the member attribute parentPath + * * @return String - value of member attribute parentPath. */ public String getParentPath() { @@ -480,6 +478,7 @@ public String getParentPath() { /** * This method sets the value to the member attribute parentPath. * You cannot set null to the attribute. + * * @param parentPath Value to set member attribute parentPath */ public void setParentPath(String parentPath) { @@ -488,6 +487,7 @@ public void setParentPath(String parentPath) { /** * Returns the value for the member attribute isEncrypt + * * @return int - value of member attribute isEncrypt. */ public int getIsEncrypt() { @@ -497,6 +497,7 @@ public int getIsEncrypt() { /** * This method sets the value to the member attribute isEncrypt. * You cannot set null to the attribute. + * * @param isEncrypt Value to set member attribute isEncrypt */ public void setIsEncrypt(int isEncrypt) { @@ -505,6 +506,7 @@ public void setIsEncrypt(int isEncrypt) { /** * Returns the value for the member attribute isRecursive + * * @return int - value of member attribute isRecursive. */ public int getIsRecursive() { @@ -514,6 +516,7 @@ public int getIsRecursive() { /** * This method sets the value to the member attribute isRecursive. * You cannot set null to the attribute. + * * @param isRecursive Value to set member attribute isRecursive */ public void setIsRecursive(int isRecursive) { @@ -522,6 +525,7 @@ public void setIsRecursive(int isRecursive) { /** * Returns the value for the member attribute resourceGroup + * * @return String - value of member attribute resourceGroup. */ public String getResourceGroup() { @@ -531,6 +535,7 @@ public String getResourceGroup() { /** * This method sets the value to the member attribute resourceGroup. * You cannot set null to the attribute. + * * @param resourceGroup Value to set member attribute resourceGroup */ public void setResourceGroup(String resourceGroup) { @@ -539,6 +544,7 @@ public void setResourceGroup(String resourceGroup) { /** * Returns the value for the member attribute databases + * * @return String - value of member attribute databases. */ public String getDatabases() { @@ -548,6 +554,7 @@ public String getDatabases() { /** * This method sets the value to the member attribute databases. * You cannot set null to the attribute. + * * @param databases Value to set member attribute databases */ public void setDatabases(String databases) { @@ -556,6 +563,7 @@ public void setDatabases(String databases) { /** * Returns the value for the member attribute tables + * * @return String - value of member attribute tables. */ public String getTables() { @@ -565,6 +573,7 @@ public String getTables() { /** * This method sets the value to the member attribute tables. * You cannot set null to the attribute. + * * @param tables Value to set member attribute tables */ public void setTables(String tables) { @@ -573,6 +582,7 @@ public void setTables(String tables) { /** * Returns the value for the member attribute columnFamilies + * * @return String - value of member attribute columnFamilies. */ public String getColumnFamilies() { @@ -582,6 +592,7 @@ public String getColumnFamilies() { /** * This method sets the value to the member attribute columnFamilies. * You cannot set null to the attribute. + * * @param columnFamilies Value to set member attribute columnFamilies */ public void setColumnFamilies(String columnFamilies) { @@ -590,6 +601,7 @@ public void setColumnFamilies(String columnFamilies) { /** * Returns the value for the member attribute columns + * * @return String - value of member attribute columns. */ public String getColumns() { @@ -599,6 +611,7 @@ public String getColumns() { /** * This method sets the value to the member attribute columns. * You cannot set null to the attribute. + * * @param columns Value to set member attribute columns */ public void setColumns(String columns) { @@ -607,6 +620,7 @@ public void setColumns(String columns) { /** * Returns the value for the member attribute udfs + * * @return String - value of member attribute udfs. */ public String getUdfs() { @@ -616,6 +630,7 @@ public String getUdfs() { /** * This method sets the value to the member attribute udfs. * You cannot set null to the attribute. + * * @param udfs Value to set member attribute udfs */ public void setUdfs(String udfs) { @@ -624,6 +639,7 @@ public void setUdfs(String udfs) { /** * Returns the value for the member attribute resourceStatus + * * @return int - value of member attribute resourceStatus. */ public int getResourceStatus() { @@ -633,6 +649,7 @@ public int getResourceStatus() { /** * This method sets the value to the member attribute resourceStatus. * You cannot set null to the attribute. + * * @param resourceStatus Value to set member attribute resourceStatus */ public void setResourceStatus(int resourceStatus) { @@ -641,6 +658,7 @@ public void setResourceStatus(int resourceStatus) { /** * Returns the value for the member attribute tableType + * * @return int - value of member attribute tableType. */ public int getTableType() { @@ -650,6 +668,7 @@ public int getTableType() { /** * This method sets the value to the member attribute tableType. * You cannot set null to the attribute. + * * @param tableType Value to set member attribute tableType */ public void setTableType(int tableType) { @@ -658,6 +677,7 @@ public void setTableType(int tableType) { /** * Returns the value for the member attribute columnType + * * @return int - value of member attribute columnType. */ public int getColumnType() { @@ -667,6 +687,7 @@ public int getColumnType() { /** * This method sets the value to the member attribute columnType. * You cannot set null to the attribute. + * * @param columnType Value to set member attribute columnType */ public void setColumnType(int columnType) { @@ -675,6 +696,7 @@ public void setColumnType(int columnType) { /** * Returns the value for the member attribute topologies + * * @return String - value of member attribute topologies. */ public String getTopologies() { @@ -684,6 +706,7 @@ public String getTopologies() { /** * This method sets the value to the member attribute topologies. * You cannot set null to the attribute. + * * @param topologies Value to set member attribute topologies */ public void setTopologies(String topologies) { @@ -692,6 +715,7 @@ public void setTopologies(String topologies) { /** * Returns the value for the member attribute services + * * @return String - value of member attribute services. */ public String getServices() { @@ -701,6 +725,7 @@ public String getServices() { /** * This method sets the value to the member attribute services. * You cannot set null to the attribute. + * * @param services Value to set member attribute services */ public void setServices(String services) { diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXResourceDef.java b/security-admin/src/main/java/org/apache/ranger/entity/XXResourceDef.java index d5598ce271..cfa1978932 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXResourceDef.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXResourceDef.java @@ -246,6 +246,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /* * (non-Javadoc) * @@ -390,8 +395,9 @@ public boolean equals(Object obj) { } if (rowFilterOptions == null) { return other.rowFilterOptions == null; - } else + } else { return rowFilterOptions.equals(other.rowFilterOptions); + } } /* @@ -406,8 +412,8 @@ public String toString() { + level + ", parent=" + parent + ", mandatory=" + mandatory + ", lookUpSupported=" + lookUpSupported + ", recursiveSupported=" + recursiveSupported - + ", excludesSupported=" + excludesSupported + ", matcher=" - + matcher + ", matcherOptions=" + matcherOptions + + ", excludesSupported=" + excludesSupported + ", matcher=" + matcher + + ", matcherOptions=" + matcherOptions + ", validationRegEx=" + validationRegEx + ", validationMessage=" + validationMessage + ", uiHint=" + uiHint @@ -808,7 +814,11 @@ public void setDataMaskOptions(String dataMaskOptions) { this.dataMaskOptions = dataMaskOptions; } - public String getRowFilterOptions() {return rowFilterOptions;} + public String getRowFilterOptions() { + return rowFilterOptions; + } - public void setRowFilterOptions(String rowFilterOptions) {this.rowFilterOptions = rowFilterOptions;} + public void setRowFilterOptions(String rowFilterOptions) { + this.rowFilterOptions = rowFilterOptions; + } } diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXRole.java b/security-admin/src/main/java/org/apache/ranger/entity/XXRole.java index 4c6e7b1881..6cfe1bb84b 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXRole.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXRole.java @@ -39,6 +39,11 @@ public class XXRole extends XXRoleBase implements java.io.Serializable { @Column(name = "id") protected Long id; + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), id); + } + @Override public boolean equals(Object obj) { if (this == obj) { @@ -54,25 +59,20 @@ public boolean equals(Object obj) { XXRole other = (XXRole) obj; return Objects.equals(id, other.id); - } @Override - public void setId(Long id) { - this.id = id; } @Override - public int hashCode() { - return Objects.hash(super.hashCode(), id); - } @Override + public String toString() { + return "Role [id=" + id + "]"; + } + + @Override public Long getId() { return id; } @Override - public String toString() { - return "Role [id=" + id + "]"; + public void setId(Long id) { + this.id = id; } - - - - } diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXRoleBase.java b/security-admin/src/main/java/org/apache/ranger/entity/XXRoleBase.java index c438a178b7..fbfe84d1ce 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXRoleBase.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXRoleBase.java @@ -43,27 +43,37 @@ public abstract class XXRoleBase extends XXDBBase { @Column(name = "role_text") protected String roleText; - public Long getVersion() {return version;} + public Long getVersion() { + return version; + } - public String getName() {return name;} + public String getName() { + return name; + } public void setName(String name) { this.name = name; } - public String getDescription() {return description;} + public String getDescription() { + return description; + } public void setDescription(String description) { this.description = description; } - public String getOptions() {return options;} + public String getOptions() { + return options; + } public void setOptions(String options) { this.options = options; } - public String getRoleText() {return roleText;} + public String getRoleText() { + return roleText; + } public void setRoleText(String roleText) { this.roleText = roleText; @@ -103,4 +113,3 @@ public String toString() { return str; } } - diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXRoleRefGroup.java b/security-admin/src/main/java/org/apache/ranger/entity/XXRoleRefGroup.java index c48018910c..4063f2b0a1 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXRoleRefGroup.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXRoleRefGroup.java @@ -37,7 +37,6 @@ @Cacheable @Table(name = "x_role_ref_group") public class XXRoleRefGroup extends XXDBBase implements Serializable { - private static final long serialVersionUID = 1L; /** @@ -139,8 +138,7 @@ public boolean equals(Object obj) { */ @Override public String toString() { - return "XXRoleRefGroup [" + super.toString() + " id=" + id + ", roleId=" + roleId + ", groupId=" + groupId - + ", groupName=" + groupName + ", groupType=" + groupType + "]"; + return "XXRoleRefGroup [" + super.toString() + " id=" + id + ", roleId=" + roleId + ", groupId=" + groupId + ", groupName=" + groupName + ", groupType=" + groupType + "]"; } /** diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXRoleRefRole.java b/security-admin/src/main/java/org/apache/ranger/entity/XXRoleRefRole.java index 69d48f3051..24fb7836d9 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXRoleRefRole.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXRoleRefRole.java @@ -37,7 +37,6 @@ @Cacheable @Table(name = "x_role_ref_role") public class XXRoleRefRole extends XXDBBase implements Serializable { - private static final long serialVersionUID = 1L; /** @@ -139,8 +138,7 @@ public boolean equals(Object obj) { */ @Override public String toString() { - return "XXRoleRefRole [" + super.toString() + " id=" + id + ", roleId=" + roleId + ", subRoleId=" + subRoleId - + ", subRoleName=" + subRoleName + ", subRoleType=" + subRoleType + "]"; + return "XXRoleRefRole [" + super.toString() + " id=" + id + ", roleId=" + roleId + ", subRoleId=" + subRoleId + ", subRoleName=" + subRoleName + ", subRoleType=" + subRoleType + "]"; } /** diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXRoleRefUser.java b/security-admin/src/main/java/org/apache/ranger/entity/XXRoleRefUser.java index 08bf472611..67a8e0cee6 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXRoleRefUser.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXRoleRefUser.java @@ -37,7 +37,6 @@ @Cacheable @Table(name = "x_role_ref_user") public class XXRoleRefUser extends XXDBBase implements Serializable { - private static final long serialVersionUID = 1L; /** @@ -139,8 +138,7 @@ public boolean equals(Object obj) { */ @Override public String toString() { - return "XXRoleRefUser [" + super.toString() + " id=" + id + ", roleId=" + roleId + ", userId=" + userId - + ", userName=" + userName + ", userType=" + userType + "]"; + return "XXRoleRefUser [" + super.toString() + " id=" + id + ", roleId=" + roleId + ", userId=" + userId + ", userName=" + userName + ", userType=" + userType + "]"; } /** diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZone.java b/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZone.java index 0f301c4aeb..a3e82e237b 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZone.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZone.java @@ -49,6 +49,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), id); + } + @Override public boolean equals(Object obj) { if (this == obj) { @@ -66,11 +71,6 @@ public boolean equals(Object obj) { return Objects.equals(id, other.id); } - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), id); - } - @Override public String toString() { return "SecurityZone [id=" + id + "]"; diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneBase.java b/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneBase.java index 8f47152afe..2ce5e5cf10 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneBase.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneBase.java @@ -43,25 +43,37 @@ public abstract class XXSecurityZoneBase extends XXDBBase { @Column(name = "description") protected String description; - public Long getVersion() {return version;} + public Long getVersion() { + return version; + } - public String getName() {return name;} + public String getName() { + return name; + } public void setName(String name) { this.name = name; } - public String getJsonData() {return jsonData;} + public String getJsonData() { + return jsonData; + } public void setJsonData(String jsonData) { this.jsonData = jsonData; } - public byte[] getGzJsonData() {return gzJsonData;} + public byte[] getGzJsonData() { + return gzJsonData; + } - public void setGzJsonData(byte[] gzJsonData) {this.gzJsonData = gzJsonData;} + public void setGzJsonData(byte[] gzJsonData) { + this.gzJsonData = gzJsonData; + } - public String getDescription() {return description;} + public String getDescription() { + return description; + } public void setDescription(String description) { this.description = description; diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefGroup.java b/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefGroup.java index 7d00166e0e..d55fdbdd12 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefGroup.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefGroup.java @@ -125,8 +125,7 @@ public boolean equals(Object obj) { */ @Override public String toString() { - return "XXSecurityZoneRefGroup [" + super.toString() + " id=" + id + ", zoneId=" + zoneId + ", groupId=" - + groupId + ", groupName=" + groupName + ", groupType=" + groupType + "]"; + return "XXSecurityZoneRefGroup [" + super.toString() + " id=" + id + ", zoneId=" + zoneId + ", groupId=" + groupId + ", groupName=" + groupName + ", groupType=" + groupType + "]"; } /** diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefResource.java b/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefResource.java index 3bb5f57d53..e77ec65a37 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefResource.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefResource.java @@ -116,8 +116,7 @@ public boolean equals(Object obj) { */ @Override public String toString() { - return "XXSecurityZoneRefResource [" + super.toString() + " id=" + id + ", zoneId=" + zoneId + ", resourceDefId=" - + resourceDefId + ", resourceName=" + resourceName + "]"; + return "XXSecurityZoneRefResource [" + super.toString() + " id=" + id + ", zoneId=" + zoneId + ", resourceDefId=" + resourceDefId + ", resourceName=" + resourceName + "]"; } /** diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefRole.java b/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefRole.java index e4e15b961f..27ba4a8cbb 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefRole.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefRole.java @@ -114,8 +114,7 @@ public boolean equals(Object obj) { */ @Override public String toString() { - return "XXSecurityZoneRefRole [" + super.toString() + " id=" + id + ", zoneId=" + zoneId + ", roleId=" - + roleId + ", roleName=" + roleName + "]"; + return "XXSecurityZoneRefRole [" + super.toString() + " id=" + id + ", zoneId=" + zoneId + ", roleId=" + roleId + ", roleName=" + roleName + "]"; } /** diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefService.java b/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefService.java index 0b3000b05a..af480f1f14 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefService.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefService.java @@ -116,8 +116,7 @@ public boolean equals(Object obj) { */ @Override public String toString() { - return "XXSecurityZoneRefService [" + super.toString() + " id=" + id + ", zoneId=" + zoneId + ", serviceId=" - + serviceId + ", serviceName=" + serviceName + "]"; + return "XXSecurityZoneRefService [" + super.toString() + " id=" + id + ", zoneId=" + zoneId + ", serviceId=" + serviceId + ", serviceName=" + serviceName + "]"; } /** diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefTagService.java b/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefTagService.java index 6a28526656..3cfa0f5684 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefTagService.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefTagService.java @@ -76,17 +76,12 @@ public boolean equals(Object obj) { XXSecurityZoneRefTagService other = (XXSecurityZoneRefTagService) obj; - return super.equals(obj) && - Objects.equals(id, other.id) && - Objects.equals(zoneId, other.zoneId) && - Objects.equals(tagServiceId, other.tagServiceId) && - Objects.equals(tagServiceName, other.tagServiceName); + return super.equals(obj) && Objects.equals(id, other.id) && Objects.equals(zoneId, other.zoneId) && Objects.equals(tagServiceId, other.tagServiceId) && Objects.equals(tagServiceName, other.tagServiceName); } @Override public String toString() { - return "XXSecurityZoneRefTagService [id=" + id + ", zoneId=" + zoneId + ", tagServiceId=" + tagServiceId - + ", tagServiceName=" + tagServiceName + "]"; + return "XXSecurityZoneRefTagService [id=" + id + ", zoneId=" + zoneId + ", tagServiceId=" + tagServiceId + ", tagServiceName=" + tagServiceName + "]"; } public Long getZoneId() { diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefUser.java b/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefUser.java index ab3dd95074..3bfb4a7981 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefUser.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefUser.java @@ -112,12 +112,7 @@ public boolean equals(Object obj) { XXSecurityZoneRefUser other = (XXSecurityZoneRefUser) obj; - return super.equals(obj) && - Objects.equals(id, other.id) && - Objects.equals(zoneId, other.zoneId) && - Objects.equals(userId, other.userId) && - Objects.equals(userName, other.userName) && - Objects.equals(userType, other.userType); + return super.equals(obj) && Objects.equals(id, other.id) && Objects.equals(zoneId, other.zoneId) && Objects.equals(userId, other.userId) && Objects.equals(userName, other.userName) && Objects.equals(userType, other.userType); } /* (non-Javadoc) @@ -125,8 +120,7 @@ public boolean equals(Object obj) { */ @Override public String toString() { - return "XXSecurityZoneRefUser [" + super.toString() + " id=" + id + ", zoneId=" + zoneId + ", userId=" - + userId + ", userName=" + userName + ", userType=" + userType + "]"; + return "XXSecurityZoneRefUser [" + super.toString() + " id=" + id + ", zoneId=" + zoneId + ", userId=" + userId + ", userName=" + userName + ", userType=" + userType + "]"; } /** diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXService.java b/security-admin/src/main/java/org/apache/ranger/entity/XXService.java index 5636b6468a..2491975c55 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXService.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXService.java @@ -54,6 +54,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + @Override public boolean equals(Object obj) { if (this == obj) { @@ -68,8 +73,9 @@ public boolean equals(Object obj) { XXService other = (XXService) obj; if (id == null) { return other.id == null; - } else + } else { return id.equals(other.id); + } } @Override diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXServiceBase.java b/security-admin/src/main/java/org/apache/ranger/entity/XXServiceBase.java index d0bf70d727..c6be5ad918 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXServiceBase.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXServiceBase.java @@ -340,6 +340,11 @@ public Boolean getIsenabled() { return this.isEnabled; } + @Override + public int hashCode() { + return super.hashCode(); + } + /* * (non-Javadoc) * diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXServiceConfigDef.java b/security-admin/src/main/java/org/apache/ranger/entity/XXServiceConfigDef.java index a38e7b06d7..50591bf0d0 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXServiceConfigDef.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXServiceConfigDef.java @@ -30,8 +30,7 @@ @Entity @Cacheable @Table(name = "x_service_config_def") -public class XXServiceConfigDef extends XXDBBase implements - java.io.Serializable { +public class XXServiceConfigDef extends XXDBBase implements java.io.Serializable { private static final long serialVersionUID = 1L; /** * id of the XXServiceConfigDef @@ -191,6 +190,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /* * (non-Javadoc) * @@ -301,8 +305,9 @@ public boolean equals(Object obj) { } if (type == null) { return other.type == null; - } else + } else { return type.equals(other.type); + } } /* diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXServiceConfigMap.java b/security-admin/src/main/java/org/apache/ranger/entity/XXServiceConfigMap.java index bb10b7e888..fdc404a9c5 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXServiceConfigMap.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXServiceConfigMap.java @@ -30,8 +30,7 @@ @Entity @Cacheable @Table(name = "x_service_config_map") -public class XXServiceConfigMap extends XXDBBase implements - java.io.Serializable { +public class XXServiceConfigMap extends XXDBBase implements java.io.Serializable { private static final long serialVersionUID = 1L; /** * id of the XXServiceConfigMap @@ -87,6 +86,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /* * (non-Javadoc) * @@ -130,8 +134,9 @@ public boolean equals(Object obj) { } if (serviceId == null) { return other.serviceId == null; - } else + } else { return serviceId.equals(other.serviceId); + } } /* diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXServiceDef.java b/security-admin/src/main/java/org/apache/ranger/entity/XXServiceDef.java index 1431a6426e..b8d8fc74ff 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXServiceDef.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXServiceDef.java @@ -64,6 +64,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + @Override public boolean equals(Object obj) { if (this == obj) { @@ -78,8 +83,9 @@ public boolean equals(Object obj) { XXServiceDef other = (XXServiceDef) obj; if (id == null) { return other.id == null; - } else + } else { return id.equals(other.id); + } } @Override diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXServiceDefBase.java b/security-admin/src/main/java/org/apache/ranger/entity/XXServiceDefBase.java index addf0d3088..b34918eb8a 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXServiceDefBase.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXServiceDefBase.java @@ -310,6 +310,11 @@ public void setDisplayName(String displayName) { this.displayName = displayName; } + @Override + public int hashCode() { + return super.hashCode(); + } + /* * (non-Javadoc) * @@ -385,8 +390,9 @@ public boolean equals(Object obj) { } if (isEnabled == null) { return other.isEnabled == null; - } else + } else { return isEnabled.equals(other.isEnabled); + } } /* diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXServiceDefWithAssignedId.java b/security-admin/src/main/java/org/apache/ranger/entity/XXServiceDefWithAssignedId.java index 2466043556..3a0b013279 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXServiceDefWithAssignedId.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXServiceDefWithAssignedId.java @@ -48,6 +48,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + @Override public boolean equals(Object obj) { if (this == obj) { @@ -62,8 +67,9 @@ public boolean equals(Object obj) { XXServiceDefWithAssignedId other = (XXServiceDefWithAssignedId) obj; if (id == null) { return other.id == null; - } else + } else { return id.equals(other.id); + } } @Override diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXServiceResource.java b/security-admin/src/main/java/org/apache/ranger/entity/XXServiceResource.java index 3e1882f914..1f37703366 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXServiceResource.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXServiceResource.java @@ -137,15 +137,21 @@ public void setIsEnabled(Boolean isEnabled) { this.isEnabled = isEnabled; } - public String getServiceResourceElements() {return serviceResourceElements;} + public String getServiceResourceElements() { + return serviceResourceElements; + } public void setServiceResourceElements(String serviceResourceElements) { this.serviceResourceElements = serviceResourceElements; } - public String getTags() {return tags;} + public String getTags() { + return tags; + } - public void setTags(String tags) {this.tags = tags;} + public void setTags(String tags) { + this.tags = tags; + } @Override public int getMyClassType() { @@ -250,8 +256,9 @@ public boolean equals(Object obj) { } if (tags == null) { return other.tags == null; - } else + } else { return tags.equals(other.tags); + } } /* diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXServiceResourceElement.java b/security-admin/src/main/java/org/apache/ranger/entity/XXServiceResourceElement.java index 662941798a..64a221a9cc 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXServiceResourceElement.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXServiceResourceElement.java @@ -191,8 +191,9 @@ public boolean equals(Object obj) { } if (resourceId == null) { return other.resourceId == null; - } else + } else { return resourceId.equals(other.resourceId); + } } /* diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXServiceResourceElementValue.java b/security-admin/src/main/java/org/apache/ranger/entity/XXServiceResourceElementValue.java index dfe1b107b0..9e21f47fa1 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXServiceResourceElementValue.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXServiceResourceElementValue.java @@ -19,7 +19,7 @@ package org.apache.ranger.entity; -import java.io.Serializable; +import org.apache.ranger.common.AppConstants; import javax.persistence.Cacheable; import javax.persistence.Column; @@ -30,7 +30,7 @@ import javax.persistence.SequenceGenerator; import javax.persistence.Table; -import org.apache.ranger.common.AppConstants; +import java.io.Serializable; @Entity @Cacheable @@ -166,8 +166,9 @@ public boolean equals(Object obj) { } if (value == null) { return other.value == null; - } else + } else { return value.equals(other.value); + } } /* diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXServiceVersionInfo.java b/security-admin/src/main/java/org/apache/ranger/entity/XXServiceVersionInfo.java index 6e53726582..9f52e552ec 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXServiceVersionInfo.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXServiceVersionInfo.java @@ -103,6 +103,67 @@ public static boolean equals(Object object1, Object object2) { return object1.equals(object2); } + @Override + public int hashCode() { + return super.hashCode(); + } + + /** + * Checks for all attributes except referenced db objects + * + * @return true if all attributes match + */ + @Override + public boolean equals(Object obj) { + final boolean ret; + + if (this == obj) { + ret = true; + } else if (obj == null || getClass() != obj.getClass()) { + ret = false; + } else { + XXServiceVersionInfo other = (XXServiceVersionInfo) obj; + + ret = super.equals(obj) && + Objects.equals(id, other.id) && + Objects.equals(version, other.version) && + Objects.equals(serviceId, other.serviceId) && + Objects.equals(policyVersion, other.policyVersion) && + Objects.equals(policyUpdateTime, other.policyUpdateTime) && + Objects.equals(tagVersion, other.tagVersion) && + Objects.equals(tagUpdateTime, other.tagUpdateTime) && + Objects.equals(roleVersion, other.roleVersion) && + Objects.equals(roleUpdateTime, other.roleUpdateTime) && + Objects.equals(gdsVersion, other.gdsVersion) && + Objects.equals(gdsUpdateTime, other.gdsUpdateTime); + } + + return ret; + } + + /** + * This return the bean content in string format + * + * @return formatedStr + */ + @Override + public String toString() { + String str = "XXServiceVersionInfo={"; + str += "id={" + id + "} "; + str += "version={" + version + "} "; + str += "serviceId={" + serviceId + "} "; + str += "policyVersion={" + policyVersion + "} "; + str += "policyUpdateTime={" + policyUpdateTime + "} "; + str += "tagVersion={" + tagVersion + "} "; + str += "tagUpdateTime={" + tagUpdateTime + "} "; + str += "setRoleVersion={" + roleVersion + "}"; + str += "setRoleUpdateTime={" + roleUpdateTime + "}"; + str += "gdsVersion={" + gdsVersion + "} "; + str += "gdsUpdateTime={" + gdsUpdateTime + "} "; + str += "}"; + return str; + } + public int getMyClassType() { return AppConstants.CLASS_TYPE_NONE; } @@ -198,60 +259,4 @@ public Date getGdsUpdateTime() { public void setGdsUpdateTime(Date updateTime) { this.gdsUpdateTime = updateTime; } - - /** - * Checks for all attributes except referenced db objects - * - * @return true if all attributes match - */ - @Override - public boolean equals(Object obj) { - final boolean ret; - - if (this == obj) { - ret = true; - } else if (obj == null || getClass() != obj.getClass()) { - ret = false; - } else { - XXServiceVersionInfo other = (XXServiceVersionInfo) obj; - - ret = super.equals(obj) && - Objects.equals(id, other.id) && - Objects.equals(version, other.version) && - Objects.equals(serviceId, other.serviceId) && - Objects.equals(policyVersion, other.policyVersion) && - Objects.equals(policyUpdateTime, other.policyUpdateTime) && - Objects.equals(tagVersion, other.tagVersion) && - Objects.equals(tagUpdateTime, other.tagUpdateTime) && - Objects.equals(roleVersion, other.roleVersion) && - Objects.equals(roleUpdateTime, other.roleUpdateTime) && - Objects.equals(gdsVersion, other.gdsVersion) && - Objects.equals(gdsUpdateTime, other.gdsUpdateTime); - } - - return ret; - } - - /** - * This return the bean content in string format - * - * @return formatedStr - */ - @Override - public String toString() { - String str = "XXServiceVersionInfo={"; - str += "id={" + id + "} "; - str += "version={" + version + "} "; - str += "serviceId={" + serviceId + "} "; - str += "policyVersion={" + policyVersion + "} "; - str += "policyUpdateTime={" + policyUpdateTime + "} "; - str += "tagVersion={" + tagVersion + "} "; - str += "tagUpdateTime={" + tagUpdateTime + "} "; - str += "setRoleVersion={" + roleVersion + "}"; - str += "setRoleUpdateTime={" + roleUpdateTime + "}"; - str += "gdsVersion={" + gdsVersion + "} "; - str += "gdsUpdateTime={" + gdsUpdateTime + "} "; - str += "}"; - return str; - } } diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXServiceWithAssignedId.java b/security-admin/src/main/java/org/apache/ranger/entity/XXServiceWithAssignedId.java index a2d35fd311..325bfb87df 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXServiceWithAssignedId.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXServiceWithAssignedId.java @@ -48,6 +48,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + @Override public boolean equals(Object obj) { if (this == obj) { @@ -62,8 +67,9 @@ public boolean equals(Object obj) { XXServiceWithAssignedId other = (XXServiceWithAssignedId) obj; if (id == null) { return other.id == null; - } else + } else { return id.equals(other.id); + } } @Override diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXTag.java b/security-admin/src/main/java/org/apache/ranger/entity/XXTag.java index 81ba944718..01bf54f313 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXTag.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXTag.java @@ -69,9 +69,6 @@ public class XXTag extends XXDBBase implements Serializable { */ public String getGuid() { return guid; - } @Override - public void setId(Long id) { - this.id = id; } /** @@ -79,9 +76,6 @@ public void setId(Long id) { */ public void setGuid(String guid) { this.guid = guid; - } @Override - public Long getId() { - return id; } /** @@ -112,9 +106,13 @@ public void setType(Long type) { this.type = type; } - public Short getOwner() {return owner;} + public Short getOwner() { + return owner; + } - public void setOwner(Short owner) {this.owner = owner;} + public void setOwner(Short owner) { + this.owner = owner; + } public String getOptions() { return this.options; @@ -124,30 +122,28 @@ public void setOptions(String options) { this.options = options; } - public String getTagAttrs() {return tagAttrs;} + public String getTagAttrs() { + return tagAttrs; + } - public void setTagAttrs(String tagAttrs) {this.tagAttrs = tagAttrs;} + public void setTagAttrs(String tagAttrs) { + this.tagAttrs = tagAttrs; + } @Override public int getMyClassType() { return AppConstants.CLASS_TYPE_XA_TAG; } - public StringBuilder toString(StringBuilder sb) { - sb.append("{ "); - sb.append(super.toString() + "} "); - sb.append("id={").append(id).append("} "); - sb.append("guid={").append(guid).append("} "); - sb.append("type={").append(type).append("} "); - sb.append("owned_by={").append(owner).append("} "); - sb.append("options={").append(options).append("} "); - sb.append("tagAttrs={").append(tagAttrs).append("} "); - sb.append(" }"); - - return sb; + @Override + public Long getId() { + return id; } - + @Override + public void setId(Long id) { + this.id = id; + } /* * (non-Javadoc) @@ -225,8 +221,9 @@ public boolean equals(Object obj) { } else if (!options.equals(other.options)) { if (tagAttrs == null) { return other.tagAttrs == null; - } else + } else { return tagAttrs.equals(other.tagAttrs); + } } return true; } @@ -243,5 +240,17 @@ public String toString() { return sb.toString(); } + public StringBuilder toString(StringBuilder sb) { + sb.append("{ "); + sb.append(super.toString() + "} "); + sb.append("id={").append(id).append("} "); + sb.append("guid={").append(guid).append("} "); + sb.append("type={").append(type).append("} "); + sb.append("owned_by={").append(owner).append("} "); + sb.append("options={").append(options).append("} "); + sb.append("tagAttrs={").append(tagAttrs).append("} "); + sb.append(" }"); + return sb; + } } diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXTagAttribute.java b/security-admin/src/main/java/org/apache/ranger/entity/XXTagAttribute.java index 1c9f9fd8ae..c92295787b 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXTagAttribute.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXTagAttribute.java @@ -166,8 +166,9 @@ public boolean equals(Object obj) { } if (value == null) { return other.value == null; - } else + } else { return value.equals(other.value); + } } /* diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXTagAttributeDef.java b/security-admin/src/main/java/org/apache/ranger/entity/XXTagAttributeDef.java index 707a68171a..dc6270a17d 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXTagAttributeDef.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXTagAttributeDef.java @@ -166,8 +166,9 @@ public boolean equals(Object obj) { } if (type == null) { return other.type == null; - } else + } else { return type.equals(other.type); + } } /* diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXTagChangeLog.java b/security-admin/src/main/java/org/apache/ranger/entity/XXTagChangeLog.java index f5b066b8b0..c0b82fb995 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXTagChangeLog.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXTagChangeLog.java @@ -122,9 +122,13 @@ public void setServiceId(Long serviceId) { this.serviceId = serviceId; } - public Integer getChangeType() {return this.changeType;} + public Integer getChangeType() { + return this.changeType; + } - public void setChangeType(Integer changeType) {this.changeType = changeType;} + public void setChangeType(Integer changeType) { + this.changeType = changeType; + } public Long getServiceTagsVersion() { return this.serviceTagsVersion; @@ -134,18 +138,27 @@ public void setServiceTagsVersion(Long serviceTagsVersion) { this.serviceTagsVersion = serviceTagsVersion; } - public Long getServiceResourceId() {return this.serviceResourceId;} + public Long getServiceResourceId() { + return this.serviceResourceId; + } public void setServiceResourceId(Long serviceResourceId) { this.serviceResourceId = serviceResourceId; } - public Long getTagId() {return this.tagId;} + public Long getTagId() { + return this.tagId; + } public void setTagId(Long tagId) { this.tagId = tagId; } + @Override + public int hashCode() { + return super.hashCode(); + } + /** * Checks for all attributes except referenced db objects * @@ -168,9 +181,7 @@ public boolean equals(Object obj) { XXTagChangeLog other = (XXTagChangeLog) obj; - return Objects.equals(this.id, other.id) && Objects.equals(this.createTime, other.createTime) && Objects.equals(this.serviceId, other.serviceId) - && Objects.equals(this.changeType, other.changeType) && Objects.equals(this.serviceTagsVersion, other.serviceTagsVersion) - && Objects.equals(this.serviceResourceId, other.serviceResourceId) && Objects.equals(this.tagId, other.tagId); + return Objects.equals(this.id, other.id) && Objects.equals(this.createTime, other.createTime) && Objects.equals(this.serviceId, other.serviceId) && Objects.equals(this.changeType, other.changeType) && Objects.equals(this.serviceTagsVersion, other.serviceTagsVersion) && Objects.equals(this.serviceResourceId, other.serviceResourceId) && Objects.equals(this.tagId, other.tagId); } /** @@ -192,5 +203,3 @@ public String toString() { return str; } } - - diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXTagDef.java b/security-admin/src/main/java/org/apache/ranger/entity/XXTagDef.java index 77015823b3..d516997f38 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXTagDef.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXTagDef.java @@ -134,9 +134,13 @@ public void setSource(String source) { this.source = source; } - public String getTagAttrDefs() {return tagAttrDefs;} + public String getTagAttrDefs() { + return tagAttrDefs; + } - public void setTagAttrDefs(String tagAttrDefs) {this.tagAttrDefs = tagAttrDefs;} + public void setTagAttrDefs(String tagAttrDefs) { + this.tagAttrDefs = tagAttrDefs; + } @Override public int getMyClassType() { @@ -233,8 +237,9 @@ public boolean equals(Object obj) { } if (tagAttrDefs == null) { return other.tagAttrDefs == null; - } else + } else { return tagAttrDefs.equals(other.tagAttrDefs); + } } /* diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXTagResourceMap.java b/security-admin/src/main/java/org/apache/ranger/entity/XXTagResourceMap.java index 0a3d01d0c7..5bcbf7f5bd 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXTagResourceMap.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXTagResourceMap.java @@ -166,8 +166,9 @@ public boolean equals(Object obj) { } if (resourceId == null) { return other.resourceId == null; - } else + } else { return resourceId.equals(other.resourceId); + } } /* diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXTrxLog.java b/security-admin/src/main/java/org/apache/ranger/entity/XXTrxLog.java index e9b9698231..32444f9729 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXTrxLog.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXTrxLog.java @@ -43,46 +43,41 @@ public class XXTrxLog extends XXDBBase implements java.io.Serializable { @SequenceGenerator(name = "X_TRX_LOG_SEQ", sequenceName = "X_TRX_LOG_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.AUTO, generator = "X_TRX_LOG_SEQ") @Column(name = "ID") - protected Long id; + protected Long id; /** * Name of the class to which the object id belongs to * - * */ @Column(name = "CLASS_TYPE", nullable = false) - protected int objectClassType = RangerConstants.CLASS_TYPE_NONE; + protected int objectClassType = RangerConstants.CLASS_TYPE_NONE; /** * Id of the object to which this notes refers to * - * */ @Column(name = "OBJECT_ID") - protected Long objectId; + protected Long objectId; /** * Object Id of the parent object * - * */ @Column(name = "PARENT_OBJECT_ID") - protected Long parentObjectId; + protected Long parentObjectId; /** * Object Class Type of the parent object * - * */ @Column(name = "PARENT_OBJECT_CLASS_TYPE", nullable = false) - protected int parentObjectClassType; + protected int parentObjectClassType; /** * Name of the attribute that was changed * - * */ @Column(name = "PARENT_OBJECT_NAME", length = 1024) protected String parentObjectName; @@ -91,7 +86,6 @@ public class XXTrxLog extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "OBJECT_NAME", length = 1024) protected String objectName; @@ -100,7 +94,6 @@ public class XXTrxLog extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "ATTR_NAME", length = 255) protected String attributeName; @@ -109,7 +102,6 @@ public class XXTrxLog extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "PREV_VAL", length = 1024) protected String previousValue; @@ -118,7 +110,6 @@ public class XXTrxLog extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "NEW_VAL", length = 1024) protected String newValue; @@ -127,7 +118,6 @@ public class XXTrxLog extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "TRX_ID", length = 1024) protected String transactionId; @@ -136,7 +126,6 @@ public class XXTrxLog extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "ACTION", length = 255) protected String action; @@ -145,7 +134,6 @@ public class XXTrxLog extends XXDBBase implements java.io.Serializable { * - * */ @Column(name = "SESS_ID", length = 512) protected String sessionId; @@ -153,7 +141,6 @@ public class XXTrxLog extends XXDBBase implements java.io.Serializable { * Request Id * - * */ @Column(name = "REQ_ID") protected String requestId; @@ -161,7 +148,6 @@ public class XXTrxLog extends XXDBBase implements java.io.Serializable { * Session Type * - * */ @Column(name = "SESS_TYPE") protected String sessionType; @@ -207,8 +193,14 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /** * Checks for all attributes except referenced db objects + * * @return true if all attributes match */ @Override @@ -261,6 +253,7 @@ public boolean equals(Object obj) { /** * This return the bean content in string format + * * @return formatedStr */ @Override @@ -285,6 +278,7 @@ public String toString() { /** * Returns the value for the member attribute objectClassType + * * @return int - value of member attribute objectClassType. */ public int getObjectClassType() { @@ -294,6 +288,7 @@ public int getObjectClassType() { /** * This method sets the value to the member attribute objectClassType. * You cannot set null to the attribute. + * * @param objectClassType Value to set member attribute objectClassType */ public void setObjectClassType(int objectClassType) { @@ -302,6 +297,7 @@ public void setObjectClassType(int objectClassType) { /** * Returns the value for the member attribute objectId + * * @return Long - value of member attribute objectId. */ public Long getObjectId() { @@ -311,6 +307,7 @@ public Long getObjectId() { /** * This method sets the value to the member attribute objectId. * You cannot set null to the attribute. + * * @param objectId Value to set member attribute objectId */ public void setObjectId(Long objectId) { @@ -319,6 +316,7 @@ public void setObjectId(Long objectId) { /** * Returns the value for the member attribute parentObjectId + * * @return Long - value of member attribute parentObjectId. */ public Long getParentObjectId() { @@ -328,6 +326,7 @@ public Long getParentObjectId() { /** * This method sets the value to the member attribute parentObjectId. * You cannot set null to the attribute. + * * @param parentObjectId Value to set member attribute parentObjectId */ public void setParentObjectId(Long parentObjectId) { @@ -336,6 +335,7 @@ public void setParentObjectId(Long parentObjectId) { /** * Returns the value for the member attribute parentObjectClassType + * * @return int - value of member attribute parentObjectClassType. */ public int getParentObjectClassType() { @@ -345,6 +345,7 @@ public int getParentObjectClassType() { /** * This method sets the value to the member attribute parentObjectClassType. * You cannot set null to the attribute. + * * @param parentObjectClassType Value to set member attribute parentObjectClassType */ public void setParentObjectClassType(int parentObjectClassType) { @@ -353,6 +354,7 @@ public void setParentObjectClassType(int parentObjectClassType) { /** * Returns the value for the member attribute parentObjectName + * * @return String - value of member attribute parentObjectName. */ public String getParentObjectName() { @@ -362,6 +364,7 @@ public String getParentObjectName() { /** * This method sets the value to the member attribute parentObjectName. * You cannot set null to the attribute. + * * @param parentObjectName Value to set member attribute parentObjectName */ public void setParentObjectName(String parentObjectName) { @@ -370,6 +373,7 @@ public void setParentObjectName(String parentObjectName) { /** * Returns the value for the member attribute objectName + * * @return String - value of member attribute objectName. */ public String getObjectName() { @@ -379,6 +383,7 @@ public String getObjectName() { /** * This method sets the value to the member attribute objectName. * You cannot set null to the attribute. + * * @param objectName Value to set member attribute objectName */ public void setObjectName(String objectName) { @@ -387,6 +392,7 @@ public void setObjectName(String objectName) { /** * Returns the value for the member attribute attributeName + * * @return String - value of member attribute attributeName. */ public String getAttributeName() { @@ -396,6 +402,7 @@ public String getAttributeName() { /** * This method sets the value to the member attribute attributeName. * You cannot set null to the attribute. + * * @param attributeName Value to set member attribute attributeName */ public void setAttributeName(String attributeName) { @@ -404,6 +411,7 @@ public void setAttributeName(String attributeName) { /** * Returns the value for the member attribute previousValue + * * @return String - value of member attribute previousValue. */ public String getPreviousValue() { @@ -413,6 +421,7 @@ public String getPreviousValue() { /** * This method sets the value to the member attribute previousValue. * You cannot set null to the attribute. + * * @param previousValue Value to set member attribute previousValue */ public void setPreviousValue(String previousValue) { @@ -421,6 +430,7 @@ public void setPreviousValue(String previousValue) { /** * Returns the value for the member attribute newValue + * * @return String - value of member attribute newValue. */ public String getNewValue() { @@ -430,6 +440,7 @@ public String getNewValue() { /** * This method sets the value to the member attribute newValue. * You cannot set null to the attribute. + * * @param newValue Value to set member attribute newValue */ public void setNewValue(String newValue) { @@ -438,6 +449,7 @@ public void setNewValue(String newValue) { /** * Returns the value for the member attribute transactionId + * * @return String - value of member attribute transactionId. */ public String getTransactionId() { @@ -447,6 +459,7 @@ public String getTransactionId() { /** * This method sets the value to the member attribute transactionId. * You cannot set null to the attribute. + * * @param transactionId Value to set member attribute transactionId */ public void setTransactionId(String transactionId) { @@ -455,6 +468,7 @@ public void setTransactionId(String transactionId) { /** * Returns the value for the member attribute action + * * @return String - value of member attribute action. */ public String getAction() { @@ -464,6 +478,7 @@ public String getAction() { /** * This method sets the value to the member attribute action. * You cannot set null to the attribute. + * * @param action Value to set member attribute action */ public void setAction(String action) { @@ -472,6 +487,7 @@ public void setAction(String action) { /** * Returns the value for the member attribute sessionId + * * @return String - value of member attribute sessionId. */ public String getSessionId() { @@ -481,6 +497,7 @@ public String getSessionId() { /** * This method sets the value to the member attribute sessionId. * You cannot set null to the attribute. + * * @param sessionId Value to set member attribute sessionId */ public void setSessionId(String sessionId) { @@ -489,6 +506,7 @@ public void setSessionId(String sessionId) { /** * Returns the value for the member attribute requestId + * * @return String - value of member attribute requestId. */ public String getRequestId() { @@ -498,6 +516,7 @@ public String getRequestId() { /** * This method sets the value to the member attribute requestId. * You cannot set null to the attribute. + * * @param requestId Value to set member attribute requestId */ public void setRequestId(String requestId) { @@ -506,6 +525,7 @@ public void setRequestId(String requestId) { /** * Returns the value for the member attribute sessionType + * * @return String - value of member attribute sessionType. */ public String getSessionType() { @@ -515,6 +535,7 @@ public String getSessionType() { /** * This method sets the value to the member attribute sessionType. * You cannot set null to the attribute. + * * @param sessionType Value to set member attribute sessionType */ public void setSessionType(String sessionType) { diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXUgsyncAuditInfo.java b/security-admin/src/main/java/org/apache/ranger/entity/XXUgsyncAuditInfo.java index 6849e6ede9..f64ee57a05 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXUgsyncAuditInfo.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXUgsyncAuditInfo.java @@ -106,6 +106,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + /** * Checks for all attributes except referenced db objects * diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXUser.java b/security-admin/src/main/java/org/apache/ranger/entity/XXUser.java index 729b486b2c..e16f1319c6 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXUser.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXUser.java @@ -44,46 +44,36 @@ public class XXUser extends XXDBBase implements java.io.Serializable { @SequenceGenerator(name = "X_USER_SEQ", sequenceName = "X_USER_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.AUTO, generator = "X_USER_SEQ") @Column(name = "ID") - protected Long id; + protected Long id; /** * Name * - * */ @Column(name = "USER_NAME", nullable = false, length = 1024) - protected String name; @Override - public void setId(Long id) { - this.id = id; - } + protected String name; /** * Description * - * */ @Column(name = "DESCR", nullable = false, length = 4000) - protected String description; @Override - public Long getId() { - return id; - } + protected String description; /** * Status * - * */ @Column(name = "STATUS", nullable = false) - protected int status = RangerConstants.STATUS_DISABLED; + protected int status = RangerConstants.STATUS_DISABLED; /** * Status * - * */ @Column(name = "IS_VISIBLE", nullable = false) protected Integer isVisible; @@ -91,7 +81,6 @@ public Long getId() { * Id of the credential store * - * */ @Column(name = "CRED_STORE_ID") protected Long credStoreId; @@ -99,18 +88,16 @@ public Long getId() { * Additional store attributes. * - * */ @Column(name = "OTHER_ATTRIBUTES") - protected String otherAttributes; + protected String otherAttributes; /** * Sync Source attribute. * - * */ @Column(name = "SYNC_SOURCE") - protected String syncSource; + protected String syncSource; /** * Default constructor. This will set all the attributes to default value. @@ -139,8 +126,67 @@ public String getMyDisplayValue() { return getDescription(); } + @Override + public Long getId() { + return id; + } + + @Override + public void setId(Long id) { + this.id = id; + } + + @Override + public int hashCode() { + return super.hashCode(); + } + + /** + * Checks for all attributes except referenced db objects + * + * @return true if all attributes match + */ + @Override + public boolean equals(Object obj) { + if (!super.equals(obj)) { + return false; + } + XXUser other = (XXUser) obj; + if ((this.name == null && other.name != null) || (this.name != null && !this.name.equals(other.name))) { + return false; + } + if ((this.description == null && other.description != null) || (this.description != null && !this.description.equals(other.description))) { + return false; + } + if (this.status != other.status) { + return false; + } + return (this.credStoreId != null || other.credStoreId == null) && (this.credStoreId == null || this.credStoreId.equals(other.credStoreId)); + } + + /** + * This return the bean content in string format + * + * @return formatedStr + */ + @Override + public String toString() { + String str = "XXUser={"; + str += super.toString(); + str += "name={" + name + "} "; + str += "description={" + description + "} "; + str += "status={" + status + "} "; + str += "isvisible={" + isVisible + "} "; + str += "credStoreId={" + credStoreId + "} "; + str += "otherAttributes={" + otherAttributes + "} "; + str += "syncSource={" + syncSource + "} "; + str += "}"; + return str; + } + /** * Returns the value for the member attribute name + * * @return String - value of member attribute name. */ public String getName() { @@ -150,6 +196,7 @@ public String getName() { /** * This method sets the value to the member attribute name. * You cannot set null to the attribute. + * * @param name Value to set member attribute name */ public void setName(String name) { @@ -158,6 +205,7 @@ public void setName(String name) { /** * Returns the value for the member attribute description + * * @return String - value of member attribute description. */ public String getDescription() { @@ -167,6 +215,7 @@ public String getDescription() { /** * This method sets the value to the member attribute description. * You cannot set null to the attribute. + * * @param description Value to set member attribute description */ public void setDescription(String description) { @@ -175,6 +224,7 @@ public void setDescription(String description) { /** * Returns the value for the member attribute status + * * @return int - value of member attribute status. */ public int getStatus() { @@ -184,6 +234,7 @@ public int getStatus() { /** * This method sets the value to the member attribute status. * You cannot set null to the attribute. + * * @param status Value to set member attribute status */ public void setStatus(int status) { @@ -192,6 +243,7 @@ public void setStatus(int status) { /** * Returns the value for the member attribute isVisible + * * @return int - value of member attribute isVisible. */ public Integer getIsVisible() { @@ -201,6 +253,7 @@ public Integer getIsVisible() { /** * This method sets the value to the member attribute isVisible. * You cannot set null to the attribute. + * * @param status Value to set member attribute isVisible */ public void setIsVisible(Integer isVisible) { @@ -209,6 +262,7 @@ public void setIsVisible(Integer isVisible) { /** * Returns the value for the member attribute credStoreId + * * @return Long - value of member attribute credStoreId. */ public Long getCredStoreId() { @@ -218,6 +272,7 @@ public Long getCredStoreId() { /** * This method sets the value to the member attribute credStoreId. * You cannot set null to the attribute. + * * @param credStoreId Value to set member attribute credStoreId */ public void setCredStoreId(Long credStoreId) { @@ -235,6 +290,7 @@ public String getOtherAttributes() { /** * This method sets JSON {@link String} representation of additional store attributes. * This method accepts null values. + * * @param otherAttributes */ public void setOtherAttributes(String otherAttributes) { @@ -245,59 +301,17 @@ public void setOtherAttributes(String otherAttributes) { * @return JSON {@link String} representation of sync source attribute if available, * null otherwise. */ - public String getSyncSource() {return syncSource;} + public String getSyncSource() { + return syncSource; + } /** * This method sets JSON {@link String} representation of sync source attribute. * This method accepts null values. + * * @param syncSource */ public void setSyncSource(String syncSource) { this.syncSource = syncSource; } - - - - /** - * This return the bean content in string format - * @return formatedStr - */ - @Override - public String toString() { - String str = "XXUser={"; - str += super.toString(); - str += "name={" + name + "} "; - str += "description={" + description + "} "; - str += "status={" + status + "} "; - str += "isvisible={" + isVisible + "} "; - str += "credStoreId={" + credStoreId + "} "; - str += "otherAttributes={" + otherAttributes + "} "; - str += "syncSource={" + syncSource + "} "; - str += "}"; - return str; - } - - /** - * Checks for all attributes except referenced db objects - * @return true if all attributes match - */ - @Override - public boolean equals(Object obj) { - if (!super.equals(obj)) { - return false; - } - XXUser other = (XXUser) obj; - if ((this.name == null && other.name != null) || (this.name != null && !this.name.equals(other.name))) { - return false; - } - if ((this.description == null && other.description != null) || (this.description != null && !this.description.equals(other.description))) { - return false; - } - if (this.status != other.status) { - return false; - } - return (this.credStoreId != null || other.credStoreId == null) && (this.credStoreId == null || this.credStoreId.equals(other.credStoreId)); - } - - } diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXUserPermission.java b/security-admin/src/main/java/org/apache/ranger/entity/XXUserPermission.java index 767d2f1639..1d56d1b69a 100644 --- a/security-admin/src/main/java/org/apache/ranger/entity/XXUserPermission.java +++ b/security-admin/src/main/java/org/apache/ranger/entity/XXUserPermission.java @@ -31,7 +31,6 @@ @Entity @Table(name = "x_user_module_perm") public class XXUserPermission extends XXDBBase implements java.io.Serializable { - private static final long serialVersionUID = 1L; @Id @@ -114,6 +113,11 @@ public void setId(Long id) { this.id = id; } + @Override + public int hashCode() { + return super.hashCode(); + } + @Override public boolean equals(Object obj) { if (this == obj) { @@ -149,13 +153,13 @@ public boolean equals(Object obj) { } if (userId == null) { return other.userId == null; - } else + } else { return userId.equals(other.userId); + } } @Override public String toString() { - String str = "VXUserPermission={"; str += super.toString(); str += "id={" + id + "} "; diff --git a/security-admin/src/main/java/org/apache/ranger/metrics/RangerAdminMetricsWrapper.java b/security-admin/src/main/java/org/apache/ranger/metrics/RangerAdminMetricsWrapper.java index 7fe5f1b7c0..f3265c1fde 100644 --- a/security-admin/src/main/java/org/apache/ranger/metrics/RangerAdminMetricsWrapper.java +++ b/security-admin/src/main/java/org/apache/ranger/metrics/RangerAdminMetricsWrapper.java @@ -41,7 +41,7 @@ @Component public class RangerAdminMetricsWrapper { - private static final Logger LOG= LoggerFactory.getLogger(RangerAdminMetricsWrapper.class); + private static final Logger LOG = LoggerFactory.getLogger(RangerAdminMetricsWrapper.class); private static final String context = "admin";