Java Code Examples for org.apache.ranger.plugin.model.RangerPolicy#setUpdateTime()
The following examples show how to use
org.apache.ranger.plugin.model.RangerPolicy#setUpdateTime() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RangerServicePoliciesCache.java From ranger with Apache License 2.0 | 6 votes |
private void pruneUnusedPolicyAttributes(List<RangerPolicy> policies) { // Null out attributes not required by plug-ins if (CollectionUtils.isNotEmpty(policies)) { for (RangerPolicy policy : policies) { policy.setCreatedBy(null); policy.setCreateTime(null); policy.setUpdatedBy(null); policy.setUpdateTime(null); // policy.setGuid(null); /* this is used by import policy */ // policy.setName(null); /* this is used by GUI in policy list page */ // policy.setDescription(null); /* this is used by export policy */ policy.setResourceSignature(null); policy.setOptions(null); } } }
Example 2
Source File: RangerPolicyRetriever.java From ranger with Apache License 2.0 | 5 votes |
RangerPolicy getNextPolicy() { RangerPolicy ret = null; if (service != null && iterPolicy != null && iterPolicy.hasNext()) { XXPolicy xPolicy = iterPolicy.next(); if (xPolicy != null) { String policyText = xPolicy.getPolicyText(); ret = JsonUtils.jsonToObject(policyText, RangerPolicy.class); if (ret != null) { ret.setId(xPolicy.getId()); ret.setGuid(xPolicy.getGuid()); ret.setCreatedBy(lookupCache.getUserScreenName(xPolicy.getAddedByUserId())); ret.setUpdatedBy(lookupCache.getUserScreenName(xPolicy.getUpdatedByUserId())); ret.setCreateTime(xPolicy.getCreateTime()); ret.setUpdateTime(xPolicy.getUpdateTime()); ret.setVersion(xPolicy.getVersion()); ret.setPolicyType(xPolicy.getPolicyType() == null ? RangerPolicy.POLICY_TYPE_ACCESS : xPolicy.getPolicyType()); ret.setService(service.getName()); ret.setServiceType(serviceDef.getName()); ret.setZoneName(lookupCache.getSecurityZoneName(xPolicy.getZoneId())); updatePolicyReferenceFields(ret); getPolicyLabels(ret); } } } return ret; }
Example 3
Source File: TestRangerPolicyServiceBase.java From ranger with Apache License 2.0 | 5 votes |
private RangerPolicy rangerPolicy() { List<RangerPolicyItemAccess> accesses = new ArrayList<RangerPolicyItemAccess>(); List<String> users = new ArrayList<String>(); List<String> groups = new ArrayList<String>(); List<RangerPolicyItemCondition> conditions = new ArrayList<RangerPolicyItemCondition>(); List<RangerPolicyItem> policyItems = new ArrayList<RangerPolicyItem>(); RangerPolicyItem rangerPolicyItem = new RangerPolicyItem(); rangerPolicyItem.setAccesses(accesses); rangerPolicyItem.setConditions(conditions); rangerPolicyItem.setGroups(groups); rangerPolicyItem.setUsers(users); rangerPolicyItem.setDelegateAdmin(false); policyItems.add(rangerPolicyItem); Map<String, RangerPolicyResource> policyResource = new HashMap<String, RangerPolicyResource>(); RangerPolicyResource rangerPolicyResource = new RangerPolicyResource(); rangerPolicyResource.setIsExcludes(true); rangerPolicyResource.setIsRecursive(true); rangerPolicyResource.setValue("1"); rangerPolicyResource.setValues(users); RangerPolicy policy = new RangerPolicy(); policy.setId(Id); policy.setCreateTime(new Date()); policy.setDescription("policy"); policy.setGuid("policyguid"); policy.setIsEnabled(true); policy.setName("HDFS_1-1-20150316062453"); policy.setUpdatedBy("Admin"); policy.setUpdateTime(new Date()); policy.setService("HDFS_1-1-20150316062453"); policy.setIsAuditEnabled(true); policy.setPolicyItems(policyItems); policy.setResources(policyResource); policy.setZoneName(""); return policy; }
Example 4
Source File: TestRangerPolicyService.java From ranger with Apache License 2.0 | 5 votes |
private RangerPolicy rangerPolicy() { List<RangerPolicyItemAccess> accesses = new ArrayList<RangerPolicyItemAccess>(); List<String> users = new ArrayList<String>(); List<String> groups = new ArrayList<String>(); List<RangerPolicyItemCondition> conditions = new ArrayList<RangerPolicyItemCondition>(); List<RangerPolicyItem> policyItems = new ArrayList<RangerPolicyItem>(); RangerPolicyItem rangerPolicyItem = new RangerPolicyItem(); rangerPolicyItem.setAccesses(accesses); rangerPolicyItem.setConditions(conditions); rangerPolicyItem.setGroups(groups); rangerPolicyItem.setUsers(users); rangerPolicyItem.setDelegateAdmin(false); policyItems.add(rangerPolicyItem); Map<String, RangerPolicyResource> policyResource = new HashMap<String, RangerPolicyResource>(); RangerPolicyResource rangerPolicyResource = new RangerPolicyResource(); rangerPolicyResource.setIsExcludes(true); rangerPolicyResource.setIsRecursive(true); rangerPolicyResource.setValue("1"); rangerPolicyResource.setValues(users); RangerPolicy policy = new RangerPolicy(); policy.setId(Id); policy.setCreateTime(new Date()); policy.setDescription("policy"); policy.setGuid("policyguid"); policy.setIsEnabled(true); policy.setName("HDFS_1-1-20150316062453"); policy.setUpdatedBy("Admin"); policy.setUpdateTime(new Date()); policy.setService("HDFS_1-1-20150316062453"); policy.setIsAuditEnabled(true); policy.setPolicyItems(policyItems); policy.setResources(policyResource); policy.setPolicyType(0); return policy; }
Example 5
Source File: TestPublicAPIs.java From ranger with Apache License 2.0 | 5 votes |
private RangerPolicy rangerPolicy() { List<RangerPolicyItemAccess> accesses = new ArrayList<RangerPolicyItemAccess>(); List<String> users = new ArrayList<String>(); List<String> groups = new ArrayList<String>(); List<RangerPolicyItemCondition> conditions = new ArrayList<RangerPolicyItemCondition>(); List<RangerPolicyItem> policyItems = new ArrayList<RangerPolicyItem>(); RangerPolicyItem rangerPolicyItem = new RangerPolicyItem(); rangerPolicyItem.setAccesses(accesses); rangerPolicyItem.setConditions(conditions); rangerPolicyItem.setGroups(groups); rangerPolicyItem.setUsers(users); rangerPolicyItem.setDelegateAdmin(false); policyItems.add(rangerPolicyItem); Map<String, RangerPolicyResource> policyResource = new HashMap<String, RangerPolicyResource>(); RangerPolicyResource rangerPolicyResource = new RangerPolicyResource(); rangerPolicyResource.setIsExcludes(true); rangerPolicyResource.setIsRecursive(true); rangerPolicyResource.setValue("1"); rangerPolicyResource.setValues(users); policyResource.put("resource", rangerPolicyResource); RangerPolicy policy = new RangerPolicy(); policy.setId(Id); policy.setCreateTime(new Date()); policy.setDescription("policy"); policy.setGuid("policyguid"); policy.setIsEnabled(true); policy.setName("HDFS_1-1-20150316062453"); policy.setUpdatedBy("Admin"); policy.setUpdateTime(new Date()); policy.setService("HDFS_1-1-20150316062453"); policy.setIsAuditEnabled(true); policy.setPolicyItems(policyItems); policy.setResources(policyResource); policy.setService("HDFS_1"); return policy; }
Example 6
Source File: TestPublicAPIsv2.java From ranger with Apache License 2.0 | 5 votes |
private RangerPolicy rangerPolicy() { List<RangerPolicyItemAccess> accesses = new ArrayList<RangerPolicyItemAccess>(); List<String> users = new ArrayList<String>(); List<String> groups = new ArrayList<String>(); List<RangerPolicyItemCondition> conditions = new ArrayList<RangerPolicyItemCondition>(); List<RangerPolicyItem> policyItems = new ArrayList<RangerPolicyItem>(); RangerPolicyItem rangerPolicyItem = new RangerPolicyItem(); rangerPolicyItem.setAccesses(accesses); rangerPolicyItem.setConditions(conditions); rangerPolicyItem.setGroups(groups); rangerPolicyItem.setUsers(users); rangerPolicyItem.setDelegateAdmin(false); policyItems.add(rangerPolicyItem); Map<String, RangerPolicyResource> policyResource = new HashMap<String, RangerPolicyResource>(); RangerPolicyResource rangerPolicyResource = new RangerPolicyResource(); rangerPolicyResource.setIsExcludes(true); rangerPolicyResource.setIsRecursive(true); rangerPolicyResource.setValue("1"); rangerPolicyResource.setValues(users); policyResource.put("resource", rangerPolicyResource); RangerPolicy policy = new RangerPolicy(); policy.setId(Id); policy.setCreateTime(new Date()); policy.setDescription("policy"); policy.setGuid("policyguid"); policy.setIsEnabled(true); policy.setName("HDFS_1-1-20150316062453"); policy.setUpdatedBy("Admin"); policy.setUpdateTime(new Date()); policy.setService("HDFS_1-1-20150316062453"); policy.setIsAuditEnabled(true); policy.setPolicyItems(policyItems); policy.setResources(policyResource); policy.setService("HDFS_1"); return policy; }
Example 7
Source File: TestPublicAPIsv2.java From ranger with Apache License 2.0 | 5 votes |
private RangerPolicy rangerPolicy1() { List<RangerPolicyItemAccess> accesses = new ArrayList<RangerPolicyItemAccess>(); List<String> users = new ArrayList<String>(); List<String> groups = new ArrayList<String>(); List<RangerPolicyItemCondition> conditions = new ArrayList<RangerPolicyItemCondition>(); List<RangerPolicyItem> policyItems = new ArrayList<RangerPolicyItem>(); RangerPolicyItem rangerPolicyItem = new RangerPolicyItem(); rangerPolicyItem.setAccesses(accesses); rangerPolicyItem.setConditions(conditions); rangerPolicyItem.setGroups(groups); rangerPolicyItem.setUsers(users); rangerPolicyItem.setDelegateAdmin(false); policyItems.add(rangerPolicyItem); Map<String, RangerPolicyResource> policyResource = new HashMap<String, RangerPolicyResource>(); RangerPolicyResource rangerPolicyResource = new RangerPolicyResource(); rangerPolicyResource.setIsExcludes(true); rangerPolicyResource.setIsRecursive(true); rangerPolicyResource.setValue("2"); rangerPolicyResource.setValues(users); policyResource.put("resource", rangerPolicyResource); RangerPolicy policy = new RangerPolicy(); policy.setId(Id2); policy.setCreateTime(new Date()); policy.setDescription("policy"); policy.setGuid("policyguid"); policy.setIsEnabled(true); policy.setName("HDFS_1-1-20150316062454"); policy.setUpdatedBy("Admin"); policy.setUpdateTime(new Date()); policy.setService("HDFS_1-1-20150316062454"); policy.setIsAuditEnabled(true); policy.setPolicyItems(policyItems); policy.setResources(policyResource); policy.setService("HDFS_2"); return policy; }
Example 8
Source File: TestServiceREST.java From ranger with Apache License 2.0 | 5 votes |
RangerPolicy rangerPolicy() { List<RangerPolicyItemAccess> accesses = new ArrayList<RangerPolicyItemAccess>(); List<String> users = new ArrayList<String>(); List<String> groups = new ArrayList<String>(); List<RangerPolicyItemCondition> conditions = new ArrayList<RangerPolicyItemCondition>(); List<RangerPolicyItem> policyItems = new ArrayList<RangerPolicyItem>(); RangerPolicyItem rangerPolicyItem = new RangerPolicyItem(); rangerPolicyItem.setAccesses(accesses); rangerPolicyItem.setConditions(conditions); rangerPolicyItem.setGroups(groups); rangerPolicyItem.setUsers(users); rangerPolicyItem.setDelegateAdmin(false); policyItems.add(rangerPolicyItem); Map<String, RangerPolicyResource> policyResource = new HashMap<String, RangerPolicyResource>(); RangerPolicyResource rangerPolicyResource = new RangerPolicyResource(); rangerPolicyResource.setIsExcludes(true); rangerPolicyResource.setIsRecursive(true); rangerPolicyResource.setValue("1"); rangerPolicyResource.setValues(users); policyResource.put("resource", rangerPolicyResource); RangerPolicy policy = new RangerPolicy(); policy.setId(Id); policy.setCreateTime(new Date()); policy.setDescription("policy"); policy.setGuid("policyguid"); policy.setIsEnabled(true); policy.setName("HDFS_1-1-20150316062453"); policy.setUpdatedBy("Admin"); policy.setUpdateTime(new Date()); policy.setService("HDFS_1-1-20150316062453"); policy.setIsAuditEnabled(true); policy.setPolicyItems(policyItems); policy.setResources(policyResource); return policy; }
Example 9
Source File: TestAssetREST.java From ranger with Apache License 2.0 | 5 votes |
private RangerPolicy rangerPolicy(Long id) { List<RangerPolicyItemAccess> accesses = new ArrayList<RangerPolicyItemAccess>(); List<String> users = new ArrayList<String>(); List<String> groups = new ArrayList<String>(); List<RangerPolicyItemCondition> conditions = new ArrayList<RangerPolicyItemCondition>(); List<RangerPolicyItem> policyItems = new ArrayList<RangerPolicyItem>(); RangerPolicyItem rangerPolicyItem = new RangerPolicyItem(); rangerPolicyItem.setAccesses(accesses); rangerPolicyItem.setConditions(conditions); rangerPolicyItem.setGroups(groups); rangerPolicyItem.setUsers(users); rangerPolicyItem.setDelegateAdmin(false); policyItems.add(rangerPolicyItem); Map<String, RangerPolicyResource> policyResource = new HashMap<String, RangerPolicyResource>(); RangerPolicyResource rangerPolicyResource = new RangerPolicyResource(); rangerPolicyResource.setIsExcludes(true); rangerPolicyResource.setIsRecursive(true); rangerPolicyResource.setValue("1"); rangerPolicyResource.setValues(users); policyResource.put("resource", rangerPolicyResource); RangerPolicy policy = new RangerPolicy(); policy.setId(id); policy.setCreateTime(new Date()); policy.setDescription("policy"); policy.setGuid("policyguid"); policy.setIsEnabled(true); policy.setName("HDFS_1-1-20150316062453"); policy.setUpdatedBy("Admin"); policy.setUpdateTime(new Date()); policy.setService("HDFS_1-1-20150316062453"); policy.setIsAuditEnabled(true); policy.setPolicyItems(policyItems); policy.setResources(policyResource); policy.setService("HDFS_1"); return policy; }
Example 10
Source File: TestXUserMgr.java From ranger with Apache License 2.0 | 5 votes |
private RangerPolicy rangerPolicy() { List<RangerPolicyItemAccess> accesses = new ArrayList<RangerPolicyItemAccess>(); List<String> users = new ArrayList<String>(); List<String> groups = new ArrayList<String>(); List<String> policyLabels = new ArrayList<String>(); List<RangerPolicyItemCondition> conditions = new ArrayList<RangerPolicyItemCondition>(); List<RangerPolicyItem> policyItems = new ArrayList<RangerPolicyItem>(); RangerPolicyItem rangerPolicyItem = new RangerPolicyItem(); rangerPolicyItem.setAccesses(accesses); rangerPolicyItem.setConditions(conditions); rangerPolicyItem.setGroups(groups); rangerPolicyItem.setUsers(users); rangerPolicyItem.setDelegateAdmin(false); policyItems.add(rangerPolicyItem); Map<String, RangerPolicyResource> policyResource = new HashMap<String, RangerPolicyResource>(); RangerPolicyResource rangerPolicyResource = new RangerPolicyResource(); rangerPolicyResource.setIsExcludes(true); rangerPolicyResource.setIsRecursive(true); rangerPolicyResource.setValue("1"); rangerPolicyResource.setValues(users); RangerPolicy policy = new RangerPolicy(); policy.setId(userId); policy.setCreateTime(new Date()); policy.setDescription("policy"); policy.setGuid("policyguid"); policy.setIsEnabled(true); policy.setName("HDFS_1-1-20150316062453"); policy.setUpdatedBy("Admin"); policy.setUpdateTime(new Date()); policy.setService("HDFS_1-1-20150316062453"); policy.setIsAuditEnabled(true); policy.setPolicyItems(policyItems); policy.setResources(policyResource); policy.setPolicyLabels(policyLabels); return policy; }
Example 11
Source File: TestServiceDBStore.java From ranger with Apache License 2.0 | 5 votes |
private RangerPolicy rangerPolicy() { List<RangerPolicyItemAccess> accesses = new ArrayList<RangerPolicyItemAccess>(); List<String> users = new ArrayList<String>(); List<String> groups = new ArrayList<String>(); List<String> policyLabels = new ArrayList<String>(); List<RangerPolicyItemCondition> conditions = new ArrayList<RangerPolicyItemCondition>(); List<RangerPolicyItem> policyItems = new ArrayList<RangerPolicyItem>(); RangerPolicyItem rangerPolicyItem = new RangerPolicyItem(); rangerPolicyItem.setAccesses(accesses); rangerPolicyItem.setConditions(conditions); rangerPolicyItem.setGroups(groups); rangerPolicyItem.setUsers(users); rangerPolicyItem.setDelegateAdmin(false); policyItems.add(rangerPolicyItem); Map<String, RangerPolicyResource> policyResource = new HashMap<String, RangerPolicyResource>(); RangerPolicyResource rangerPolicyResource = new RangerPolicyResource(); rangerPolicyResource.setIsExcludes(true); rangerPolicyResource.setIsRecursive(true); rangerPolicyResource.setValue("1"); rangerPolicyResource.setValues(users); RangerPolicy policy = new RangerPolicy(); policy.setId(Id); policy.setCreateTime(new Date()); policy.setDescription("policy"); policy.setGuid("policyguid"); policy.setIsEnabled(true); policy.setName("HDFS_1-1-20150316062453"); policy.setUpdatedBy("Admin"); policy.setUpdateTime(new Date()); policy.setService("HDFS_1-1-20150316062453"); policy.setIsAuditEnabled(true); policy.setPolicyItems(policyItems); policy.setResources(policyResource); policy.setPolicyLabels(policyLabels); return policy; }
Example 12
Source File: PatchForKafkaServiceDefUpdate_J10033.java From ranger with Apache License 2.0 | 4 votes |
private RangerPolicy getRangerPolicy(String newResource, XXPortalUser xxPortalUser, XXService xxService) { RangerPolicy policy = new RangerPolicy(); List<RangerPolicy.RangerPolicyItemAccess> accesses = getPolicyItemAccesses(); List<String> users = new ArrayList<>(DEFAULT_POLICY_USERS); List<String> groups = new ArrayList<>(DEFAULT_POLICY_GROUP); List<RangerPolicy.RangerPolicyItemCondition> conditions = new ArrayList<>(); List<RangerPolicy.RangerPolicyItem> policyItems = new ArrayList<>(); RangerPolicy.RangerPolicyItem rangerPolicyItem = new RangerPolicy.RangerPolicyItem(); rangerPolicyItem.setAccesses(accesses); rangerPolicyItem.setConditions(conditions); rangerPolicyItem.setGroups(groups); rangerPolicyItem.setUsers(users); rangerPolicyItem.setDelegateAdmin(false); policyItems.add(rangerPolicyItem); Map<String, RangerPolicy.RangerPolicyResource> policyResource = new HashMap<>(); RangerPolicy.RangerPolicyResource rangerPolicyResource = new RangerPolicy.RangerPolicyResource(); rangerPolicyResource.setIsExcludes(false); rangerPolicyResource.setIsRecursive(false); rangerPolicyResource.setValue("*"); String policyResourceName = CONSUMERGROUP_RESOURCE_NAME; policyResource.put(policyResourceName, rangerPolicyResource); policy.setCreateTime(new Date()); policy.setDescription(newResource); policy.setIsEnabled(true); policy.setName(newResource); policy.setCreatedBy(xxPortalUser.getLoginId()); policy.setUpdatedBy(xxPortalUser.getLoginId()); policy.setUpdateTime(new Date()); policy.setService(xxService.getName()); policy.setIsAuditEnabled(true); policy.setPolicyItems(policyItems); policy.setResources(policyResource); policy.setPolicyType(0); policy.setId(0L); policy.setGuid(""); policy.setPolicyLabels(new ArrayList<>()); policy.setVersion(1L); RangerPolicyResourceSignature resourceSignature = new RangerPolicyResourceSignature(policy); policy.setResourceSignature(resourceSignature.getSignature()); return policy; }
Example 13
Source File: PatchForKafkaServiceDefUpdate_J10025.java From ranger with Apache License 2.0 | 4 votes |
private RangerPolicy getRangerPolicy(String newResource, XXPortalUser xxPortalUser, XXService xxService) { RangerPolicy policy = new RangerPolicy(); List<RangerPolicy.RangerPolicyItemAccess> accesses = getPolicyItemAccesses(); List<String> users = new ArrayList<>(DEFAULT_POLICY_USERS); List<String> groups = new ArrayList<>(); List<RangerPolicy.RangerPolicyItemCondition> conditions = new ArrayList<>(); List<RangerPolicy.RangerPolicyItem> policyItems = new ArrayList<>(); RangerPolicy.RangerPolicyItem rangerPolicyItem = new RangerPolicy.RangerPolicyItem(); rangerPolicyItem.setAccesses(accesses); rangerPolicyItem.setConditions(conditions); rangerPolicyItem.setGroups(groups); rangerPolicyItem.setUsers(users); rangerPolicyItem.setDelegateAdmin(false); policyItems.add(rangerPolicyItem); Map<String, RangerPolicy.RangerPolicyResource> policyResource = new HashMap<>(); RangerPolicy.RangerPolicyResource rangerPolicyResource = new RangerPolicy.RangerPolicyResource(); rangerPolicyResource.setIsExcludes(false); rangerPolicyResource.setIsRecursive(false); rangerPolicyResource.setValue("*"); String policyResourceName = KAFKA_RESOURCE_CLUSTER; if ("all - delegationtoken".equals(newResource)) { policyResourceName = KAFKA_RESOURCE_DELEGATIONTOKEN; } policyResource.put(policyResourceName, rangerPolicyResource); policy.setCreateTime(new Date()); policy.setDescription(newResource); policy.setIsEnabled(true); policy.setName(newResource); policy.setCreatedBy(xxPortalUser.getLoginId()); policy.setUpdatedBy(xxPortalUser.getLoginId()); policy.setUpdateTime(new Date()); policy.setService(xxService.getName()); policy.setIsAuditEnabled(true); policy.setPolicyItems(policyItems); policy.setResources(policyResource); policy.setPolicyType(0); policy.setId(0L); policy.setGuid(""); policy.setPolicyLabels(new ArrayList<>()); policy.setVersion(1L); RangerPolicyResourceSignature resourceSignature = new RangerPolicyResourceSignature(policy); policy.setResourceSignature(resourceSignature.getSignature()); return policy; }
Example 14
Source File: PatchMigration_J10002.java From ranger with Apache License 2.0 | 4 votes |
private RangerPolicy mapXResourceToPolicy(RangerPolicy policy, XXResource xRes, RangerService service) { String serviceName = service.getName(); String serviceType = service.getType(); String name = xRes.getPolicyName(); String description = xRes.getDescription(); Boolean isAuditEnabled = true; Boolean isEnabled = true; Map<String, RangerPolicyResource> resources = new HashMap<String, RangerPolicyResource>(); List<RangerPolicyItem> policyItems = new ArrayList<RangerPolicyItem>(); XXServiceDef svcDef = daoMgr.getXXServiceDef().findByName(serviceType); if(svcDef == null) { logger.error(serviceType + ": service-def not found. Skipping policy '" + name + "'"); return null; } List<XXAuditMap> auditMapList = daoMgr.getXXAuditMap().findByResourceId(xRes.getId()); if (stringUtil.isEmpty(auditMapList)) { isAuditEnabled = false; } if (xRes.getResourceStatus() == AppConstants.STATUS_DISABLED) { isEnabled = false; } Boolean isPathRecursive = xRes.getIsRecursive() == RangerCommonEnums.BOOL_TRUE; Boolean isTableExcludes = xRes.getTableType() == RangerCommonEnums.POLICY_EXCLUSION; Boolean isColumnExcludes = xRes.getColumnType() == RangerCommonEnums.POLICY_EXCLUSION; if (StringUtils.equalsIgnoreCase(serviceType, "hdfs")) { toRangerResourceList(xRes.getName(), "path", Boolean.FALSE, isPathRecursive, resources); } else if (StringUtils.equalsIgnoreCase(serviceType, "hbase")) { toRangerResourceList(xRes.getTables(), "table", isTableExcludes, Boolean.FALSE, resources); toRangerResourceList(xRes.getColumnFamilies(), "column-family", Boolean.FALSE, Boolean.FALSE, resources); toRangerResourceList(xRes.getColumns(), "column", isColumnExcludes, Boolean.FALSE, resources); } else if (StringUtils.equalsIgnoreCase(serviceType, "hive")) { toRangerResourceList(xRes.getDatabases(), "database", Boolean.FALSE, Boolean.FALSE, resources); toRangerResourceList(xRes.getTables(), "table", isTableExcludes, Boolean.FALSE, resources); toRangerResourceList(xRes.getColumns(), "column", isColumnExcludes, Boolean.FALSE, resources); toRangerResourceList(xRes.getUdfs(), "udf", Boolean.FALSE, Boolean.FALSE, resources); } else if (StringUtils.equalsIgnoreCase(serviceType, "knox")) { toRangerResourceList(xRes.getTopologies(), "topology", Boolean.FALSE, Boolean.FALSE, resources); toRangerResourceList(xRes.getServices(), "service", Boolean.FALSE, Boolean.FALSE, resources); } else if (StringUtils.equalsIgnoreCase(serviceType, "storm")) { toRangerResourceList(xRes.getTopologies(), "topology", Boolean.FALSE, Boolean.FALSE, resources); } policyItems = getPolicyItemListForRes(xRes, svcDef); policy.setService(serviceName); policy.setName(name); policy.setDescription(description); policy.setIsAuditEnabled(isAuditEnabled); policy.setIsEnabled(isEnabled); policy.setResources(resources); policy.setPolicyItems(policyItems); policy.setCreateTime(xRes.getCreateTime()); policy.setUpdateTime(xRes.getUpdateTime()); XXPortalUser createdByUser = daoMgr.getXXPortalUser().getById(xRes.getAddedByUserId()); XXPortalUser updByUser = daoMgr.getXXPortalUser().getById(xRes.getUpdatedByUserId()); if (createdByUser != null) { policy.setCreatedBy(createdByUser.getLoginId()); } if (updByUser != null) { policy.setUpdatedBy(updByUser.getLoginId()); } policy.setId(xRes.getId()); return policy; }