Return-Path: X-Original-To: apmail-argus-commits-archive@minotaur.apache.org Delivered-To: apmail-argus-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2C95D110C6 for ; Thu, 14 Aug 2014 20:51:04 +0000 (UTC) Received: (qmail 57090 invoked by uid 500); 14 Aug 2014 20:51:04 -0000 Delivered-To: apmail-argus-commits-archive@argus.apache.org Received: (qmail 57072 invoked by uid 500); 14 Aug 2014 20:51:04 -0000 Mailing-List: contact commits-help@argus.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@argus.incubator.apache.org Delivered-To: mailing list commits@argus.incubator.apache.org Received: (qmail 57063 invoked by uid 99); 14 Aug 2014 20:51:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Aug 2014 20:51:04 +0000 X-ASF-Spam-Status: No, hits=-2000.7 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 14 Aug 2014 20:50:38 +0000 Received: (qmail 54405 invoked by uid 99); 14 Aug 2014 20:50:13 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Aug 2014 20:50:13 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id D19A09C3C72; Thu, 14 Aug 2014 20:50:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: omalley@apache.org To: commits@argus.incubator.apache.org Date: Thu, 14 Aug 2014 20:50:37 -0000 Message-Id: In-Reply-To: <47b7a63a01074d478d3dfdfaf220eadb@git.apache.org> References: <47b7a63a01074d478d3dfdfaf220eadb@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [26/44] ARGUS-1. Initial code commit (Selvamohan Neethiraj via omalley) X-Virus-Checked: Checked by ClamAV on apache.org http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/security-admin/src/main/java/com/xasecure/entity/XXAccessAudit.java ---------------------------------------------------------------------- diff --git a/security-admin/src/main/java/com/xasecure/entity/XXAccessAudit.java b/security-admin/src/main/java/com/xasecure/entity/XXAccessAudit.java new file mode 100644 index 0000000..6557ed0 --- /dev/null +++ b/security-admin/src/main/java/com/xasecure/entity/XXAccessAudit.java @@ -0,0 +1,630 @@ +package com.xasecure.entity; +/* + * Copyright (c) 2014 XASecure + * All rights reserved. + * + * This software is the confidential and proprietary information of + * XASecure ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with XASecure + */ + +/** + * Access Audit + * + */ + +import java.util.*; +import javax.persistence.*; +import javax.xml.bind.annotation.*; +import com.xasecure.common.*; +import com.xasecure.entity.*; + + +@Entity +@Table(name="xa_access_audit") +@XmlRootElement +public class XXAccessAudit extends XXDBBase implements java.io.Serializable { + private static final long serialVersionUID = 1L; + + + + /** + * Repository Type + *
    + *
  • This attribute is of type enum CommonEnums::AssetType + *
+ * + */ + @Column(name="AUDIT_TYPE" , nullable=false ) + protected int auditType = AppConstants.ASSET_UNKNOWN; + + /** + * Access Result + *
    + *
  • This attribute is of type enum CommonEnums::AccessResult + *
+ * + */ + @Column(name="ACCESS_RESULT" ) + protected int accessResult = XAConstants.ACCESS_RESULT_DENIED; + + /** + * Access Type + *
    + *
  • The maximum length for this attribute is 255. + *
+ * + */ + @Column(name="ACCESS_TYPE" , length=255) + protected String accessType; + + /** + * Acl Enforcer + *
    + *
  • The maximum length for this attribute is 255. + *
+ * + */ + @Column(name="ACL_ENFORCER" , length=255) + protected String aclEnforcer; + + /** + * Agent Id + *
    + *
  • The maximum length for this attribute is 255. + *
+ * + */ + @Column(name="AGENT_ID" , length=255) + protected String agentId; + + /** + * Client Ip + *
    + *
  • The maximum length for this attribute is 255. + *
+ * + */ + @Column(name="CLIENT_IP" , length=255) + protected String clientIP; + + /** + * Client Type + *
    + *
  • The maximum length for this attribute is 255. + *
+ * + */ + @Column(name="CLIENT_TYPE" , length=255) + protected String clientType; + + /** + * Policy Id + *
    + *
+ * + */ + @Column(name="POLICY_ID" ) + protected long policyId; + + /** + * Repository Name + *
    + *
  • The maximum length for this attribute is 255. + *
+ * + */ + @Column(name="REPO_NAME" , length=255) + protected String repoName; + + /** + * Repository Type + *
    + *
+ * + */ + @Column(name="REPO_TYPE" ) + protected int repoType; + + /** + * Reason of result + *
    + *
  • The maximum length for this attribute is 255. + *
+ * + */ + @Column(name="RESULT_REASON" , length=255) + protected String resultReason; + + /** + * Session Id + *
    + *
  • The maximum length for this attribute is 255. + *
+ * + */ + @Column(name="SESSION_ID" , length=255) + protected String sessionId; + + /** + * Event Time + *
    + *
+ * + */ + @Temporal(TemporalType.TIMESTAMP) + @Column(name="EVENT_TIME" ) + protected Date eventTime = DateUtil.getUTCDate(); + + /** + * Requesting User + *
    + *
  • The maximum length for this attribute is 255. + *
+ * + */ + @Column(name="REQUEST_USER" , length=255) + protected String requestUser; + + /** + * Action + *
    + *
  • The maximum length for this attribute is 2000. + *
+ * + */ + @Column(name="ACTION" , length=2000) + protected String action; + + /** + * Requesting Data + *
    + *
  • The maximum length for this attribute is 2000. + *
+ * + */ + @Column(name="REQUEST_DATA" , length=2000) + protected String requestData; + + /** + * Resource Path + *
    + *
  • The maximum length for this attribute is 2000. + *
+ * + */ + @Column(name="RESOURCE_PATH" , length=2000) + protected String resourcePath; + + /** + * Resource Type + *
    + *
  • The maximum length for this attribute is 255. + *
+ * + */ + @Column(name="RESOURCE_TYPE" , length=255) + protected String resourceType; + + /** + * Default constructor. This will set all the attributes to default value. + */ + public XXAccessAudit ( ) { + auditType = AppConstants.ASSET_UNKNOWN; + accessResult = XAConstants.ACCESS_RESULT_DENIED; + } + + @Override + public int getMyClassType( ) { + return AppConstants.CLASS_TYPE_XA_ACCESS_AUDIT; + } + + /** + * 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 ) { + this.auditType = auditType; + } + + /** + * Returns the value for the member attribute auditType + * @return int - value of member attribute auditType. + */ + public int getAuditType( ) { + return this.auditType; + } + + /** + * 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 ) { + this.accessResult = accessResult; + } + + /** + * Returns the value for the member attribute accessResult + * @return int - value of member attribute accessResult. + */ + public int getAccessResult( ) { + return this.accessResult; + } + + /** + * 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 ) { + this.accessType = accessType; + } + + /** + * Returns the value for the member attribute accessType + * @return String - value of member attribute accessType. + */ + public String getAccessType( ) { + return this.accessType; + } + + /** + * 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 ) { + this.aclEnforcer = aclEnforcer; + } + + /** + * Returns the value for the member attribute aclEnforcer + * @return String - value of member attribute aclEnforcer. + */ + public String getAclEnforcer( ) { + return this.aclEnforcer; + } + + /** + * 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 ) { + this.agentId = agentId; + } + + /** + * Returns the value for the member attribute agentId + * @return String - value of member attribute agentId. + */ + public String getAgentId( ) { + return this.agentId; + } + + /** + * 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 ) { + this.clientIP = clientIP; + } + + /** + * Returns the value for the member attribute clientIP + * @return String - value of member attribute clientIP. + */ + public String getClientIP( ) { + return this.clientIP; + } + + /** + * 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 ) { + this.clientType = clientType; + } + + /** + * Returns the value for the member attribute clientType + * @return String - value of member attribute clientType. + */ + public String getClientType( ) { + return this.clientType; + } + + /** + * 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 ) { + this.policyId = policyId; + } + + /** + * Returns the value for the member attribute policyId + * @return long - value of member attribute policyId. + */ + public long getPolicyId( ) { + return this.policyId; + } + + /** + * 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 ) { + this.repoName = repoName; + } + + /** + * Returns the value for the member attribute repoName + * @return String - value of member attribute repoName. + */ + public String getRepoName( ) { + return this.repoName; + } + + /** + * 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 ) { + this.repoType = repoType; + } + + /** + * Returns the value for the member attribute repoType + * @return int - value of member attribute repoType. + */ + public int getRepoType( ) { + return this.repoType; + } + + /** + * 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 ) { + this.resultReason = resultReason; + } + + /** + * Returns the value for the member attribute resultReason + * @return String - value of member attribute resultReason. + */ + public String getResultReason( ) { + return this.resultReason; + } + + /** + * 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 ) { + this.sessionId = sessionId; + } + + /** + * Returns the value for the member attribute sessionId + * @return String - value of member attribute sessionId. + */ + public String getSessionId( ) { + return this.sessionId; + } + + /** + * 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 ) { + this.eventTime = eventTime; + } + + /** + * Returns the value for the member attribute eventTime + * @return Date - value of member attribute eventTime. + */ + public Date getEventTime( ) { + return this.eventTime; + } + + /** + * 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 ) { + this.requestUser = requestUser; + } + + /** + * Returns the value for the member attribute requestUser + * @return String - value of member attribute requestUser. + */ + public String getRequestUser( ) { + return this.requestUser; + } + + /** + * 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 ) { + this.action = action; + } + + /** + * Returns the value for the member attribute action + * @return String - value of member attribute action. + */ + public String getAction( ) { + return this.action; + } + + /** + * 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 ) { + this.requestData = requestData; + } + + /** + * Returns the value for the member attribute requestData + * @return String - value of member attribute requestData. + */ + public String getRequestData( ) { + return this.requestData; + } + + /** + * 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 ) { + this.resourcePath = resourcePath; + } + + /** + * Returns the value for the member attribute resourcePath + * @return String - value of member attribute resourcePath. + */ + public String getResourcePath( ) { + return this.resourcePath; + } + + /** + * 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 ) { + this.resourceType = resourceType; + } + + /** + * Returns the value for the member attribute resourceType + * @return String - value of member attribute resourceType. + */ + public String getResourceType( ) { + return this.resourceType; + } + + /** + * This return the bean content in string format + * @return formatedStr + */ + @Override + public String toString( ) { + String str = "XXAccessAudit={"; + str += super.toString(); + str += "auditType={" + auditType + "} "; + str += "accessResult={" + accessResult + "} "; + str += "accessType={" + accessType + "} "; + str += "aclEnforcer={" + aclEnforcer + "} "; + str += "agentId={" + agentId + "} "; + str += "clientIP={" + clientIP + "} "; + str += "clientType={" + clientType + "} "; + str += "policyId={" + policyId + "} "; + str += "repoName={" + repoName + "} "; + str += "repoType={" + repoType + "} "; + str += "resultReason={" + resultReason + "} "; + str += "sessionId={" + sessionId + "} "; + str += "eventTime={" + eventTime + "} "; + str += "requestUser={" + requestUser + "} "; + str += "action={" + action + "} "; + str += "requestData={" + requestData + "} "; + str += "resourcePath={" + resourcePath + "} "; + str += "resourceType={" + resourceType + "} "; + 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; + } + XXAccessAudit other = (XXAccessAudit) obj; + if( this.auditType != other.auditType ) return false; + if( this.accessResult != other.accessResult ) return false; + if ((this.accessType == null && other.accessType != null) || (this.accessType != null && !this.accessType.equals(other.accessType))) { + return false; + } + if ((this.aclEnforcer == null && other.aclEnforcer != null) || (this.aclEnforcer != null && !this.aclEnforcer.equals(other.aclEnforcer))) { + return false; + } + if ((this.agentId == null && other.agentId != null) || (this.agentId != null && !this.agentId.equals(other.agentId))) { + return false; + } + if ((this.clientIP == null && other.clientIP != null) || (this.clientIP != null && !this.clientIP.equals(other.clientIP))) { + return false; + } + if ((this.clientType == null && other.clientType != null) || (this.clientType != null && !this.clientType.equals(other.clientType))) { + return false; + } + if( this.policyId != other.policyId ) return false; + if ((this.repoName == null && other.repoName != null) || (this.repoName != null && !this.repoName.equals(other.repoName))) { + return false; + } + if( this.repoType != other.repoType ) return false; + if ((this.resultReason == null && other.resultReason != null) || (this.resultReason != null && !this.resultReason.equals(other.resultReason))) { + return false; + } + if ((this.sessionId == null && other.sessionId != null) || (this.sessionId != null && !this.sessionId.equals(other.sessionId))) { + return false; + } + if ((this.eventTime == null && other.eventTime != null) || (this.eventTime != null && !this.eventTime.equals(other.eventTime))) { + return false; + } + if ((this.requestUser == null && other.requestUser != null) || (this.requestUser != null && !this.requestUser.equals(other.requestUser))) { + return false; + } + if ((this.action == null && other.action != null) || (this.action != null && !this.action.equals(other.action))) { + return false; + } + if ((this.requestData == null && other.requestData != null) || (this.requestData != null && !this.requestData.equals(other.requestData))) { + return false; + } + if ((this.resourcePath == null && other.resourcePath != null) || (this.resourcePath != null && !this.resourcePath.equals(other.resourcePath))) { + return false; + } + if ((this.resourceType == null && other.resourceType != null) || (this.resourceType != null && !this.resourceType.equals(other.resourceType))) { + return false; + } + return true; + } + public static String getEnumName(String fieldName ) { + if( fieldName.equals("auditType") ) { + return "CommonEnums.AssetType"; + } + if( fieldName.equals("accessResult") ) { + return "CommonEnums.AccessResult"; + } + //Later TODO + //return super.getEnumName(fieldName); + return null; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/security-admin/src/main/java/com/xasecure/entity/XXAsset.java ---------------------------------------------------------------------- diff --git a/security-admin/src/main/java/com/xasecure/entity/XXAsset.java b/security-admin/src/main/java/com/xasecure/entity/XXAsset.java new file mode 100644 index 0000000..827e84d --- /dev/null +++ b/security-admin/src/main/java/com/xasecure/entity/XXAsset.java @@ -0,0 +1,266 @@ +package com.xasecure.entity; +/* + * Copyright (c) 2014 XASecure + * All rights reserved. + * + * This software is the confidential and proprietary information of + * XASecure ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with XASecure + */ + +/** + * Asset + * + */ + +import java.util.*; +import javax.persistence.*; +import javax.xml.bind.annotation.*; +import com.xasecure.common.*; +import com.xasecure.entity.*; + + +@Entity +@Table(name="x_asset") +@XmlRootElement +public class XXAsset extends XXDBBase implements java.io.Serializable { + private static final long serialVersionUID = 1L; + + + + /** + * Name + *
    + *
  • The maximum length for this attribute is 1024. + *
+ * + */ + @Column(name="ASSET_NAME" , nullable=false , length=1024) + protected String name; + + /** + * Description + *
    + *
  • The maximum length for this attribute is 4000. + *
+ * + */ + @Column(name="DESCR" , nullable=false , length=4000) + protected String description; + + /** + * Status + *
    + *
  • This attribute is of type enum CommonEnums::ActiveStatus + *
+ * + */ + @Column(name="ACT_STATUS" , nullable=false ) + protected int activeStatus = XAConstants.STATUS_DISABLED; + + /** + * Type of asset + *
    + *
  • This attribute is of type enum CommonEnums::AssetType + *
+ * + */ + @Column(name="ASSET_TYPE" , nullable=false ) + protected int assetType = AppConstants.ASSET_UNKNOWN; + + /** + * Config in json format + *
    + *
  • The maximum length for this attribute is 10000. + *
+ * + */ + @Column(name="CONFIG" , length=10000) + protected String config; + + /** + * Support native authorization + *
    + *
+ * + */ + @Column(name="SUP_NATIVE" , nullable=false ) + protected boolean supportNative = false; + + /** + * Default constructor. This will set all the attributes to default value. + */ + public XXAsset ( ) { + activeStatus = XAConstants.STATUS_DISABLED; + assetType = AppConstants.ASSET_UNKNOWN; + } + + @Override + public int getMyClassType( ) { + return AppConstants.CLASS_TYPE_XA_ASSET; + } + + @Override + public String getMyDisplayValue() { + return getDescription( ); + } + + /** + * 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 ) { + this.name = name; + } + + /** + * Returns the value for the member attribute name + * @return String - value of member attribute name. + */ + public String getName( ) { + return this.name; + } + + /** + * 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 ) { + this.description = description; + } + + /** + * Returns the value for the member attribute description + * @return String - value of member attribute description. + */ + public String getDescription( ) { + return this.description; + } + + /** + * 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 ) { + this.activeStatus = activeStatus; + } + + /** + * Returns the value for the member attribute activeStatus + * @return int - value of member attribute activeStatus. + */ + public int getActiveStatus( ) { + return this.activeStatus; + } + + /** + * 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 ) { + this.assetType = assetType; + } + + /** + * Returns the value for the member attribute assetType + * @return int - value of member attribute assetType. + */ + public int getAssetType( ) { + return this.assetType; + } + + /** + * 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 ) { + this.config = config; + } + + /** + * Returns the value for the member attribute config + * @return String - value of member attribute config. + */ + public String getConfig( ) { + return this.config; + } + + /** + * 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; + } + + /** + * Returns the value for the member attribute supportNative + * @return boolean - value of member attribute supportNative. + */ + public boolean isSupportNative( ) { + return this.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; + } + if( this.supportNative != other.supportNative ) return false; + return true; + } + public static String getEnumName(String fieldName ) { + if( fieldName.equals("activeStatus") ) { + return "CommonEnums.ActiveStatus"; + } + if( fieldName.equals("assetType") ) { + return "CommonEnums.AssetType"; + } + //Later TODO + //return super.getEnumName(fieldName); + return null; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/security-admin/src/main/java/com/xasecure/entity/XXAuditMap.java ---------------------------------------------------------------------- diff --git a/security-admin/src/main/java/com/xasecure/entity/XXAuditMap.java b/security-admin/src/main/java/com/xasecure/entity/XXAuditMap.java new file mode 100644 index 0000000..97c4bd1 --- /dev/null +++ b/security-admin/src/main/java/com/xasecure/entity/XXAuditMap.java @@ -0,0 +1,203 @@ +package com.xasecure.entity; +/* + * Copyright (c) 2014 XASecure + * All rights reserved. + * + * This software is the confidential and proprietary information of + * XASecure ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with XASecure + */ + +/** + * Audi map + * + */ + +import java.util.*; +import javax.persistence.*; +import javax.xml.bind.annotation.*; +import com.xasecure.common.*; +import com.xasecure.entity.*; + + +@Entity +@Table(name="x_audit_map") +@XmlRootElement +public class XXAuditMap extends XXDBBase implements java.io.Serializable { + private static final long serialVersionUID = 1L; + + + + /** + * Id of the resource + *
    + *
+ * + */ + @Column(name="RES_ID" ) + protected Long resourceId; + + + /** + * Id of the group + *
    + *
+ * + */ + @Column(name="GROUP_ID" ) + protected Long groupId; + + + /** + * Id of the user + *
    + *
+ * + */ + @Column(name="USER_ID" ) + protected Long userId; + + + /** + * Type of audit + *
    + *
  • This attribute is of type enum CommonEnums::XAAuditType + *
+ * + */ + @Column(name="AUDIT_TYPE" , nullable=false ) + protected int auditType = AppConstants.XA_AUDIT_TYPE_UNKNOWN; + + /** + * Default constructor. This will set all the attributes to default value. + */ + public XXAuditMap ( ) { + auditType = AppConstants.XA_AUDIT_TYPE_UNKNOWN; + } + + @Override + public int getMyClassType( ) { + return AppConstants.CLASS_TYPE_XA_AUDIT_MAP; + } + + /** + * 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 ) { + this.resourceId = resourceId; + } + + /** + * Returns the value for the member attribute resourceId + * @return Long - value of member attribute resourceId. + */ + public Long getResourceId( ) { + return this.resourceId; + } + + + /** + * 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 ) { + this.groupId = groupId; + } + + /** + * Returns the value for the member attribute groupId + * @return Long - value of member attribute groupId. + */ + public Long getGroupId( ) { + return this.groupId; + } + + + /** + * 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 ) { + this.userId = userId; + } + + /** + * Returns the value for the member attribute userId + * @return Long - value of member attribute userId. + */ + public Long getUserId( ) { + return this.userId; + } + + + /** + * 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 ) { + this.auditType = auditType; + } + + /** + * Returns the value for the member attribute auditType + * @return int - value of member attribute auditType. + */ + public int getAuditType( ) { + return this.auditType; + } + + /** + * This return the bean content in string format + * @return formatedStr + */ + @Override + public String toString( ) { + String str = "XXAuditMap={"; + str += super.toString(); + str += "resourceId={" + resourceId + "} "; + str += "groupId={" + groupId + "} "; + str += "userId={" + userId + "} "; + str += "auditType={" + auditType + "} "; + 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; + } + XXAuditMap other = (XXAuditMap) obj; + if ((this.resourceId == null && other.resourceId != null) || (this.resourceId != null && !this.resourceId.equals(other.resourceId))) { + return false; + } + if ((this.groupId == null && other.groupId != null) || (this.groupId != null && !this.groupId.equals(other.groupId))) { + return false; + } + if ((this.userId == null && other.userId != null) || (this.userId != null && !this.userId.equals(other.userId))) { + return false; + } + if( this.auditType != other.auditType ) return false; + return true; + } + public static String getEnumName(String fieldName ) { + if( fieldName.equals("auditType") ) { + return "CommonEnums.XAAuditType"; + } + //Later TODO + //return super.getEnumName(fieldName); + return null; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/security-admin/src/main/java/com/xasecure/entity/XXAuthSession.java ---------------------------------------------------------------------- diff --git a/security-admin/src/main/java/com/xasecure/entity/XXAuthSession.java b/security-admin/src/main/java/com/xasecure/entity/XXAuthSession.java new file mode 100644 index 0000000..45d23ce --- /dev/null +++ b/security-admin/src/main/java/com/xasecure/entity/XXAuthSession.java @@ -0,0 +1,447 @@ +package com.xasecure.entity; +/* + * Copyright (c) 2014 XASecure + * All rights reserved. + * + * This software is the confidential and proprietary information of + * XASecure ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with XASecure + */ + +/** + * Authentication session + * + */ + +import java.util.*; +import javax.persistence.*; +import javax.xml.bind.annotation.*; +import com.xasecure.common.*; +import com.xasecure.entity.*; + + +@Entity +@Table(name="x_auth_sess") +@XmlRootElement +public class XXAuthSession extends XXDBBase implements java.io.Serializable { + private static final long serialVersionUID = 1L; + + /** + * Enum values for AuthStatus + */ + /** + * AUTH_STATUS_UNKNOWN is an element of enum AuthStatus. Its value is "AUTH_STATUS_UNKNOWN". + */ + public static final int AUTH_STATUS_UNKNOWN = 0; + /** + * AUTH_STATUS_SUCCESS is an element of enum AuthStatus. Its value is "AUTH_STATUS_SUCCESS". + */ + public static final int AUTH_STATUS_SUCCESS = 1; + /** + * AUTH_STATUS_WRONG_PASSWORD is an element of enum AuthStatus. Its value is "AUTH_STATUS_WRONG_PASSWORD". + */ + public static final int AUTH_STATUS_WRONG_PASSWORD = 2; + /** + * AUTH_STATUS_DISABLED is an element of enum AuthStatus. Its value is "AUTH_STATUS_DISABLED". + */ + public static final int AUTH_STATUS_DISABLED = 3; + /** + * AUTH_STATUS_LOCKED is an element of enum AuthStatus. Its value is "AUTH_STATUS_LOCKED". + */ + public static final int AUTH_STATUS_LOCKED = 4; + /** + * AUTH_STATUS_PASSWORD_EXPIRED is an element of enum AuthStatus. Its value is "AUTH_STATUS_PASSWORD_EXPIRED". + */ + public static final int AUTH_STATUS_PASSWORD_EXPIRED = 5; + /** + * AUTH_STATUS_USER_NOT_FOUND is an element of enum AuthStatus. Its value is "AUTH_STATUS_USER_NOT_FOUND". + */ + public static final int AUTH_STATUS_USER_NOT_FOUND = 6; + + /** + * Max value for enum AuthStatus_MAX + */ + public static final int AuthStatus_MAX = 6; + + /** + * Enum values for AuthType + */ + /** + * AUTH_TYPE_UNKNOWN is an element of enum AuthType. Its value is "AUTH_TYPE_UNKNOWN". + */ + 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; + + /** + * Max value for enum AuthType_MAX + */ + public static final int AuthType_MAX = 1; + + + + /** + * Login ID of the user + *
    + *
  • The maximum length for this attribute is 767. + *
+ * + */ + @Column(name="LOGIN_ID" , nullable=false , length=767) + protected String loginId; + + /** + * Id of the user + *
    + *
+ * + */ + @Column(name="USER_ID" ) + protected Long userId; + + + /** + * External session id. Currently spring/http session + *
    + *
  • The maximum length for this attribute is 512. + *
+ * + */ + @Column(name="EXT_SESS_ID" , length=512) + protected String extSessionId; + + /** + * Date and time of authentication + *
    + *
+ * + */ + @Temporal(TemporalType.TIMESTAMP) + @Column(name="AUTH_TIME" , nullable=false ) + protected Date authTime = DateUtil.getUTCDate(); + + /** + * Authentication status + *
    + *
  • This attribute is of type enum XXAuthSession::AuthStatus + *
+ * + */ + @Column(name="AUTH_STATUS" , nullable=false ) + protected int authStatus = AUTH_STATUS_UNKNOWN; + + /** + * Authentication type + *
    + *
  • This attribute is of type enum XXAuthSession::AuthType + *
+ * + */ + @Column(name="AUTH_TYPE" , nullable=false ) + protected int authType = AUTH_TYPE_UNKNOWN; + + /** + * Authentication provider + *
    + *
  • This attribute is of type enum XXAuthSession::AuthType + *
+ * + */ + @Column(name="AUTH_PROVIDER" , nullable=false ) + protected int authProvider = AUTH_TYPE_UNKNOWN; + + /** + * Type of the device + *
    + *
  • This attribute is of type enum CommonEnums::DeviceType + *
+ * + */ + @Column(name="DEVICE_TYPE" , nullable=false ) + protected int deviceType = XAConstants.DEVICE_UNKNOWN; + + /** + * IP where the request came from + *
    + *
  • The maximum length for this attribute is 48. + *
+ * + */ + @Column(name="REQ_IP" , nullable=false , length=48) + protected String requestIP; + + /** + * UserAgent of the requesting device + *
    + *
  • The maximum length for this attribute is 1024. + *
+ * + */ + @Column(name="REQ_UA" , length=1024) + protected String requestUserAgent; + + /** + * Default constructor. This will set all the attributes to default value. + */ + public XXAuthSession ( ) { + authStatus = AUTH_STATUS_UNKNOWN; + authType = AUTH_TYPE_UNKNOWN; + authProvider = AUTH_TYPE_UNKNOWN; + deviceType = XAConstants.DEVICE_UNKNOWN; + } + + @Override + public int getMyClassType( ) { + return AppConstants.CLASS_TYPE_AUTH_SESS; + } + + /** + * 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 ) { + this.loginId = loginId; + } + + /** + * Returns the value for the member attribute loginId + * @return String - value of member attribute loginId. + */ + public String getLoginId( ) { + return this.loginId; + } + + /** + * 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 ) { + this.userId = userId; + } + + /** + * Returns the value for the member attribute userId + * @return Long - value of member attribute userId. + */ + public Long getUserId( ) { + return this.userId; + } + + + /** + * 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 ) { + this.extSessionId = extSessionId; + } + + /** + * Returns the value for the member attribute extSessionId + * @return String - value of member attribute extSessionId. + */ + public String getExtSessionId( ) { + return this.extSessionId; + } + + /** + * 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 ) { + this.authTime = authTime; + } + + /** + * Returns the value for the member attribute authTime + * @return Date - value of member attribute authTime. + */ + public Date getAuthTime( ) { + return this.authTime; + } + + /** + * 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 ) { + this.authStatus = authStatus; + } + + /** + * Returns the value for the member attribute authStatus + * @return int - value of member attribute authStatus. + */ + public int getAuthStatus( ) { + return this.authStatus; + } + + /** + * 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 ) { + this.authType = authType; + } + + /** + * Returns the value for the member attribute authType + * @return int - value of member attribute authType. + */ + public int getAuthType( ) { + return this.authType; + } + + /** + * 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 ) { + this.authProvider = authProvider; + } + + /** + * Returns the value for the member attribute authProvider + * @return int - value of member attribute authProvider. + */ + public int getAuthProvider( ) { + return this.authProvider; + } + + /** + * 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 ) { + this.deviceType = deviceType; + } + + /** + * Returns the value for the member attribute deviceType + * @return int - value of member attribute deviceType. + */ + public int getDeviceType( ) { + return this.deviceType; + } + + /** + * 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 ) { + this.requestIP = requestIP; + } + + /** + * Returns the value for the member attribute requestIP + * @return String - value of member attribute requestIP. + */ + public String getRequestIP( ) { + return this.requestIP; + } + + /** + * 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 ) { + this.requestUserAgent = requestUserAgent; + } + + /** + * Returns the value for the member attribute requestUserAgent + * @return String - value of member attribute requestUserAgent. + */ + public String getRequestUserAgent( ) { + return this.requestUserAgent; + } + + /** + * This return the bean content in string format + * @return formatedStr + */ + @Override + public String toString( ) { + String str = "XXAuthSession={"; + str += super.toString(); + str += "loginId={" + loginId + "} "; + str += "userId={" + userId + "} "; + str += "extSessionId={" + extSessionId + "} "; + str += "authTime={" + authTime + "} "; + str += "authStatus={" + authStatus + "} "; + str += "authType={" + authType + "} "; + str += "authProvider={" + authProvider + "} "; + str += "deviceType={" + deviceType + "} "; + str += "requestIP={" + requestIP + "} "; + str += "requestUserAgent={" + requestUserAgent + "} "; + 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; + } + XXAuthSession other = (XXAuthSession) obj; + if ((this.loginId == null && other.loginId != null) || (this.loginId != null && !this.loginId.equals(other.loginId))) { + return false; + } + if ((this.userId == null && other.userId != null) || (this.userId != null && !this.userId.equals(other.userId))) { + return false; + } + if ((this.extSessionId == null && other.extSessionId != null) || (this.extSessionId != null && !this.extSessionId.equals(other.extSessionId))) { + return false; + } + if ((this.authTime == null && other.authTime != null) || (this.authTime != null && !this.authTime.equals(other.authTime))) { + return false; + } + if( this.authStatus != other.authStatus ) return false; + if( this.authType != other.authType ) return false; + if( this.authProvider != other.authProvider ) return false; + if( this.deviceType != other.deviceType ) return false; + if ((this.requestIP == null && other.requestIP != null) || (this.requestIP != null && !this.requestIP.equals(other.requestIP))) { + return false; + } + if ((this.requestUserAgent == null && other.requestUserAgent != null) || (this.requestUserAgent != null && !this.requestUserAgent.equals(other.requestUserAgent))) { + return false; + } + return true; + } + public static String getEnumName(String fieldName ) { + if( fieldName.equals("authStatus") ) { + return "CommonEnums.AuthStatus"; + } + if( fieldName.equals("authType") ) { + return "CommonEnums.AuthType"; + } + if( fieldName.equals("authProvider") ) { + return "CommonEnums.AuthType"; + } + if( fieldName.equals("deviceType") ) { + return "CommonEnums.DeviceType"; + } + //Later TODO + //return super.getEnumName(fieldName); + return null; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/security-admin/src/main/java/com/xasecure/entity/XXCredentialStore.java ---------------------------------------------------------------------- diff --git a/security-admin/src/main/java/com/xasecure/entity/XXCredentialStore.java b/security-admin/src/main/java/com/xasecure/entity/XXCredentialStore.java new file mode 100644 index 0000000..8ac8085 --- /dev/null +++ b/security-admin/src/main/java/com/xasecure/entity/XXCredentialStore.java @@ -0,0 +1,141 @@ +package com.xasecure.entity; +/* + * Copyright (c) 2014 XASecure + * All rights reserved. + * + * This software is the confidential and proprietary information of + * XASecure ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with XASecure + */ + +/** + * Credential Store + * + */ + +import java.util.*; +import javax.persistence.*; +import javax.xml.bind.annotation.*; +import com.xasecure.common.*; +import com.xasecure.entity.*; + + +@Entity +@Table(name="x_cred_store") +@XmlRootElement +public class XXCredentialStore extends XXDBBase implements java.io.Serializable { + private static final long serialVersionUID = 1L; + + + + /** + * Name + *
    + *
  • The maximum length for this attribute is 1024. + *
+ * + */ + @Column(name="STORE_NAME" , nullable=false , length=1024) + protected String name; + + /** + * Description + *
    + *
  • The maximum length for this attribute is 4000. + *
+ * + */ + @Column(name="DESCR" , nullable=false , length=4000) + protected String description; + + /** + * Default constructor. This will set all the attributes to default value. + */ + public XXCredentialStore ( ) { + } + + @Override + public int getMyClassType( ) { + return AppConstants.CLASS_TYPE_XA_CRED_STORE; + } + + @Override + public String getMyDisplayValue() { + return getDescription( ); + } + + /** + * 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 ) { + this.name = name; + } + + /** + * Returns the value for the member attribute name + * @return String - value of member attribute name. + */ + public String getName( ) { + return this.name; + } + + /** + * 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 ) { + this.description = description; + } + + /** + * Returns the value for the member attribute description + * @return String - value of member attribute description. + */ + public String getDescription( ) { + return this.description; + } + + /** + * This return the bean content in string format + * @return formatedStr + */ + @Override + public String toString( ) { + String str = "XXCredentialStore={"; + str += super.toString(); + str += "name={" + name + "} "; + str += "description={" + description + "} "; + 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; + } + XXCredentialStore other = (XXCredentialStore) 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; + } + return true; + } + public static String getEnumName(String fieldName ) { + //Later TODO + //return super.getEnumName(fieldName); + return null; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/security-admin/src/main/java/com/xasecure/entity/XXDBBase.java ---------------------------------------------------------------------- diff --git a/security-admin/src/main/java/com/xasecure/entity/XXDBBase.java b/security-admin/src/main/java/com/xasecure/entity/XXDBBase.java new file mode 100644 index 0000000..1bf1eb9 --- /dev/null +++ b/security-admin/src/main/java/com/xasecure/entity/XXDBBase.java @@ -0,0 +1,231 @@ +package com.xasecure.entity; +/* + * Copyright (c) 2014 XASecure + * All rights reserved. + * + * This software is the confidential and proprietary information of + * XASecure ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with XASecure + */ + +/** + * Base JPA class with id, versionNumber and other common attributes + * + */ + +import java.util.*; +import javax.persistence.*; +import javax.xml.bind.annotation.*; +import com.xasecure.common.*; +import com.xasecure.entity.*; + + +@MappedSuperclass @EntityListeners( com.xasecure.common.db.JPABeanCallbacks.class) +@XmlRootElement +public class XXDBBase extends Object implements java.io.Serializable { + private static final long serialVersionUID = 1L; + + + + /** + * Id for the object + *
    + *
  • This attribute is the Primary Key for this class
    . + *
+ * + */ + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + @Column(name="ID" ) + protected Long id; + + /** + * Date/Time creation of this user. + *
    + *
+ * + */ + @Temporal(TemporalType.TIMESTAMP) + @Column(name="CREATE_TIME" ) + protected Date createTime = DateUtil.getUTCDate(); + + /** + * Date value. + *
    + *
+ * + */ + @Temporal(TemporalType.TIMESTAMP) + @Column(name="UPDATE_TIME" ) + protected Date updateTime = DateUtil.getUTCDate(); + + /** + * Added by + *
    + *
+ * + */ + @Column(name="ADDED_BY_ID" ) + protected Long addedByUserId; + + + /** + * Last updated by + *
    + *
+ * + */ + @Column(name="UPD_BY_ID" ) + protected Long updatedByUserId; + + + /** + * Default constructor. This will set all the attributes to default value. + */ + public XXDBBase ( ) { + } + + public int getMyClassType( ) { + return AppConstants.CLASS_TYPE_NONE; + } + + public String getMyDisplayValue() { + return null; + } + + /** + * 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 void setId( Long id ) { + this.id = id; + } + + /** + * Returns the value for the member attribute id + * @return Long - value of member attribute id. + */ + public Long getId( ) { + return this.id; + } + + /** + * 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 ) { + this.createTime = createTime; + } + + /** + * Returns the value for the member attribute createTime + * @return Date - value of member attribute createTime. + */ + public Date getCreateTime( ) { + return this.createTime; + } + + /** + * 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 ) { + this.updateTime = updateTime; + } + + /** + * Returns the value for the member attribute updateTime + * @return Date - value of member attribute updateTime. + */ + public Date getUpdateTime( ) { + return this.updateTime; + } + + /** + * 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 ) { + this.addedByUserId = addedByUserId; + } + + /** + * Returns the value for the member attribute addedByUserId + * @return Long - value of member attribute addedByUserId. + */ + public Long getAddedByUserId( ) { + return this.addedByUserId; + } + + + /** + * 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 ) { + this.updatedByUserId = updatedByUserId; + } + + /** + * Returns the value for the member attribute updatedByUserId + * @return Long - value of member attribute updatedByUserId. + */ + public Long getUpdatedByUserId( ) { + return this.updatedByUserId; + } + + + /** + * This return the bean content in string format + * @return formatedStr + */ + @Override + public String toString( ) { + String str = "XXDBBase={"; + str += "id={" + id + "} "; + str += "createTime={" + createTime + "} "; + str += "updateTime={" + updateTime + "} "; + str += "addedByUserId={" + addedByUserId + "} "; + str += "updatedByUserId={" + updatedByUserId + "} "; + str += "}"; + return str; + } + + /** + * 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; + } + if ((this.updateTime == null && other.updateTime != null) || (this.updateTime != null && !this.updateTime.equals(other.updateTime))) { + return false; + } + if ((this.addedByUserId == null && other.addedByUserId != null) || (this.addedByUserId != null && !this.addedByUserId.equals(other.addedByUserId))) { + return false; + } + if ((this.updatedByUserId == null && other.updatedByUserId != null) || (this.updatedByUserId != null && !this.updatedByUserId.equals(other.updatedByUserId))) { + return false; + } + return true; + } + public static String getEnumName(String fieldName ) { + //Later TODO + //return super.getEnumName(fieldName); + return null; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/security-admin/src/main/java/com/xasecure/entity/XXGroup.java ---------------------------------------------------------------------- diff --git a/security-admin/src/main/java/com/xasecure/entity/XXGroup.java b/security-admin/src/main/java/com/xasecure/entity/XXGroup.java new file mode 100644 index 0000000..3dd7f37 --- /dev/null +++ b/security-admin/src/main/java/com/xasecure/entity/XXGroup.java @@ -0,0 +1,253 @@ +package com.xasecure.entity; +/* + * Copyright (c) 2014 XASecure + * All rights reserved. + * + * This software is the confidential and proprietary information of + * XASecure ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with XASecure + */ + +/** + * Group + * + */ + +import java.util.*; +import javax.persistence.*; +import javax.xml.bind.annotation.*; +import com.xasecure.common.*; +import com.xasecure.entity.*; + + +@Entity +@Table(name="x_group") +@XmlRootElement +public class XXGroup extends XXDBBase implements java.io.Serializable { + private static final long serialVersionUID = 1L; + + + + /** + * Name + *
    + *
  • The maximum length for this attribute is 1024. + *
+ * + */ + @Column(name="GROUP_NAME" , nullable=false , length=1024) + protected String name; + + /** + * Description + *
    + *
  • The maximum length for this attribute is 4000. + *
+ * + */ + @Column(name="DESCR" , nullable=false , length=4000) + protected String description; + + /** + * Status + *
    + *
  • This attribute is of type enum CommonEnums::ActiveStatus + *
+ * + */ + @Column(name="STATUS" , nullable=false ) + protected int status = XAConstants.STATUS_DISABLED; + + /** + * Type of group + *
    + *
  • This attribute is of type enum CommonEnums::XAGroupType + *
+ * + */ + @Column(name="GROUP_TYPE" , nullable=false ) + protected int groupType = AppConstants.XA_GROUP_UNKNOWN; + + @Column(name="GROUP_SRC" , nullable=false ) + protected int groupSource = XACommonEnums.GROUP_INTERNAL; + + /** + * Id of the credential store + *
    + *
+ * + */ + @Column(name="CRED_STORE_ID" ) + protected Long credStoreId; + + + /** + * Default constructor. This will set all the attributes to default value. + */ + public XXGroup ( ) { + status = XAConstants.STATUS_DISABLED; + groupType = AppConstants.XA_GROUP_UNKNOWN; + groupSource = XACommonEnums.GROUP_INTERNAL; + } + + @Override + public int getMyClassType( ) { + return AppConstants.CLASS_TYPE_XA_GROUP; + } + + @Override + public String getMyDisplayValue() { + return getDescription( ); + } + + /** + * 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 ) { + this.name = name; + } + + /** + * Returns the value for the member attribute name + * @return String - value of member attribute name. + */ + public String getName( ) { + return this.name; + } + + /** + * 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 ) { + this.description = description; + } + + /** + * Returns the value for the member attribute description + * @return String - value of member attribute description. + */ + public String getDescription( ) { + return this.description; + } + + /** + * 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 ) { + this.status = status; + } + + /** + * Returns the value for the member attribute status + * @return int - value of member attribute status. + */ + public int getStatus( ) { + return this.status; + } + + /** + * 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 ) { + this.groupType = groupType; + } + + /** + * Returns the value for the member attribute groupType + * @return int - value of member attribute groupType. + */ + public int getGroupType( ) { + return this.groupType; + } + + /** + * 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 ) { + this.credStoreId = credStoreId; + } + + /** + * Returns the value for the member attribute credStoreId + * @return Long - value of member attribute credStoreId. + */ + public Long getCredStoreId( ) { + return this.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 += "groupType={" + groupType + "} "; + str += "credStoreId={" + credStoreId + "} "; + str += "groupSrc={" + groupSource + "} "; + str += "}"; + return str; + } + + public int getGroupSource() { + return groupSource; + } + + public void setGroupSource(int groupSource) { + this.groupSource = groupSource; + } + + /** + * 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; + if ((this.credStoreId == null && other.credStoreId != null) || (this.credStoreId != null && !this.credStoreId.equals(other.credStoreId))) { + return false; + } + return true; + } + public static String getEnumName(String fieldName ) { + if( fieldName.equals("status") ) { + return "CommonEnums.ActiveStatus"; + } + if( fieldName.equals("groupType") ) { + return "CommonEnums.XAGroupType"; + } + //Later TODO + //return super.getEnumName(fieldName); + return null; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/security-admin/src/main/java/com/xasecure/entity/XXGroupGroup.java ---------------------------------------------------------------------- diff --git a/security-admin/src/main/java/com/xasecure/entity/XXGroupGroup.java b/security-admin/src/main/java/com/xasecure/entity/XXGroupGroup.java new file mode 100644 index 0000000..ffa351e --- /dev/null +++ b/security-admin/src/main/java/com/xasecure/entity/XXGroupGroup.java @@ -0,0 +1,174 @@ +package com.xasecure.entity; +/* + * Copyright (c) 2014 XASecure + * All rights reserved. + * + * This software is the confidential and proprietary information of + * XASecure ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with XASecure + */ + +/** + * Group of groups + * + */ + +import java.util.*; +import javax.persistence.*; +import javax.xml.bind.annotation.*; +import com.xasecure.common.*; +import com.xasecure.entity.*; + + +@Entity +@Table(name="x_group_groups") +@XmlRootElement +public class XXGroupGroup extends XXDBBase implements java.io.Serializable { + private static final long serialVersionUID = 1L; + + + + /** + * Name + *
    + *
  • The maximum length for this attribute is 1024. + *
+ * + */ + @Column(name="GROUP_NAME" , nullable=false , length=1024) + protected String name; + + /** + * Id of the parent group + *
    + *
+ * + */ + @Column(name="P_GROUP_ID" ) + protected Long parentGroupId; + + + /** + * Id of the group + *
    + *
+ * + */ + @Column(name="GROUP_ID" ) + protected Long groupId; + + + /** + * Default constructor. This will set all the attributes to default value. + */ + public XXGroupGroup ( ) { + } + + @Override + public int getMyClassType( ) { + return AppConstants.CLASS_TYPE_XA_GROUP_GROUP; + } + + @Override + public String getMyDisplayValue() { + return 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 ) { + this.name = name; + } + + /** + * Returns the value for the member attribute name + * @return String - value of member attribute name. + */ + public String getName( ) { + return this.name; + } + + /** + * 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 ) { + this.parentGroupId = parentGroupId; + } + + /** + * Returns the value for the member attribute parentGroupId + * @return Long - value of member attribute parentGroupId. + */ + public Long getParentGroupId( ) { + return this.parentGroupId; + } + + + /** + * 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 ) { + this.groupId = groupId; + } + + /** + * Returns the value for the member attribute groupId + * @return Long - value of member attribute groupId. + */ + public Long getGroupId( ) { + return this.groupId; + } + + + /** + * This return the bean content in string format + * @return formatedStr + */ + @Override + public String toString( ) { + String str = "XXGroupGroup={"; + str += super.toString(); + str += "name={" + name + "} "; + str += "parentGroupId={" + parentGroupId + "} "; + str += "groupId={" + groupId + "} "; + 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; + } + XXGroupGroup other = (XXGroupGroup) obj; + if ((this.name == null && other.name != null) || (this.name != null && !this.name.equals(other.name))) { + return false; + } + if ((this.parentGroupId == null && other.parentGroupId != null) || (this.parentGroupId != null && !this.parentGroupId.equals(other.parentGroupId))) { + return false; + } + if ((this.groupId == null && other.groupId != null) || (this.groupId != null && !this.groupId.equals(other.groupId))) { + return false; + } + return true; + } + public static String getEnumName(String fieldName ) { + //Later TODO + //return super.getEnumName(fieldName); + return null; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/security-admin/src/main/java/com/xasecure/entity/XXGroupUser.java ---------------------------------------------------------------------- diff --git a/security-admin/src/main/java/com/xasecure/entity/XXGroupUser.java b/security-admin/src/main/java/com/xasecure/entity/XXGroupUser.java new file mode 100644 index 0000000..d44208f --- /dev/null +++ b/security-admin/src/main/java/com/xasecure/entity/XXGroupUser.java @@ -0,0 +1,174 @@ +package com.xasecure.entity; +/* + * Copyright (c) 2014 XASecure + * All rights reserved. + * + * This software is the confidential and proprietary information of + * XASecure ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with XASecure + */ + +/** + * Group of users + * + */ + +import java.util.*; +import javax.persistence.*; +import javax.xml.bind.annotation.*; +import com.xasecure.common.*; +import com.xasecure.entity.*; + + +@Entity +@Table(name="x_group_users") +@XmlRootElement +public class XXGroupUser extends XXDBBase implements java.io.Serializable { + private static final long serialVersionUID = 1L; + + + + /** + * Name + *
    + *
  • The maximum length for this attribute is 1024. + *
+ * + */ + @Column(name="GROUP_NAME" , nullable=false , length=1024) + protected String name; + + /** + * Id of the group + *
    + *
+ * + */ + @Column(name="P_GROUP_ID" ) + protected Long parentGroupId; + + + /** + * Id of the user + *
    + *
+ * + */ + @Column(name="USER_ID" ) + protected Long userId; + + + /** + * Default constructor. This will set all the attributes to default value. + */ + public XXGroupUser ( ) { + } + + @Override + public int getMyClassType( ) { + return AppConstants.CLASS_TYPE_XA_GROUP_USER; + } + + @Override + public String getMyDisplayValue() { + return 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 ) { + this.name = name; + } + + /** + * Returns the value for the member attribute name + * @return String - value of member attribute name. + */ + public String getName( ) { + return this.name; + } + + /** + * 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 ) { + this.parentGroupId = parentGroupId; + } + + /** + * Returns the value for the member attribute parentGroupId + * @return Long - value of member attribute parentGroupId. + */ + public Long getParentGroupId( ) { + return this.parentGroupId; + } + + + /** + * 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 ) { + this.userId = userId; + } + + /** + * Returns the value for the member attribute userId + * @return Long - value of member attribute userId. + */ + public Long getUserId( ) { + return this.userId; + } + + + /** + * This return the bean content in string format + * @return formatedStr + */ + @Override + public String toString( ) { + String str = "XXGroupUser={"; + str += super.toString(); + str += "name={" + name + "} "; + str += "parentGroupId={" + parentGroupId + "} "; + str += "userId={" + userId + "} "; + 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; + } + XXGroupUser other = (XXGroupUser) obj; + if ((this.name == null && other.name != null) || (this.name != null && !this.name.equals(other.name))) { + return false; + } + if ((this.parentGroupId == null && other.parentGroupId != null) || (this.parentGroupId != null && !this.parentGroupId.equals(other.parentGroupId))) { + return false; + } + if ((this.userId == null && other.userId != null) || (this.userId != null && !this.userId.equals(other.userId))) { + return false; + } + return true; + } + public static String getEnumName(String fieldName ) { + //Later TODO + //return super.getEnumName(fieldName); + return null; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/security-admin/src/main/java/com/xasecure/entity/XXPermMap.java ---------------------------------------------------------------------- diff --git a/security-admin/src/main/java/com/xasecure/entity/XXPermMap.java b/security-admin/src/main/java/com/xasecure/entity/XXPermMap.java new file mode 100644 index 0000000..6d90c60 --- /dev/null +++ b/security-admin/src/main/java/com/xasecure/entity/XXPermMap.java @@ -0,0 +1,373 @@ +package com.xasecure.entity; +/* + * Copyright (c) 2014 XASecure + * All rights reserved. + * + * This software is the confidential and proprietary information of + * XASecure ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with XASecure + */ + +/** + * Permission map + * + */ + +import java.util.*; +import javax.persistence.*; +import javax.xml.bind.annotation.*; +import com.xasecure.common.*; +import com.xasecure.entity.*; + + +@Entity +@Table(name="x_perm_map") +@XmlRootElement +public class XXPermMap extends XXDBBase implements java.io.Serializable { + private static final long serialVersionUID = 1L; + + + + /** + * Group to which the permission belongs to + *
    + *
  • The maximum length for this attribute is 1024. + *
+ * + */ + @Column(name="PERM_GROUP" , length=1024) + protected String permGroup; + + /** + * Id of the resource + *
    + *
+ * + */ + @Column(name="RES_ID" ) + protected Long resourceId; + + + /** + * Id of the group + *
    + *
+ * + */ + @Column(name="GROUP_ID" ) + protected Long groupId; + + + /** + * Id of the user + *
    + *
+ * + */ + @Column(name="USER_ID" ) + protected Long userId; + + + /** + * Permission for user or group + *
    + *
  • This attribute is of type enum CommonEnums::XAPermForType + *
+ * + */ + @Column(name="PERM_FOR" , nullable=false ) + protected int permFor = AppConstants.XA_PERM_FOR_UNKNOWN; + + /** + * Type of permission + *
    + *
  • This attribute is of type enum CommonEnums::XAPermType + *
+ * + */ + @Column(name="PERM_TYPE" , nullable=false ) + protected int permType = AppConstants.XA_PERM_TYPE_UNKNOWN; + + /** + * Is recursive + *
    + *
  • This attribute is of type enum CommonEnums::BooleanValue + *
+ * + */ + @Column(name="IS_RECURSIVE" , nullable=false ) + protected int isRecursive = XAConstants.BOOL_NONE; + + /** + * Is wild card + *
    + *
+ * + */ + @Column(name="IS_WILD_CARD" , nullable=false ) + protected boolean isWildCard = true; + + /** + * Grant is true and revoke is false + *
    + *
+ * + */ + @Column(name="GRANT_REVOKE" , nullable=false ) + protected boolean grantOrRevoke = true; + /** + * IP address to which the group belongs to + *
    + *
  • The maximum length for this attribute is 1024. + *
+ * + */ + @Column(name="IP_ADDRESS" , length=1024) + protected String ipAddress; + + /** + * Default constructor. This will set all the attributes to default value. + */ + public XXPermMap ( ) { + permFor = AppConstants.XA_PERM_FOR_UNKNOWN; + permType = AppConstants.XA_PERM_TYPE_UNKNOWN; + isRecursive = XAConstants.BOOL_NONE; + } + + @Override + public int getMyClassType( ) { + return AppConstants.CLASS_TYPE_XA_PERM_MAP; + } + + /** + * 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 ) { + this.permGroup = permGroup; + } + + /** + * Returns the value for the member attribute permGroup + * @return String - value of member attribute permGroup. + */ + public String getPermGroup( ) { + return this.permGroup; + } + + /** + * 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 ) { + this.resourceId = resourceId; + } + + /** + * Returns the value for the member attribute resourceId + * @return Long - value of member attribute resourceId. + */ + public Long getResourceId( ) { + return this.resourceId; + } + + + /** + * 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 ) { + this.groupId = groupId; + } + + /** + * Returns the value for the member attribute groupId + * @return Long - value of member attribute groupId. + */ + public Long getGroupId( ) { + return this.groupId; + } + + + /** + * 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 ) { + this.userId = userId; + } + + /** + * Returns the value for the member attribute userId + * @return Long - value of member attribute userId. + */ + public Long getUserId( ) { + return this.userId; + } + + + /** + * 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 ) { + this.permFor = permFor; + } + + /** + * Returns the value for the member attribute permFor + * @return int - value of member attribute permFor. + */ + public int getPermFor( ) { + return this.permFor; + } + + /** + * 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 ) { + this.permType = permType; + } + + /** + * Returns the value for the member attribute permType + * @return int - value of member attribute permType. + */ + public int getPermType( ) { + return this.permType; + } + + /** + * 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 ) { + this.isRecursive = isRecursive; + } + + /** + * Returns the value for the member attribute isRecursive + * @return int - value of member attribute isRecursive. + */ + public int getIsRecursive( ) { + return this.isRecursive; + } + + /** + * 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 ) { + this.isWildCard = isWildCard; + } + + /** + * Returns the value for the member attribute isWildCard + * @return boolean - value of member attribute isWildCard. + */ + public boolean isIsWildCard( ) { + return this.isWildCard; + } + + /** + * 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 ) { + this.grantOrRevoke = grantOrRevoke; + } + + /** + * Returns the value for the member attribute grantOrRevoke + * @return boolean - value of member attribute grantOrRevoke. + */ + public boolean isGrantOrRevoke( ) { + return this.grantOrRevoke; + } + + public String getIpAddress() { + return ipAddress; + } + + public void setIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + } + + /** + * This return the bean content in string format + * @return formatedStr + */ + @Override + public String toString( ) { + String str = "XXPermMap={"; + str += super.toString(); + str += "permGroup={" + permGroup + "} "; + str += "resourceId={" + resourceId + "} "; + str += "groupId={" + groupId + "} "; + str += "userId={" + userId + "} "; + str += "permFor={" + permFor + "} "; + str += "permType={" + permType + "} "; + str += "isRecursive={" + isRecursive + "} "; + str += "isWildCard={" + isWildCard + "} "; + str += "grantOrRevoke={" + grantOrRevoke + "} "; + 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; + } + XXPermMap other = (XXPermMap) obj; + if ((this.permGroup == null && other.permGroup != null) || (this.permGroup != null && !this.permGroup.equals(other.permGroup))) { + return false; + } + if ((this.resourceId == null && other.resourceId != null) || (this.resourceId != null && !this.resourceId.equals(other.resourceId))) { + return false; + } + if ((this.groupId == null && other.groupId != null) || (this.groupId != null && !this.groupId.equals(other.groupId))) { + return false; + } + if ((this.userId == null && other.userId != null) || (this.userId != null && !this.userId.equals(other.userId))) { + return false; + } + if( this.permFor != other.permFor ) return false; + if( this.permType != other.permType ) return false; + if( this.isRecursive != other.isRecursive ) return false; + if( this.isWildCard != other.isWildCard ) return false; + if( this.grantOrRevoke != other.grantOrRevoke ) return false; + return true; + } + public static String getEnumName(String fieldName ) { + if( fieldName.equals("permFor") ) { + return "CommonEnums.XAPermForType"; + } + if( fieldName.equals("permType") ) { + return "CommonEnums.XAPermType"; + } + if( fieldName.equals("isRecursive") ) { + return "CommonEnums.BooleanValue"; + } + //Later TODO + //return super.getEnumName(fieldName); + return null; + } + +}