ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject incubator-ranger git commit: RANGER-387: fix inconsistent getter/setter names for RangerServiceDe.name
Date Fri, 10 Apr 2015 15:42:22 GMT
Repository: incubator-ranger
Updated Branches:
  refs/heads/master ef0f20d24 -> 9693fb8de


RANGER-387: fix inconsistent getter/setter names for RangerServiceDe.name


Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/9693fb8d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/9693fb8d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/9693fb8d

Branch: refs/heads/master
Commit: 9693fb8dec06bb54b2f2e061f073ae608835004d
Parents: ef0f20d
Author: Madhan Neethiraj <madhan@apache.org>
Authored: Fri Apr 10 00:47:48 2015 -0700
Committer: Madhan Neethiraj <madhan@apache.org>
Committed: Fri Apr 10 08:42:14 2015 -0700

----------------------------------------------------------------------
 .../org/apache/ranger/plugin/model/RangerServiceDef.java     | 8 ++++----
 .../main/resources/service-defs/ranger-servicedef-hbase.json | 4 ----
 .../main/resources/service-defs/ranger-servicedef-hdfs.json  | 4 ----
 .../main/resources/service-defs/ranger-servicedef-hive.json  | 4 ----
 .../main/resources/service-defs/ranger-servicedef-kms.json   | 3 ---
 .../main/resources/service-defs/ranger-servicedef-knox.json  | 4 ----
 .../main/resources/service-defs/ranger-servicedef-storm.json | 4 ----
 .../main/resources/service-defs/ranger-servicedef-yarn.json  | 4 ----
 .../src/main/java/org/apache/ranger/rest/PublicAPIsv2.java   | 5 ++++-
 .../apache/ranger/service/RangerServiceDefServiceBase.java   | 2 +-
 10 files changed, 9 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/9693fb8d/agents-common/src/main/java/org/apache/ranger/plugin/model/RangerServiceDef.java
----------------------------------------------------------------------
diff --git a/agents-common/src/main/java/org/apache/ranger/plugin/model/RangerServiceDef.java
b/agents-common/src/main/java/org/apache/ranger/plugin/model/RangerServiceDef.java
index 87fab8f..cd634b8 100644
--- a/agents-common/src/main/java/org/apache/ranger/plugin/model/RangerServiceDef.java
+++ b/agents-common/src/main/java/org/apache/ranger/plugin/model/RangerServiceDef.java
@@ -73,10 +73,10 @@ public class RangerServiceDef extends RangerBaseModelObject implements
java.io.S
 	 * @param contextEnrichers
 	 * @param enums
 	 */
-	public RangerServiceDef(String type, String implClass, String label, String description,
List<RangerServiceConfigDef> configs, List<RangerResourceDef> resources, List<RangerAccessTypeDef>
accessTypes, List<RangerPolicyConditionDef> policyConditions, List<RangerContextEnricherDef>
contextEnrichers, List<RangerEnumDef> enums) {
+	public RangerServiceDef(String name, String implClass, String label, String description,
List<RangerServiceConfigDef> configs, List<RangerResourceDef> resources, List<RangerAccessTypeDef>
accessTypes, List<RangerPolicyConditionDef> policyConditions, List<RangerContextEnricherDef>
contextEnrichers, List<RangerEnumDef> enums) {
 		super();
 
-		setType(type);
+		setName(name);
 		setImplClass(implClass);
 		setLabel(label);
 		setDescription(description);
@@ -94,7 +94,7 @@ public class RangerServiceDef extends RangerBaseModelObject implements java.io.S
 	public void updateFrom(RangerServiceDef other) {
 		super.updateFrom(other);
 
-		setType(other.getName());
+		setName(other.getName());
 		setImplClass(other.getImplClass());
 		setLabel(other.getLabel());
 		setDescription(other.getDescription());
@@ -115,7 +115,7 @@ public class RangerServiceDef extends RangerBaseModelObject implements
java.io.S
 	/**
 	 * @param name the name to set
 	 */
-	public void setType(String name) {
+	public void setName(String name) {
 		this.name = name;
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/9693fb8d/agents-common/src/main/resources/service-defs/ranger-servicedef-hbase.json
----------------------------------------------------------------------
diff --git a/agents-common/src/main/resources/service-defs/ranger-servicedef-hbase.json b/agents-common/src/main/resources/service-defs/ranger-servicedef-hbase.json
index f860f1d..99fbd1d 100644
--- a/agents-common/src/main/resources/service-defs/ranger-servicedef-hbase.json
+++ b/agents-common/src/main/resources/service-defs/ranger-servicedef-hbase.json
@@ -1,13 +1,9 @@
 {
-	"id": 2,
 	"name": "hbase",
 	"implClass": "org.apache.ranger.services.hbase.RangerServiceHBase",
 	"label": "HBase",
 	"description": "HBase",
 	"guid": "d6cea1f0-2509-4791-8fc1-7b092399ba3b",
-	"createTime": "20141208-22:50:22.426--0800",
-	"updateTime": "20141208-22:50:22.426--0800",
-	"version": 1,
 	"resources": 
 	[
 		{

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/9693fb8d/agents-common/src/main/resources/service-defs/ranger-servicedef-hdfs.json
----------------------------------------------------------------------
diff --git a/agents-common/src/main/resources/service-defs/ranger-servicedef-hdfs.json b/agents-common/src/main/resources/service-defs/ranger-servicedef-hdfs.json
index e0800fe..0ba0afc 100755
--- a/agents-common/src/main/resources/service-defs/ranger-servicedef-hdfs.json
+++ b/agents-common/src/main/resources/service-defs/ranger-servicedef-hdfs.json
@@ -1,13 +1,9 @@
 {
-	"id": 1,
 	"name": "hdfs",
 	"implClass": "org.apache.ranger.services.hdfs.RangerServiceHdfs",
 	"label": "HDFS Repository",
 	"description": "HDFS Repository",
 	"guid": "0d047247-bafe-4cf8-8e9b-d5d377284b2d",
-	"createTime": "20141208-22:04:25.233--0800",
-	"updateTime": "20141208-22:04:25.233--0800",
-	"version": 1,
 	"resources": 
 	[
 		{

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/9693fb8d/agents-common/src/main/resources/service-defs/ranger-servicedef-hive.json
----------------------------------------------------------------------
diff --git a/agents-common/src/main/resources/service-defs/ranger-servicedef-hive.json b/agents-common/src/main/resources/service-defs/ranger-servicedef-hive.json
index 8b68e99..6d1cab5 100644
--- a/agents-common/src/main/resources/service-defs/ranger-servicedef-hive.json
+++ b/agents-common/src/main/resources/service-defs/ranger-servicedef-hive.json
@@ -1,13 +1,9 @@
 {
-	"id": 3,
 	"name": "hive",
 	"implClass": "org.apache.ranger.services.hive.RangerServiceHive",
 	"label": "Hive Server2",
 	"description": "Hive Server2",
 	"guid": "3e1afb5a-184a-4e82-9d9c-87a5cacc243c",
-	"createTime": "20141208-22:51:20.732--0800",
-	"updateTime": "20141208-22:51:20.732--0800",
-	"version": 1,
 	"resources": 
 	[
 		{

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/9693fb8d/agents-common/src/main/resources/service-defs/ranger-servicedef-kms.json
----------------------------------------------------------------------
diff --git a/agents-common/src/main/resources/service-defs/ranger-servicedef-kms.json b/agents-common/src/main/resources/service-defs/ranger-servicedef-kms.json
index 2ca22f4..f4174d8 100755
--- a/agents-common/src/main/resources/service-defs/ranger-servicedef-kms.json
+++ b/agents-common/src/main/resources/service-defs/ranger-servicedef-kms.json
@@ -3,9 +3,6 @@
 	"implClass": "org.apache.ranger.services.kms.RangerServiceKMS",
 	"label": "KMS",
 	"description": "KMS",
-	"createTime": "20150329-11:03:47.095--0800",
-	"updateTime": "20150329-11:03:47.095--0800",
-	"version": 1,
 	"resources": 
 	[
 		{

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/9693fb8d/agents-common/src/main/resources/service-defs/ranger-servicedef-knox.json
----------------------------------------------------------------------
diff --git a/agents-common/src/main/resources/service-defs/ranger-servicedef-knox.json b/agents-common/src/main/resources/service-defs/ranger-servicedef-knox.json
index cd6401a..f2c65f4 100644
--- a/agents-common/src/main/resources/service-defs/ranger-servicedef-knox.json
+++ b/agents-common/src/main/resources/service-defs/ranger-servicedef-knox.json
@@ -1,13 +1,9 @@
 {
-	"id": 5,
 	"name": "knox",
 	"implClass": "org.apache.ranger.services.knox.RangerServiceKnox",
 	"label": "Knox Gateway",
 	"description": "Knox Gateway",
 	"guid": "84b481b5-f23b-4f71-b8b6-ab33977149ca",
-	"createTime": "20141208-22:48:42.238--0800",
-	"updateTime": "20141208-22:48:42.238--0800",
-	"version": 1,
 	"resources": 
 	[
 		{

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/9693fb8d/agents-common/src/main/resources/service-defs/ranger-servicedef-storm.json
----------------------------------------------------------------------
diff --git a/agents-common/src/main/resources/service-defs/ranger-servicedef-storm.json b/agents-common/src/main/resources/service-defs/ranger-servicedef-storm.json
index fd51fea..76cadf1 100644
--- a/agents-common/src/main/resources/service-defs/ranger-servicedef-storm.json
+++ b/agents-common/src/main/resources/service-defs/ranger-servicedef-storm.json
@@ -1,13 +1,9 @@
 {
-	"id": 6,
 	"name": "storm",
 	"implClass": "org.apache.ranger.services.storm.RangerServiceStorm",
 	"label": "Storm",
 	"description": "Storm",
 	"guid": "2a60f427-edcf-4e20-834c-a9a267b5b963",
-	"createTime": "20141208-22:55:47.095--0800",
-	"updateTime": "20141208-22:55:47.095--0800",
-	"version": 1,
 	"resources": 
 	[
 		{

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/9693fb8d/agents-common/src/main/resources/service-defs/ranger-servicedef-yarn.json
----------------------------------------------------------------------
diff --git a/agents-common/src/main/resources/service-defs/ranger-servicedef-yarn.json b/agents-common/src/main/resources/service-defs/ranger-servicedef-yarn.json
index 5d8b989..3fd79e2 100644
--- a/agents-common/src/main/resources/service-defs/ranger-servicedef-yarn.json
+++ b/agents-common/src/main/resources/service-defs/ranger-servicedef-yarn.json
@@ -1,13 +1,9 @@
 {
-	"id": 7,
 	"name": "yarn",
 	"implClass": "org.apache.ranger.services.yarn.RangerServiceYarn",
 	"label": "YARN",
 	"description": "YARN",
 	"guid": "5b710438-edcf-4e20-834c-a9a267b5b963",
-	"createTime": "20141208-22:55:47.095--0800",
-	"updateTime": "20141208-22:55:47.095--0800",
-	"version": 1,
 	"resources": 
 	[
 		{

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/9693fb8d/security-admin/src/main/java/org/apache/ranger/rest/PublicAPIsv2.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/rest/PublicAPIsv2.java b/security-admin/src/main/java/org/apache/ranger/rest/PublicAPIsv2.java
index 2094228..9527bcb 100644
--- a/security-admin/src/main/java/org/apache/ranger/rest/PublicAPIsv2.java
+++ b/security-admin/src/main/java/org/apache/ranger/rest/PublicAPIsv2.java
@@ -115,7 +115,7 @@ public class PublicAPIsv2 {
 		// serviceDef.name is immutable
 		// if serviceDef.name is specified, it should be same as the param 'name'
 		if(serviceDef.getName() == null) {
-			serviceDef.setType(name);
+			serviceDef.setName(name);
 		} else if(!serviceDef.getName().equals(name)) {
 			throw restErrorUtil.createRESTException(HttpServletResponse.SC_BAD_REQUEST , "serviceDef
name mismatch", true);
 		}
@@ -354,6 +354,9 @@ public class PublicAPIsv2 {
 		if(StringUtils.isEmpty(policy.getGuid())) {
 			policy.setGuid(oldPolicy.getGuid());
 		}
+		if(StringUtils.isEmpty(policy.getName())) {
+			policy.setName(oldPolicy.getName());
+		}
 
 		return serviceREST.updatePolicy(policy);
 	}

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/9693fb8d/security-admin/src/main/java/org/apache/ranger/service/RangerServiceDefServiceBase.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/service/RangerServiceDefServiceBase.java
b/security-admin/src/main/java/org/apache/ranger/service/RangerServiceDefServiceBase.java
index 632869f..3cdd1e7 100644
--- a/security-admin/src/main/java/org/apache/ranger/service/RangerServiceDefServiceBase.java
+++ b/security-admin/src/main/java/org/apache/ranger/service/RangerServiceDefServiceBase.java
@@ -83,7 +83,7 @@ public abstract class RangerServiceDefServiceBase<T extends XXServiceDef,
V exte
 	protected RangerServiceDef mapEntityToViewBean(RangerServiceDef vObj, XXServiceDef xObj)
{
 		vObj.setGuid(xObj.getGuid());
 		vObj.setVersion(xObj.getVersion());
-		vObj.setType(xObj.getName());
+		vObj.setName(xObj.getName());
 		vObj.setImplClass(xObj.getImplclassname());
 		vObj.setLabel(xObj.getLabel());
 		vObj.setDescription(xObj.getDescription());


Mime
View raw message