ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spolavar...@apache.org
Subject [2/2] ranger git commit: RANGER-1985: Auditing for Ranger usersync operations
Date Tue, 06 Mar 2018 00:06:02 GMT
RANGER-1985: Auditing for Ranger usersync operations


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

Branch: refs/heads/master
Commit: 52f5249bbdc7f1bd8c8b3aa91d2040a9f63c47ee
Parents: 19d6ef4
Author: Sailaja Polavarapu <spolavarapu@hortonworks.com>
Authored: Mon Mar 5 16:05:34 2018 -0800
Committer: Sailaja Polavarapu <spolavarapu@hortonworks.com>
Committed: Mon Mar 5 16:05:34 2018 -0800

----------------------------------------------------------------------
 .../optimized/current/ranger_core_db_mysql.sql  |  20 ++
 ...31-create-schema-for-usersync-audit-info.sql |  37 ++++
 .../optimized/current/ranger_core_db_oracle.sql |  22 ++
 ...31-create-schema-for-usersync-audit-info.sql |  36 ++++
 .../current/ranger_core_db_postgres.sql         |  23 ++
 ...31-create-schema-for-usersync-audit-info.sql |  38 ++++
 .../current/ranger_core_db_sqlanywhere.sql      |  25 +++
 ...31-create-schema-for-usersync-audit-info.sql |  38 ++++
 .../current/ranger_core_db_sqlserver.sql        |  38 ++++
 ...31-create-schema-for-usersync-audit-info.sql |  65 ++++++
 .../java/org/apache/ranger/biz/AssetMgr.java    |  65 ++++--
 .../java/org/apache/ranger/biz/XUserMgr.java    |  49 ++---
 .../org/apache/ranger/common/AppConstants.java  |   6 +-
 .../apache/ranger/db/RangerDaoManagerBase.java  |  10 +
 .../apache/ranger/db/XXUgsyncAuditInfoDao.java  |  72 +++++++
 .../apache/ranger/entity/XXUgsyncAuditInfo.java | 210 +++++++++++++++++++
 .../java/org/apache/ranger/rest/AssetREST.java  |  54 +++--
 .../java/org/apache/ranger/rest/XUserREST.java  |  37 +---
 .../ranger/security/context/RangerAPIList.java  |   4 +-
 .../ranger/service/XUgsyncAuditInfoService.java | 182 ++++++++++++++++
 .../service/XUgsyncAuditInfoServiceBase.java    |  57 +++++
 .../ranger/view/VXFileSyncSourceInfo.java       |  87 ++++++++
 .../ranger/view/VXLdapSyncSourceInfo.java       | 108 ++++++++++
 .../apache/ranger/view/VXUgsyncAuditInfo.java   | 141 +++++++++++++
 .../ranger/view/VXUgsyncAuditInfoList.java      |  83 ++++++++
 .../ranger/view/VXUnixSyncSourceInfo.java       | 117 +++++++++++
 .../resources/META-INF/jpa_named_queries.xml    |  13 ++
 .../src/main/resources/META-INF/persistence.xml |   1 +
 .../process/LdapDeltaUserGroupBuilder.java      |  42 +++-
 .../process/LdapPolicyMgrUserGroupBuilder.java  |  75 ++++++-
 .../process/LdapUserGroupBuilder.java           |  34 ++-
 .../unixusersync/model/FileSyncSourceInfo.java  |  65 ++++++
 .../unixusersync/model/LdapSyncSourceInfo.java  |  85 ++++++++
 .../unixusersync/model/UgsyncAuditInfo.java     | 114 ++++++++++
 .../unixusersync/model/UnixSyncSourceInfo.java  |  95 +++++++++
 .../process/FileSourceUserGroupBuilder.java     |  19 +-
 .../process/PolicyMgrUserGroupBuilder.java      | 100 +++++++--
 .../process/UnixUserGroupBuilder.java           |  21 ++
 .../ranger/usergroupsync/UserGroupSink.java     |   4 +
 39 files changed, 2173 insertions(+), 119 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql b/security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql
index 9e8fcad..7892a6a 100644
--- a/security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql
+++ b/security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql
@@ -80,6 +80,25 @@ CREATE TABLE `x_db_version_h`  (
         `active`          	ENUM('Y', 'N') DEFAULT 'Y'
 )ROW_FORMAT=DYNAMIC;
 
+CREATE TABLE IF NOT EXISTS `x_ugsync_audit_info`(
+`id` bigint(20) NOT NULL AUTO_INCREMENT,
+`create_time` datetime NULL DEFAULT NULL,
+`update_time` datetime NULL DEFAULT NULL,
+`added_by_id` bigint(20) NULL DEFAULT NULL,
+`upd_by_id` bigint(20) NULL DEFAULT NULL,
+`event_time` datetime NULL DEFAULT NULL,
+`user_name` varchar(255) NOT  NULL,
+`sync_source` varchar(128) NOT NULL,
+`no_of_users` bigint(20) NOT NULL,
+`no_of_groups` bigint(20) NOT NULL,
+`sync_source_info` varchar(4000) NOT NULL,
+`session_id` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `x_ugsync_audit_info_etime`(`event_time`),
+ KEY `x_ugsync_audit_info_sync_src`(`sync_source`),
+ KEY `x_ugsync_audit_info_uname`(`user_name`)
+)ROW_FORMAT=DYNAMIC;
+
 CREATE TABLE `x_portal_user` (
   `id` bigint(20) NOT NULL AUTO_INCREMENT,
   `create_time` datetime DEFAULT NULL,
@@ -1320,6 +1339,7 @@ INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active
 INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('028',UTC_TIMESTAMP(),'Ranger 1.0.0',UTC_TIMESTAMP(),'localhost','Y');
 INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('029',UTC_TIMESTAMP(),'Ranger 1.0.0',UTC_TIMESTAMP(),'localhost','Y');
 INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('030',UTC_TIMESTAMP(),'Ranger 1.0.0',UTC_TIMESTAMP(),'localhost','Y');
+INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('031',UTC_TIMESTAMP(),'Ranger 1.0.0',UTC_TIMESTAMP(),'localhost','Y');
 INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('DB_PATCHES',UTC_TIMESTAMP(),'Ranger 1.0.0',UTC_TIMESTAMP(),'localhost','Y');
 INSERT INTO x_user_module_perm (user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (1,3,UTC_TIMESTAMP(),UTC_TIMESTAMP(),1,1,1);
 INSERT INTO x_user_module_perm (user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (1,1,UTC_TIMESTAMP(),UTC_TIMESTAMP(),1,1,1);

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/db/mysql/patches/031-create-schema-for-usersync-audit-info.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/mysql/patches/031-create-schema-for-usersync-audit-info.sql b/security-admin/db/mysql/patches/031-create-schema-for-usersync-audit-info.sql
new file mode 100644
index 0000000..2405a3e
--- /dev/null
+++ b/security-admin/db/mysql/patches/031-create-schema-for-usersync-audit-info.sql
@@ -0,0 +1,37 @@
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements.  See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License.  You may obtain a copy of the License at
+--
+--     http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+
+DROP TABLE IF EXISTS `x_ugsync_audit_info`;
+
+
+CREATE TABLE IF NOT EXISTS `x_ugsync_audit_info`(
+`id` bigint(20) NOT NULL AUTO_INCREMENT,
+`create_time` datetime NULL DEFAULT NULL,
+`update_time` datetime NULL DEFAULT NULL,
+`added_by_id` bigint(20) NULL DEFAULT NULL,
+`upd_by_id` bigint(20) NULL DEFAULT NULL,
+`event_time` datetime NULL DEFAULT NULL,
+`user_name` varchar(255) NOT  NULL,
+`sync_source` varchar(128) NOT NULL,
+`no_of_users` bigint(20) NOT NULL,
+`no_of_groups` bigint(20) NOT NULL,
+`sync_source_info` varchar(4000) NOT NULL,
+`session_id` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `x_ugsync_audit_info_etime`(`event_time`),
+ KEY `x_ugsync_audit_info_sync_src`(`sync_source`),
+ KEY `x_ugsync_audit_info_uname`(`user_name`)
+)DEFAULT CHARSET=latin1;
+

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql b/security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql
index 55d44a1..1f03978 100644
--- a/security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql
+++ b/security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql
@@ -71,6 +71,7 @@ CREATE SEQUENCE X_SERVICE_VERSION_INFO_SEQ START WITH 1 INCREMENT BY 1 NOCACHE N
 CREATE SEQUENCE X_PLUGIN_INFO_SEQ START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
 CREATE SEQUENCE X_POLICY_LABEL_MAP_SEQ START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
 CREATE SEQUENCE X_POLICY_LABEL_SEQ START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
+CREATE SEQUENCE X_UGSYNC_AUDIT_INFO_SEQ START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
 --CREATE SEQUENCE X_DB_VERSION_H_SEQ START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
 commit;
 
@@ -1094,6 +1095,23 @@ CONSTRAINT x_plmap_FK_policy_label_id FOREIGN KEY (policy_label_id) REFERENCES x
 );
 commit;
 
+CREATE TABLE x_ugsync_audit_info(
+id NUMBER(20) NOT NULL,
+create_time DATE DEFAULT NULL NULL,
+update_time DATE DEFAULT NULL NULL,
+added_by_id NUMBER(20) DEFAULT NULL NULL,
+upd_by_id NUMBER(20) DEFAULT NULL NULL,
+event_time DATE DEFAULT NULL NULL,
+user_name VARCHAR(255) NOT  NULL,
+sync_source VARCHAR(128) NOT NULL,
+no_of_users NUMBER(20) NOT NULL,
+no_of_groups NUMBER(20) NOT NULL,
+sync_source_info VARCHAR(4000) NOT NULL,
+session_id VARCHAR(255) DEFAULT NULL,
+ PRIMARY KEY (id)
+);
+commit;
+
 CREATE VIEW vx_trx_log AS select x_trx_log.id AS id,x_trx_log.create_time AS create_time,x_trx_log.update_time AS update_time,x_trx_log.added_by_id AS added_by_id,x_trx_log.upd_by_id AS upd_by_id,x_trx_log.class_type AS class_type,x_trx_log.object_id AS object_id,x_trx_log.parent_object_id AS parent_object_id,x_trx_log.parent_object_class_type AS parent_object_class_type,x_trx_log.attr_name AS attr_name,x_trx_log.parent_object_name AS parent_object_name,x_trx_log.object_name AS object_name,x_trx_log.prev_val AS prev_val,x_trx_log.new_val AS new_val,x_trx_log.trx_id AS trx_id,x_trx_log.action AS action,x_trx_log.sess_id AS sess_id,x_trx_log.req_id AS req_id,x_trx_log.sess_type AS sess_type from x_trx_log  where id in(select min(x_trx_log.id) from x_trx_log group by x_trx_log.trx_id);
 commit;
 
@@ -1250,6 +1268,9 @@ CREATE INDEX x_plc_item_rf_IDX_plc_item_id ON x_policy_item_rowfilter(policy_ite
 CREATE INDEX x_svc_ver_info_IDX_service_id ON x_service_version_info(service_id);
 CREATE INDEX x_plugin_info_IDX_service_name ON x_plugin_info(service_name);
 CREATE INDEX x_plugin_info_IDX_host_name ON x_plugin_info(host_name);
+CREATE INDEX x_ugsync_audit_info_etime ON x_ugsync_audit_info(event_time);
+CREATE INDEX x_ugsync_audit_info_sync_src ON x_ugsync_audit_info(sync_source);
+CREATE INDEX x_ugsync_audit_info_uname ON x_ugsync_audit_info(user_name);
 commit;
 
 insert into x_portal_user (id,CREATE_TIME, UPDATE_TIME,FIRST_NAME, LAST_NAME, PUB_SCR_NAME, LOGIN_ID, PASSWORD, EMAIL, STATUS) values (X_PORTAL_USER_SEQ.NEXTVAL, SYSDATE, SYSDATE, 'Admin', '', 'Admin', 'admin', 'ceb4f32325eda6142bd65215f4c0f371', '', 1);
@@ -1294,6 +1315,7 @@ INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,act
 INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,active) VALUES (X_DB_VERSION_H_SEQ.nextval, '028',sys_extract_utc(systimestamp),'Ranger 1.0.0',sys_extract_utc(systimestamp),'localhost','Y');
 INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,active) VALUES (X_DB_VERSION_H_SEQ.nextval, '029',sys_extract_utc(systimestamp),'Ranger 1.0.0',sys_extract_utc(systimestamp),'localhost','Y');
 INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,active) VALUES (X_DB_VERSION_H_SEQ.nextval, '030',sys_extract_utc(systimestamp),'Ranger 1.0.0',sys_extract_utc(systimestamp),'localhost','Y');
+INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,active) VALUES (X_DB_VERSION_H_SEQ.nextval, '031',sys_extract_utc(systimestamp),'Ranger 1.0.0',sys_extract_utc(systimestamp),'localhost','Y');
 INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,active) VALUES (X_DB_VERSION_H_SEQ.nextval, 'DB_PATCHES',sys_extract_utc(systimestamp),'Ranger 1.0.0',sys_extract_utc(systimestamp),'localhost','Y');
 INSERT INTO x_user_module_perm (id,user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (X_USER_MODULE_PERM_SEQ.nextval,1,3,sys_extract_utc(systimestamp),sys_extract_utc(systimestamp),1,1,1);
 INSERT INTO x_user_module_perm (id,user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (X_USER_MODULE_PERM_SEQ.nextval,1,1,sys_extract_utc(systimestamp),sys_extract_utc(systimestamp),1,1,1);

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/db/oracle/patches/031-create-schema-for-usersync-audit-info.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/oracle/patches/031-create-schema-for-usersync-audit-info.sql b/security-admin/db/oracle/patches/031-create-schema-for-usersync-audit-info.sql
new file mode 100644
index 0000000..e03e893
--- /dev/null
+++ b/security-admin/db/oracle/patches/031-create-schema-for-usersync-audit-info.sql
@@ -0,0 +1,36 @@
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements.  See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License.  You may obtain a copy of the License at
+--
+--     http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+
+/
+CREATE SEQUENCE X_UGSYNC_AUDIT_INFO_SEQ START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
+CREATE TABLE x_ugsync_audit_info(
+id NUMBER(20) NOT NULL,
+create_time DATE DEFAULT NULL NULL,
+update_time DATE DEFAULT NULL NULL,
+added_by_id NUMBER(20) DEFAULT NULL NULL,
+upd_by_id NUMBER(20) DEFAULT NULL NULL,
+event_time DATE DEFAULT NULL NULL,
+user_name VARCHAR(255) NOT  NULL,
+sync_source VARCHAR(128) NOT NULL,
+no_of_users NUMBER(20) NOT NULL,
+no_of_groups NUMBER(20) NOT NULL,
+sync_source_info VARCHAR(4000) NOT NULL,
+session_id VARCHAR(255) DEFAULT NULL,
+ PRIMARY KEY (id)
+);
+CREATE INDEX x_ugsync_audit_info_etime ON x_ugsync_audit_info(event_time);
+CREATE INDEX x_ugsync_audit_info_sync_src ON x_ugsync_audit_info(sync_source);
+CREATE INDEX x_ugsync_audit_info_uname ON x_ugsync_audit_info(user_name);
+COMMIT;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql b/security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql
index ef9ece7..5b3f4be 100644
--- a/security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql
+++ b/security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql
@@ -1209,6 +1209,25 @@ CONSTRAINT x_policy_label_map_FK_policy_id FOREIGN KEY (policy_id) REFERENCES x_
 CONSTRAINT x_policy_label_map_FK_policy_label_id FOREIGN KEY (policy_label_id) REFERENCES x_policy_label (id)
 );
 
+DROP TABLE IF EXISTS x_ugsync_audit_info CASCADE;
+DROP SEQUENCE IF EXISTS x_ugsync_audit_info_seq;
+CREATE SEQUENCE x_ugsync_audit_info_seq;
+CREATE TABLE x_ugsync_audit_info (
+id BIGINT DEFAULT nextval('x_ugsync_audit_info_seq'::regclass),
+create_time TIMESTAMP DEFAULT NULL NULL,
+update_time TIMESTAMP DEFAULT NULL NULL,
+added_by_id BIGINT DEFAULT NULL NULL,
+upd_by_id BIGINT DEFAULT NULL NULL,
+event_time TIMESTAMP DEFAULT NULL NULL,
+user_name varchar(255) NOT  NULL,
+sync_source varchar(128) NOT NULL,
+no_of_users bigint(20) NOT NULL,
+no_of_groups bigint(20) NOT NULL,
+sync_source_info varchar(4000) NOT NULL,
+session_id varchar(255) DEFAULT NULL,
+primary key (id),
+);
+
 CREATE INDEX xa_access_audit_added_by_id ON xa_access_audit(added_by_id);
 CREATE INDEX xa_access_audit_upd_by_id ON xa_access_audit(upd_by_id);
 CREATE INDEX xa_access_audit_cr_time ON xa_access_audit(create_time);
@@ -1365,6 +1384,9 @@ CREATE INDEX x_plugin_info_IDX_host_name ON x_plugin_info(host_name);
 CREATE INDEX x_policy_label_label_id ON x_policy_label(id);
 CREATE INDEX x_policy_label_label_name ON x_policy_label(label_name);
 CREATE INDEX x_policy_label_label_map_id ON x_policy_label_map(id);
+CREATE INDEX x_ugsync_audit_info_etime ON x_ugsync_audit_info(event_time);
+CREATE INDEX x_ugsync_audit_info_sync_src ON x_ugsync_audit_info(sync_source);
+CREATE INDEX x_ugsync_audit_info_uname ON x_ugsync_audit_info(user_name);
 
 INSERT INTO x_portal_user(CREATE_TIME,UPDATE_TIME,FIRST_NAME,LAST_NAME,PUB_SCR_NAME,LOGIN_ID,PASSWORD,EMAIL,STATUS)VALUES(current_timestamp,current_timestamp,'Admin','','Admin','admin','ceb4f32325eda6142bd65215f4c0f371','',1);
 INSERT INTO x_portal_user_role(CREATE_TIME,UPDATE_TIME,USER_ID,USER_ROLE,STATUS)VALUES(current_timestamp,current_timestamp,1,'ROLE_SYS_ADMIN',1);
@@ -1406,6 +1428,7 @@ INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active
 INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('028',current_timestamp,'Ranger 1.0.0',current_timestamp,'localhost','Y');
 INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('029',current_timestamp,'Ranger 1.0.0',current_timestamp,'localhost','Y');
 INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('030',current_timestamp,'Ranger 1.0.0',current_timestamp,'localhost','Y');
+INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('031',current_timestamp,'Ranger 1.0.0',current_timestamp,'localhost','Y');
 INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('DB_PATCHES',current_timestamp,'Ranger 1.0.0',current_timestamp,'localhost','Y');
 INSERT INTO x_user_module_perm (user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (1,3,current_timestamp,current_timestamp,1,1,1);
 INSERT INTO x_user_module_perm (user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (1,1,current_timestamp,current_timestamp,1,1,1);

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/db/postgres/patches/031-create-schema-for-usersync-audit-info.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/postgres/patches/031-create-schema-for-usersync-audit-info.sql b/security-admin/db/postgres/patches/031-create-schema-for-usersync-audit-info.sql
new file mode 100644
index 0000000..2227f01
--- /dev/null
+++ b/security-admin/db/postgres/patches/031-create-schema-for-usersync-audit-info.sql
@@ -0,0 +1,38 @@
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements.  See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License.  You may obtain a copy of the License at
+--
+--     http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+
+DROP TABLE IF EXISTS x_ugsync_audit_info CASCADE;
+DROP SEQUENCE IF EXISTS x_ugsync_audit_info_seq;
+
+CREATE SEQUENCE x_ugsync_audit_info_seq;
+
+CREATE TABLE x_ugsync_audit_info (
+id BIGINT DEFAULT nextval('x_ugsync_audit_info_seq'::regclass),
+create_time TIMESTAMP DEFAULT NULL NULL,
+update_time TIMESTAMP DEFAULT NULL NULL,
+added_by_id BIGINT DEFAULT NULL NULL,
+upd_by_id BIGINT DEFAULT NULL NULL,
+event_time TIMESTAMP DEFAULT NULL NULL,
+user_name varchar(255) NOT  NULL,
+sync_source varchar(128) NOT NULL,
+no_of_users bigint NOT NULL,
+no_of_groups bigint NOT NULL,
+sync_source_info varchar(4000) NOT NULL,
+session_id varchar(255) DEFAULT NULL,
+primary key (id)
+);
+CREATE INDEX x_ugsync_audit_info_etime ON x_ugsync_audit_info(event_time);
+CREATE INDEX x_ugsync_audit_info_sync_src ON x_ugsync_audit_info(sync_source);
+CREATE INDEX x_ugsync_audit_info_uname ON x_ugsync_audit_info(user_name);

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql b/security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql
index c98d362..42a8704 100644
--- a/security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql
+++ b/security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql
@@ -867,6 +867,23 @@ CREATE TABLE dbo.x_policy_label_map (
         CONSTRAINT x_policy_label_map_PK_id PRIMARY KEY CLUSTERED(id)
 )
 GO
+CREATE TABLE dbo.x_ugsync_audit_info(
+        id bigint IDENTITY NOT NULL,
+        create_time datetime DEFAULT NULL NULL,
+        update_time datetime DEFAULT NULL NULL,
+        added_by_id bigint DEFAULT NULL NULL,
+        upd_by_id bigint DEFAULT NULL NULL,
+        event_time datetime DEFAULT NULL NULL,
+        user_name varchar(255) NOT  NULL,
+        sync_source varchar(128) NOT NULL,
+        no_of_users bigint NOT NULL,
+        no_of_groups bigint NOT NULL,
+        sync_source_info varchar(4000) NOT NULL,
+        session_id varchar(255) DEFAULT NULL NULL,
+        CONSTRAINT x_ugsync_audit_info_PK_id PRIMARY KEY CLUSTERED(id)
+)
+GO
+
 ALTER TABLE dbo.x_asset ADD CONSTRAINT x_asset_FK_added_by_id FOREIGN KEY(added_by_id) REFERENCES dbo.x_portal_user(id)
 GO
 ALTER TABLE dbo.x_asset ADD CONSTRAINT x_asset_FK_upd_by_id FOREIGN KEY(upd_by_id) REFERENCES dbo.x_portal_user (id)
@@ -1489,6 +1506,12 @@ CREATE NONCLUSTERED INDEX x_policy_label_IDX_label_name ON dbo.x_policy_label(la
 GO
 CREATE NONCLUSTERED INDEX x_policy_label_IDX_label_map_id ON dbo.x_policy_label_map(id ASC)
 GO
+CREATE NONCLUSTERED INDEX x_ugsync_audit_info_etime ON dbo.x_ugsync_audit_info(event_time ASC)
+GO
+CREATE NONCLUSTERED INDEX x_ugsync_audit_info_sync_src ON dbo.x_ugsync_audit_info(sync_source ASC)
+GO
+CREATE NONCLUSTERED INDEX x_ugsync_audit_info_uname ON dbo.x_ugsync_audit_info(user_name ASC)
+GO
 insert into x_portal_user (create_time,update_time,first_name,last_name,pub_scr_name,login_id,password,email,status) values (GETDATE(),GETDATE(),'Admin','','Admin','admin','ceb4f32325eda6142bd65215f4c0f371','',1)
 GO
 insert into x_portal_user_role (create_time,update_time,user_id,user_role,status) values (GETDATE(),GETDATE(),1,'ROLE_SYS_ADMIN',1)
@@ -1557,6 +1580,8 @@ INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active
 GO
 INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('030',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
 GO
+INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('031',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
+GO
 INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('DB_PATCHES',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
 GO
 INSERT INTO x_user_module_perm (user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (1,3,CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,1,1,1);

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/db/sqlanywhere/patches/031-create-schema-for-usersync-audit-info.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/sqlanywhere/patches/031-create-schema-for-usersync-audit-info.sql b/security-admin/db/sqlanywhere/patches/031-create-schema-for-usersync-audit-info.sql
new file mode 100644
index 0000000..26d857b
--- /dev/null
+++ b/security-admin/db/sqlanywhere/patches/031-create-schema-for-usersync-audit-info.sql
@@ -0,0 +1,38 @@
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements.  See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License.  You may obtain a copy of the License at
+--
+--     http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+
+CREATE TABLE dbo.x_ugsync_audit_info(
+        id bigint IDENTITY NOT NULL,
+        create_time datetime DEFAULT NULL NULL,
+        update_time datetime DEFAULT NULL NULL,
+        added_by_id bigint DEFAULT NULL NULL,
+        upd_by_id bigint DEFAULT NULL NULL,
+        event_time datetime DEFAULT NULL NULL,
+        user_name varchar(255) NOT  NULL,
+        sync_source varchar(128) NOT NULL,
+        no_of_users bigint NOT NULL,
+        no_of_groups bigint NOT NULL,
+        sync_source_info varchar(4000) NOT NULL,
+        session_id varchar(255) DEFAULT NULL NULL,
+        CONSTRAINT x_ugsync_audit_info_PK_id PRIMARY KEY CLUSTERED(id)
+)
+GO
+CREATE NONCLUSTERED INDEX x_ugsync_audit_info_etime ON dbo.x_ugsync_audit_info(event_time ASC)
+GO
+CREATE NONCLUSTERED INDEX x_ugsync_audit_info_sync_src ON dbo.x_ugsync_audit_info(sync_source ASC)
+GO
+CREATE NONCLUSTERED INDEX x_ugsync_audit_info_uname ON dbo.x_ugsync_audit_info(user_name ASC)
+GO
+exit

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql b/security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql
index 61e81a0..7421d4d 100644
--- a/security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql
+++ b/security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql
@@ -681,6 +681,10 @@ IF (OBJECT_ID('x_portal_user') IS NOT NULL)
 BEGIN
     DROP TABLE [dbo].[x_portal_user]
 END
+IF (OBJECT_ID('x_ugsync_audit_info') IS NOT NULL)
+BEGIN
+    DROP TABLE [dbo].[x_ugsync_audit_info]
+END
 IF (OBJECT_ID('x_db_version_h') IS NOT NULL)
 BEGIN
     DROP TABLE [dbo].[x_db_version_h]
@@ -1869,6 +1873,27 @@ CREATE TABLE dbo.x_policy_label_map (
 SET ANSI_NULLS ON
 SET QUOTED_IDENTIFIER ON
 SET ANSI_PADDING ON
+CREATE TABLE [dbo].[x_ugsync_audit_info](
+        [id] [bigint] IDENTITY(1,1) NOT NULL,
+        [create_time] [datetime2] DEFAULT NULL NULL,
+        [update_time] [datetime2] DEFAULT NULL NULL,
+        [added_by_id] [bigint] DEFAULT NULL NULL,
+        [upd_by_id] [bigint] DEFAULT NULL NULL,
+        [event_time] [datetime2] DEFAULT NULL NULL,
+        [user_name] [varchar](255) NOT  NULL,
+        [sync_source] [varchar](128) NOT NULL,
+        [no_of_users] [bigint] NOT NULL,
+        [no_of_groups] [bigint] NOT NULL,
+        [sync_source_info] [varchar](4000) NOT NULL,
+        [session_id] [varchar](255) DEFAULT NULL NULL,
+        PRIMARY KEY CLUSTERED
+(
+        [id] ASC
+)WITH (PAD_INDEX = OFF,STATISTICS_NORECOMPUTE = OFF,IGNORE_DUP_KEY = OFF,ALLOW_ROW_LOCKS = ON,ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
+) ON [PRIMARY]
+SET ANSI_NULLS ON
+SET QUOTED_IDENTIFIER ON
+SET ANSI_PADDING ON
 
 ALTER TABLE [dbo].[x_asset]  WITH CHECK ADD  CONSTRAINT [x_asset_FK_added_by_id] FOREIGN KEY([added_by_id])
 REFERENCES [dbo].[x_portal_user] ([id])
@@ -3023,6 +3048,18 @@ CREATE NONCLUSTERED INDEX x_policy_label_IDX_label_map_id ON [dbo].[x_policy_lab
 (
 [id] ASC
 )WITH (SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF) ON [PRIMARY]
+CREATE NONCLUSTERED INDEX [x_ugsync_audit_info_etime] ON [x_ugsync_audit_info]
+(
+   [event_time] ASC
+)WITH (SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF) ON [PRIMARY]
+CREATE NONCLUSTERED INDEX [x_ugsync_audit_info_sync_src] ON [x_ugsync_audit_info]
+(
+   [sync_source] ASC
+)WITH (SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF) ON [PRIMARY]
+CREATE NONCLUSTERED INDEX [x_ugsync_audit_info_uname] ON [x_ugsync_audit_info]
+(
+   [user_name] ASC
+)WITH (SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF) ON [PRIMARY]
 
 insert into x_portal_user (CREATE_TIME,UPDATE_TIME,FIRST_NAME,LAST_NAME,PUB_SCR_NAME,LOGIN_ID,PASSWORD,EMAIL,STATUS) values (CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,'Admin','','Admin','admin','ceb4f32325eda6142bd65215f4c0f371','',1);
 insert into x_portal_user_role (CREATE_TIME,UPDATE_TIME,USER_ID,USER_ROLE,STATUS) values (CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,1,'ROLE_SYS_ADMIN',1);
@@ -3058,6 +3095,7 @@ INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active
 INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('028',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
 INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('029',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
 INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('030',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
+INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('031',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
 INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('DB_PATCHES',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
 INSERT INTO x_user_module_perm (user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (1,3,CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,1,1,1);
 INSERT INTO x_user_module_perm (user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (1,1,CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,1,1,1);

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/db/sqlserver/patches/031-create-schema-for-usersync-audit-info.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/sqlserver/patches/031-create-schema-for-usersync-audit-info.sql b/security-admin/db/sqlserver/patches/031-create-schema-for-usersync-audit-info.sql
new file mode 100644
index 0000000..362f415
--- /dev/null
+++ b/security-admin/db/sqlserver/patches/031-create-schema-for-usersync-audit-info.sql
@@ -0,0 +1,65 @@
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements.  See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License.  You may obtain a copy of the License at
+--
+--     http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+
+GO
+IF (OBJECT_ID('x_ugsync_audit_info') IS NOT NULL)
+BEGIN
+    DROP TABLE [dbo].[x_ugsync_audit_info]
+END
+GO
+SET ANSI_NULLS ON
+GO
+SET QUOTED_IDENTIFIER ON
+GO
+SET ANSI_PADDING ON
+GO
+CREATE TABLE [dbo].[x_ugsync_audit_info](
+        [id] [bigint] IDENTITY(1,1) NOT NULL,
+        [create_time] [datetime2] DEFAULT NULL NULL,
+        [update_time] [datetime2] DEFAULT NULL NULL,
+        [added_by_id] [bigint] DEFAULT NULL NULL,
+        [upd_by_id] [bigint] DEFAULT NULL NULL,
+        [event_time] [datetime2] DEFAULT NULL NULL,
+        [user_name] [varchar](255) NOT  NULL,
+        [sync_source] [varchar](128) NOT NULL,
+        [no_of_users] [bigint] NOT NULL,
+        [no_of_groups] [bigint] NOT NULL,
+        [sync_source_info] [varchar](4000) NOT NULL,
+        [session_id] [varchar](255) DEFAULT NULL NULL,
+        PRIMARY KEY CLUSTERED
+(
+        [id] ASC
+)WITH (PAD_INDEX = OFF,STATISTICS_NORECOMPUTE = OFF,IGNORE_DUP_KEY = OFF,ALLOW_ROW_LOCKS = ON,ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
+) ON [PRIMARY]
+GO
+CREATE NONCLUSTERED INDEX [x_ugsync_audit_info_etime] ON [x_ugsync_audit_info]
+(
+   [event_time] ASC
+)
+WITH (SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF) ON [PRIMARY]
+GO
+CREATE NONCLUSTERED INDEX [x_ugsync_audit_info_sync_src] ON [x_ugsync_audit_info]
+(
+   [sync_source] ASC
+)
+WITH (SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF) ON [PRIMARY]
+GO
+CREATE NONCLUSTERED INDEX [x_ugsync_audit_info_uname] ON [x_ugsync_audit_info]
+(
+   [user_name] ASC
+)
+WITH (SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF) ON [PRIMARY]
+GO
+exit

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/src/main/java/org/apache/ranger/biz/AssetMgr.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/biz/AssetMgr.java b/security-admin/src/main/java/org/apache/ranger/biz/AssetMgr.java
index 034053d..15937c7 100644
--- a/security-admin/src/main/java/org/apache/ranger/biz/AssetMgr.java
+++ b/security-admin/src/main/java/org/apache/ranger/biz/AssetMgr.java
@@ -55,26 +55,10 @@ import org.apache.ranger.entity.XXTrxLog;
 import org.apache.ranger.entity.XXUser;
 import org.apache.ranger.plugin.model.RangerPluginInfo;
 import org.apache.ranger.plugin.util.RangerRESTUtils;
-import org.apache.ranger.service.RangerPluginActivityLogger;
-import org.apache.ranger.service.RangerPluginInfoService;
-import org.apache.ranger.service.XAccessAuditService;
-import org.apache.ranger.service.XAuditMapService;
-import org.apache.ranger.service.XGroupService;
-import org.apache.ranger.service.XPermMapService;
-import org.apache.ranger.service.XPolicyService;
-import org.apache.ranger.service.XTrxLogService;
-import org.apache.ranger.service.XUserService;
+import org.apache.ranger.service.*;
 import org.apache.ranger.solr.SolrAccessAuditsService;
 import org.apache.ranger.util.RestUtil;
-import org.apache.ranger.view.VXAccessAuditList;
-import org.apache.ranger.view.VXAsset;
-import org.apache.ranger.view.VXAuditMap;
-import org.apache.ranger.view.VXPermMap;
-import org.apache.ranger.view.VXPolicyExportAuditList;
-import org.apache.ranger.view.VXResource;
-import org.apache.ranger.view.VXTrxLog;
-import org.apache.ranger.view.VXTrxLogList;
-import org.apache.ranger.view.VXUser;
+import org.apache.ranger.view.*;
 import org.codehaus.jackson.JsonGenerationException;
 import org.codehaus.jackson.map.JsonMappingException;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -131,6 +115,9 @@ public class AssetMgr extends AssetMgrBase {
 	@Autowired
 	RangerPluginInfoService pluginInfoService;
 
+	@Autowired
+	XUgsyncAuditInfoService xUgsyncAuditInfoService;
+
 	private static final Logger logger = Logger.getLogger(AssetMgr.class);
 
 	public File getXResourceFile(Long id, String fileType) {
@@ -1098,4 +1085,46 @@ public class AssetMgr extends AssetMgrBase {
         }
         return xPolicyExportAuditService.searchXPolicyExportAudits(searchCriteria);
     }
+
+	public VXUgsyncAuditInfoList getUgsyncAudits(SearchCriteria searchCriteria) {
+
+		if (searchCriteria == null) {
+			searchCriteria = new SearchCriteria();
+		}
+		if (searchCriteria.getParamList() != null
+				&& !searchCriteria.getParamList().isEmpty()) {
+			int clientTimeOffsetInMinute = RestUtil.getClientTimeOffset();
+			Date temp = null;
+			DateUtil dateUtil = new DateUtil();
+			if (searchCriteria.getParamList().containsKey("startDate")) {
+				temp = (Date) searchCriteria.getParamList().get(
+						"startDate");
+				temp = dateUtil.getDateFromGivenDate(temp, 0, 0, 0, 0);
+				temp = dateUtil.addTimeOffset(temp, clientTimeOffsetInMinute);
+				searchCriteria.getParamList().put("startDate", temp);
+			}
+			if (searchCriteria.getParamList().containsKey("endDate")) {
+				temp = (Date) searchCriteria.getParamList().get(
+						"endDate");
+				temp = dateUtil.getDateFromGivenDate(temp, 0, 23, 59, 59);
+				temp = dateUtil.addTimeOffset(temp, clientTimeOffsetInMinute);
+				searchCriteria.getParamList().put("endDate", temp);
+			}
+
+		}
+		if (searchCriteria.getSortType() == null) {
+			searchCriteria.setSortType("desc");
+		} else if (!"asc".equalsIgnoreCase(searchCriteria.getSortType()) && !"desc".equalsIgnoreCase(searchCriteria.getSortType())) {
+			searchCriteria.setSortType("desc");
+		}
+		return xUgsyncAuditInfoService.searchXUgsyncAuditInfoList(searchCriteria);
+	}
+	
+	public VXUgsyncAuditInfoList getUgsyncAuditsBySyncSource(String syncSource) {
+		if(syncSource!=null && !syncSource.trim().isEmpty()){
+			return xUgsyncAuditInfoService.searchXUgsyncAuditInfoBySyncSource(syncSource);
+		}else{
+			throw restErrorUtil.createRESTException("Please provide a valid syncSource", MessageEnums.INVALID_INPUT_DATA);
+		}
+	}
 }

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java b/security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java
index 71298a4..b713d12 100644
--- a/security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java
+++ b/security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java
@@ -38,15 +38,8 @@ import org.apache.ranger.plugin.model.RangerPolicy;
 import org.apache.ranger.plugin.model.RangerPolicy.RangerDataMaskPolicyItem;
 import org.apache.ranger.plugin.model.RangerPolicy.RangerPolicyItem;
 import org.apache.ranger.plugin.model.RangerPolicy.RangerRowFilterPolicyItem;
-import org.apache.ranger.service.RangerPolicyService;
-import org.apache.ranger.service.XGroupPermissionService;
-import org.apache.ranger.service.XModuleDefService;
-import org.apache.ranger.service.XPortalUserService;
-import org.apache.ranger.service.XResourceService;
-import org.apache.ranger.service.XUserPermissionService;
-import org.apache.ranger.view.VXGroupPermission;
-import org.apache.ranger.view.VXModuleDef;
-import org.apache.ranger.view.VXUserPermission;
+import org.apache.ranger.service.*;
+import org.apache.ranger.view.*;
 import org.apache.log4j.Logger;
 import org.apache.ranger.authorization.utils.StringUtil;
 import org.apache.ranger.common.AppConstants;
@@ -81,23 +74,6 @@ import org.apache.ranger.entity.XXPortalUser;
 import org.apache.ranger.entity.XXResource;
 import org.apache.ranger.entity.XXTrxLog;
 import org.apache.ranger.entity.XXUser;
-import org.apache.ranger.service.XGroupService;
-import org.apache.ranger.service.XUserService;
-import org.apache.ranger.view.VXAuditMap;
-import org.apache.ranger.view.VXAuditMapList;
-import org.apache.ranger.view.VXGroup;
-import org.apache.ranger.view.VXGroupGroup;
-import org.apache.ranger.view.VXGroupList;
-import org.apache.ranger.view.VXGroupUser;
-import org.apache.ranger.view.VXGroupUserInfo;
-import org.apache.ranger.view.VXGroupUserList;
-import org.apache.ranger.view.VXLong;
-import org.apache.ranger.view.VXPermMap;
-import org.apache.ranger.view.VXPermMapList;
-import org.apache.ranger.view.VXPortalUser;
-import org.apache.ranger.view.VXUser;
-import org.apache.ranger.view.VXUserGroupInfo;
-import org.apache.ranger.view.VXUserList;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Propagation;
@@ -105,10 +81,8 @@ import org.springframework.transaction.annotation.Transactional;
 
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.ranger.view.VXResponse;
 import org.apache.ranger.entity.XXPortalUserRole;
-import org.apache.ranger.view.VXString;
-import org.apache.ranger.view.VXStringList;
+
 @Component
 public class XUserMgr extends XUserMgrBase {
 
@@ -160,6 +134,9 @@ public class XUserMgr extends XUserMgrBase {
     @Autowired
     UserMgr userManager;
 
+	@Autowired
+	XUgsyncAuditInfoService xUgsyncAuditInfoService;
+
 	static final Logger logger = Logger.getLogger(XUserMgr.class);
 
 
@@ -581,7 +558,7 @@ public class XUserMgr extends XUserMgrBase {
 		List<VXUser> vxu = new ArrayList<VXUser>();
         for (VXUser vXUser : vXGroupUserInfo.getXuserInfo()) {
             XXUser xUser = daoManager.getXXUser().findByUserName(
-                    vXUser.getName());
+					vXUser.getName());
             XXPortalUser xXPortalUser = daoManager.getXXPortalUser()
                     .findByLoginId(vXUser.getName());
             if (xUser != null) {
@@ -1678,7 +1655,7 @@ public class XUserMgr extends XUserMgrBase {
 			if(searchCriteria.getParamList() != null && searchCriteria.getParamList().get("name") != null){
 				searchCriteria.setSortBy("name");
 				vXGroupListSort = xGroupService.searchXGroups(searchCriteria);
-				vXGroupExactMatch = getGroupByGroupName((String)searchCriteria.getParamList().get("name"));
+				vXGroupExactMatch = getGroupByGroupName((String) searchCriteria.getParamList().get("name"));
 			}
 			int vXGroupExactMatchwithSearchCriteria = 0;
 			if(vXGroupExactMatch != null){
@@ -2258,4 +2235,14 @@ public class XUserMgr extends XUserMgrBase {
                 }
             }
 	}
+
+	@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
+	public synchronized VXUgsyncAuditInfo postUserGroupAuditInfo(
+			VXUgsyncAuditInfo vxUgsyncAuditInfo) {
+		checkAdminAccess();
+		//logger.info("post usersync audit info");
+		vxUgsyncAuditInfo = xUgsyncAuditInfoService.createUgsyncAuditInfo(vxUgsyncAuditInfo);
+		return vxUgsyncAuditInfo;
+	}
+
 }

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/src/main/java/org/apache/ranger/common/AppConstants.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/common/AppConstants.java b/security-admin/src/main/java/org/apache/ranger/common/AppConstants.java
index 4a02e26..032e5f0 100644
--- a/security-admin/src/main/java/org/apache/ranger/common/AppConstants.java
+++ b/security-admin/src/main/java/org/apache/ranger/common/AppConstants.java
@@ -594,10 +594,11 @@ public class AppConstants extends RangerCommonEnums {
 	public static final int CLASS_TYPE_XA_SERVICE_VERSION_INFO = 1052;
 	public static final int CLASS_TYPE_XA_ACCESS_AUDIT_V4 = 1053;
 	public static final int CLASS_TYPE_XA_ACCESS_AUDIT_V5 = 1054;
+	public static final int CLASS_TYPE_UGYNC_AUDIT_INFO = 1055;
 	/**
 	 * Max value for enum ClassTypes_MAX
 	 */
-	public static final int ClassTypes_MAX = 1054;
+	public static final int ClassTypes_MAX = 1055;
 	
 	/***************************************************************
 	 * Enum values for Default SortOrder
@@ -968,6 +969,9 @@ public class AppConstants extends RangerCommonEnums {
 		if( elementValue == 1054 ) {
 			return "Access Audit V5"; //CLASS_TYPE_XA_ACCESS_AUDIT_V5
 		}
+		if( elementValue == 1055 ) {
+			return "Usersync Audit Info"; //CLASS_TYPE_UGYNC_AUDIT_INFO
+		}
 		return null;
 	}
 

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/src/main/java/org/apache/ranger/db/RangerDaoManagerBase.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/db/RangerDaoManagerBase.java b/security-admin/src/main/java/org/apache/ranger/db/RangerDaoManagerBase.java
index d61cbc7..c57ecc8 100644
--- a/security-admin/src/main/java/org/apache/ranger/db/RangerDaoManagerBase.java
+++ b/security-admin/src/main/java/org/apache/ranger/db/RangerDaoManagerBase.java
@@ -198,6 +198,9 @@ public abstract class RangerDaoManagerBase {
 		if (classType== AppConstants.CLASS_TYPE_XA_SERVICE_VERSION_INFO) {
 			return getXXServiceVersionInfo();
 		}
+		if (classType == AppConstants.CLASS_TYPE_UGYNC_AUDIT_INFO) {
+			return getXXUgsyncAuditInfo();
+		}
 		logger.error("No DaoManager found for classType=" + classType, new Throwable());
 		return null;
 	}
@@ -369,6 +372,9 @@ public abstract class RangerDaoManagerBase {
                 if ("XXPolicyLabel".equals(className)) {
                         return getXXPolicyLabels();
                 }
+		if ("XXUgsyncAuditInfo".equals(className)) {
+			return getXXUgsyncAuditInfo();
+		}
 		logger.error("No DaoManager found for className=" + className, new Throwable());
 		return null;
 	}
@@ -601,5 +607,9 @@ public abstract class RangerDaoManagerBase {
 	public XXPluginInfoDao getXXPluginInfo() {
 		return new XXPluginInfoDao(this);
 	}
+
+	public XXUgsyncAuditInfoDao getXXUgsyncAuditInfo() {
+		return new XXUgsyncAuditInfoDao(this);
+	}
 }
 

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/src/main/java/org/apache/ranger/db/XXUgsyncAuditInfoDao.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/db/XXUgsyncAuditInfoDao.java b/security-admin/src/main/java/org/apache/ranger/db/XXUgsyncAuditInfoDao.java
new file mode 100644
index 0000000..1955923
--- /dev/null
+++ b/security-admin/src/main/java/org/apache/ranger/db/XXUgsyncAuditInfoDao.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ranger.db;
+
+import org.apache.log4j.Logger;
+import org.apache.ranger.common.DateUtil;
+import org.apache.ranger.common.db.BaseDao;
+import org.apache.ranger.entity.XXUgsyncAuditInfo;
+
+import javax.persistence.NoResultException;
+import java.util.List;
+
+/**
+ */
+
+public class XXUgsyncAuditInfoDao extends BaseDao<XXUgsyncAuditInfo> {
+	protected static final Logger logger = Logger
+			.getLogger(XXUgsyncAuditInfoDao.class);
+	/**
+	 * Default Constructor
+	 */
+	public XXUgsyncAuditInfoDao(RangerDaoManagerBase daoManager) {
+		super(daoManager);
+	}
+
+	@Override
+	public XXUgsyncAuditInfo create(XXUgsyncAuditInfo obj) {
+		obj.setEventTime(DateUtil.getUTCDate());
+		return super.create(obj);
+	}
+
+	public XXUgsyncAuditInfo findBySessionId(String sessionId) {
+		if (sessionId == null) {
+			return null;
+		}
+		try {
+			return getEntityManager()
+					.createNamedQuery("XXUgsyncAuditInfo.findBySessionId", tClass)
+					.setParameter("sessionId", sessionId)
+					.getSingleResult();
+		} catch (NoResultException e) {
+			return null;
+		}
+	}
+	public List<XXUgsyncAuditInfo> findBySyncSource(String syncSource) {
+		if (syncSource == null) {
+			return null;
+		}
+		try {
+			return getEntityManager()
+					.createNamedQuery("XXUgsyncAuditInfo.findBySyncSource", tClass)
+					.setParameter("syncSource", syncSource).getResultList();
+		} catch (NoResultException e) {
+			return null;
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/src/main/java/org/apache/ranger/entity/XXUgsyncAuditInfo.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXUgsyncAuditInfo.java b/security-admin/src/main/java/org/apache/ranger/entity/XXUgsyncAuditInfo.java
new file mode 100644
index 0000000..5609833
--- /dev/null
+++ b/security-admin/src/main/java/org/apache/ranger/entity/XXUgsyncAuditInfo.java
@@ -0,0 +1,210 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ranger.entity;
+
+import org.apache.ranger.common.AppConstants;
+
+import javax.persistence.*;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.Date;
+
+@Entity
+@Cacheable
+@XmlRootElement
+@Table(name = "x_ugsync_audit_info")
+public class XXUgsyncAuditInfo extends XXDBBase implements java.io.Serializable {
+	private static final long serialVersionUID = 1L;
+
+	@Id
+	@SequenceGenerator(name = "X_UGSYNC_AUDIT_INFO_SEQ", sequenceName = "X_UGSYNC_AUDIT_INFO_SEQ", allocationSize = 1)
+	@GeneratedValue(strategy = GenerationType.AUTO, generator = "X_UGSYNC_AUDIT_INFO_SEQ")
+	@Column(name = "id")
+	protected Long id;
+
+	@Temporal(TemporalType.TIMESTAMP)
+	@Column(name="event_time"   )
+	protected Date eventTime;
+
+	@Column(name = "user_name")
+	protected String userName;
+
+	@Column(name = "sync_source")
+	protected String syncSource;
+
+	@Column(name = "no_of_users")
+	protected Long noOfUsers;
+
+	@Column(name = "no_of_groups")
+	protected Long noOfGroups;
+
+	@Column(name = "sync_source_info")
+	protected String syncSourceInfo;
+
+	@Column(name="session_id")
+	protected String sessionId;
+
+	/**
+	 * Default constructor. This will set all the attributes to default value.
+	 */
+	public XXUgsyncAuditInfo() {
+	}
+
+	public int getMyClassType( ) {
+	    return AppConstants.CLASS_TYPE_UGYNC_AUDIT_INFO;
+	}
+
+	public String getMyDisplayValue() {
+		return null;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getId() {
+		return this.id;
+	}
+
+	public Date getEventTime() {
+		return eventTime;
+	}
+
+	public void setEventTime(Date eventTime) {
+		this.eventTime = eventTime;
+	}
+
+	public String getUserName() {
+		return userName;
+	}
+
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
+
+	public String getSyncSource() {
+		return syncSource;
+	}
+
+	public void setSyncSource(String syncSource) {
+		this.syncSource = syncSource;
+	}
+
+	public Long getNoOfUsers() {
+		return noOfUsers;
+	}
+
+	public void setNoOfUsers(Long noOfUsers) {
+		this.noOfUsers = noOfUsers;
+	}
+
+	public Long getNoOfGroups() {
+		return noOfGroups;
+	}
+
+	public void setNoOfGroups(Long noOfGroups) {
+		this.noOfGroups = noOfGroups;
+	}
+
+	public String getSyncSourceInfo() {
+		return syncSourceInfo;
+	}
+
+	public void setSyncSourceInfo(String syncSourceInfo) {
+		this.syncSourceInfo = syncSourceInfo;
+	}
+
+	public String getSessionId() {
+		return sessionId;
+	}
+
+	public void setSessionId(String sessionId) {
+		this.sessionId = sessionId;
+	}
+
+	/**
+	 * This return the bean content in string format
+	 * @return formatedStr
+	*/
+	@Override
+	public String toString( ) {
+		String str = "XXUgsyncAuditInfo={";
+		str += "id={" + id + "} ";
+		str += "eventTime={" + eventTime + "} ";
+		str += "userName={" + userName + "} ";
+		str += "syncSource={" + syncSource + "} ";
+		str += "noOfUsers={" + noOfUsers + "} ";
+		str += "noOfGroups={" + noOfGroups + "} ";
+		str += "syncSourceInfo={" + syncSourceInfo + "} ";
+		str += "sessionId={" + sessionId + "} ";
+		str += "}";
+		return str;
+	}
+
+	/**
+	 * Checks for all attributes except referenced db objects
+	 * @return true if all attributes match
+	*/
+	@Override
+	public boolean equals( Object obj) {
+		if (obj == null)
+			return false;
+		if (this == obj)
+			return true;
+		if (getClass() != obj.getClass())
+			return false;
+		XXUgsyncAuditInfo other = (XXUgsyncAuditInfo) obj;
+		if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
+			return false;
+		}
+		if ((this.eventTime == null && other.eventTime != null) || (this.eventTime != null && !this.eventTime.equals(other.eventTime))) {
+			return false;
+		}
+		if ((this.userName == null && other.userName != null) || (this.userName != null && !this.userName.equals(other.userName))) {
+			return false;
+		}
+		if ((this.syncSource == null && other.syncSource != null) || (this.syncSource != null && !this.syncSource.equals(other.syncSource))) {
+			return false;
+		}
+		if ((this.noOfUsers == null && other.noOfUsers != null) || (this.noOfUsers != null && !this.noOfUsers.equals(other.noOfUsers))) {
+			return false;
+		}
+		if ((this.noOfGroups == null && other.noOfGroups != null) || (this.noOfGroups != null && !this.noOfGroups.equals(other.noOfGroups))) {
+			return false;
+		}
+		if ((this.syncSourceInfo == null && other.syncSourceInfo != null) || (this.syncSourceInfo != null && !this.syncSourceInfo.equals(other.syncSourceInfo))) {
+			return false;
+		}
+		if ((this.sessionId == null && other.sessionId != null) || (this.sessionId != null && !this.sessionId.equals(other.sessionId))) {
+			return false;
+		}
+		return true;
+	}
+
+	public static boolean equals(Object object1, Object object2) {
+		if (object1 == object2) {
+			return true;
+		}
+		if ((object1 == null) || (object2 == null)) {
+			return false;
+		}
+		return object1.equals(object2);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/src/main/java/org/apache/ranger/rest/AssetREST.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/rest/AssetREST.java b/security-admin/src/main/java/org/apache/ranger/rest/AssetREST.java
index 3c274e3..9f7cd26 100644
--- a/security-admin/src/main/java/org/apache/ranger/rest/AssetREST.java
+++ b/security-admin/src/main/java/org/apache/ranger/rest/AssetREST.java
@@ -68,18 +68,7 @@ import org.apache.ranger.service.XPolicyExportAuditService;
 import org.apache.ranger.service.XPolicyService;
 import org.apache.ranger.service.XResourceService;
 import org.apache.ranger.service.XTrxLogService;
-import org.apache.ranger.view.VXAccessAuditList;
-import org.apache.ranger.view.VXAsset;
-import org.apache.ranger.view.VXAssetList;
-import org.apache.ranger.view.VXCredentialStore;
-import org.apache.ranger.view.VXCredentialStoreList;
-import org.apache.ranger.view.VXLong;
-import org.apache.ranger.view.VXPolicy;
-import org.apache.ranger.view.VXPolicyExportAuditList;
-import org.apache.ranger.view.VXResource;
-import org.apache.ranger.view.VXResourceList;
-import org.apache.ranger.view.VXResponse;
-import org.apache.ranger.view.VXTrxLogList;
+import org.apache.ranger.view.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Scope;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -331,7 +320,7 @@ public class AssetREST {
 		RangerService service = serviceREST.getService(vXResource.getAssetId());
 		RangerPolicy  policy  = serviceUtil.toRangerPolicy(vXResource, service);
 
-		RangerPolicy createdPolicy = serviceREST.createPolicy(policy,null);
+		RangerPolicy createdPolicy = serviceREST.createPolicy(policy, null);
 
 		VXResource ret = serviceUtil.toVXResource(createdPolicy, service);
 
@@ -579,7 +568,7 @@ public class AssetREST {
 		searchUtil.extractInt(request, searchCriteria, "httpRetCode",
 				"HTTP response code for exported policy.");
 		searchUtil.extractDate(request, searchCriteria, "startDate",
-                                "Start Date", null);
+				"Start Date", null);
 		searchUtil.extractDate(request, searchCriteria, "endDate",
                                 "End Date", null);
 		searchUtil.extractString(request, searchCriteria, "cluster",
@@ -736,4 +725,41 @@ public class AssetREST {
 		}
 		return vXPolicy;
 	}
+
+	@GET
+	@Path("/ugsyncAudits")
+	@Produces({ "application/xml", "application/json" })
+	@PreAuthorize("@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.GET_UGSYNC_AUDITS + "\")")
+	public VXUgsyncAuditInfoList getUgsyncAudits(@Context HttpServletRequest request){
+
+		SearchCriteria searchCriteria = searchUtil.extractCommonCriterias(
+				request, xAccessAuditService.sortFields);
+		searchUtil.extractString(request, searchCriteria, "userName",
+				"User Name", StringUtil.VALIDATION_TEXT);
+		searchUtil.extractString(request, searchCriteria, "sessionId",
+				"Session Id", StringUtil.VALIDATION_TEXT);
+		searchUtil.extractString(request, searchCriteria, "syncSource",
+				"Sync Source", StringUtil.VALIDATION_TEXT);
+		searchUtil.extractString(request, searchCriteria, "syncSourceInfo",
+				"Sync Source Info", StringUtil.VALIDATION_TEXT);
+		searchUtil.extractLong(request, searchCriteria, "noOfUsers", "No of Users");
+		searchUtil.extractLong(request, searchCriteria, "noOfGroups", "No of Groups");
+
+		searchUtil.extractDate(request, searchCriteria, "startDate",
+				"Start Date", "MM/dd/yyyy");
+		searchUtil.extractDate(request, searchCriteria, "endDate", "End Date",
+				"MM/dd/yyyy");
+		return assetMgr.getUgsyncAudits(searchCriteria);
+	}
+
+	@GET
+	@Path("/ugsyncAudits/{syncSource}")
+	@Encoded
+	@Produces({ "application/xml", "application/json" })
+	@PreAuthorize("@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.GET_UGSYNC_AUDITS_BY_SYNCSOURCE + "\")")
+	public VXUgsyncAuditInfoList getUgsyncAuditsBySyncSource(@PathParam("syncSource") String syncSource){
+		VXUgsyncAuditInfoList vxUgsyncAuditInfoList = new VXUgsyncAuditInfoList();
+		vxUgsyncAuditInfoList = assetMgr.getUgsyncAuditsBySyncSource(syncSource);
+		return vxUgsyncAuditInfoList;
+	}
 }

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/src/main/java/org/apache/ranger/rest/XUserREST.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/rest/XUserREST.java b/security-admin/src/main/java/org/apache/ranger/rest/XUserREST.java
index a07c243..9a9604f 100644
--- a/security-admin/src/main/java/org/apache/ranger/rest/XUserREST.java
+++ b/security-admin/src/main/java/org/apache/ranger/rest/XUserREST.java
@@ -59,31 +59,7 @@ import org.apache.ranger.service.XPermMapService;
 import org.apache.ranger.service.XResourceService;
 import org.apache.ranger.service.XUserPermissionService;
 import org.apache.ranger.service.XUserService;
-import org.apache.ranger.view.VXAuditMap;
-import org.apache.ranger.view.VXAuditMapList;
-import org.apache.ranger.view.VXAuthSession;
-import org.apache.ranger.view.VXAuthSessionList;
-import org.apache.ranger.view.VXGroup;
-import org.apache.ranger.view.VXGroupGroup;
-import org.apache.ranger.view.VXGroupGroupList;
-import org.apache.ranger.view.VXGroupList;
-import org.apache.ranger.view.VXGroupPermission;
-import org.apache.ranger.view.VXGroupPermissionList;
-import org.apache.ranger.view.VXGroupUser;
-import org.apache.ranger.view.VXGroupUserInfo;
-import org.apache.ranger.view.VXGroupUserList;
-import org.apache.ranger.view.VXLong;
-import org.apache.ranger.view.VXModuleDef;
-import org.apache.ranger.view.VXModuleDefList;
-import org.apache.ranger.view.VXPermMap;
-import org.apache.ranger.view.VXPermMapList;
-import org.apache.ranger.view.VXString;
-import org.apache.ranger.view.VXStringList;
-import org.apache.ranger.view.VXUser;
-import org.apache.ranger.view.VXUserGroupInfo;
-import org.apache.ranger.view.VXUserList;
-import org.apache.ranger.view.VXUserPermission;
-import org.apache.ranger.view.VXUserPermissionList;
+import org.apache.ranger.view.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Scope;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -1152,4 +1128,13 @@ public class XUserREST {
                         xUserMgr.deleteXGroup(groupId, forceDelete);
                 }
         }
-}
\ No newline at end of file
+
+	@POST
+	@Path("/ugsync/auditinfo")
+	@Produces({ "application/xml", "application/json" })
+	@PreAuthorize("hasRole('ROLE_SYS_ADMIN')")
+	public VXUgsyncAuditInfo postUserGroupAuditInfo(VXUgsyncAuditInfo vxUgsyncAuditInfo) {
+
+		return xUserMgr.postUserGroupAuditInfo(vxUgsyncAuditInfo);
+	}
+}

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/src/main/java/org/apache/ranger/security/context/RangerAPIList.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/security/context/RangerAPIList.java b/security-admin/src/main/java/org/apache/ranger/security/context/RangerAPIList.java
index 460c7fd..0f96453 100644
--- a/security-admin/src/main/java/org/apache/ranger/security/context/RangerAPIList.java
+++ b/security-admin/src/main/java/org/apache/ranger/security/context/RangerAPIList.java
@@ -52,6 +52,8 @@ public class RangerAPIList {
 	public static final String GET_ACCESS_LOGS = "AssetREST.getAccessLogs";
 	public static final String GRANT_PERMISSION = "AssetREST.grantPermission";
 	public static final String REVOKE_PERMISSION = "AssetREST.revokePermission";
+	public static final String GET_UGSYNC_AUDITS = "AssetREST.getUgsyncAudits";
+	public static final String GET_UGSYNC_AUDITS_BY_SYNCSOURCE = "AssetREST.getUgsyncAuditsBySyncSource";
 
 	/**
 	 * List of APIs for ServiceREST
@@ -206,4 +208,4 @@ public class RangerAPIList {
 	public static final String SET_USER_ROLES_BY_NAME="XUserREST.setUserRolesByName";
 	public static final String GET_USER_ROLES_BY_ID="XUserREST.getUserRolesByID";
 	public static final String GET_USER_ROLES_BY_NAME="XUserREST.getUserRolesByName";
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/src/main/java/org/apache/ranger/service/XUgsyncAuditInfoService.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/service/XUgsyncAuditInfoService.java b/security-admin/src/main/java/org/apache/ranger/service/XUgsyncAuditInfoService.java
new file mode 100644
index 0000000..85a9651
--- /dev/null
+++ b/security-admin/src/main/java/org/apache/ranger/service/XUgsyncAuditInfoService.java
@@ -0,0 +1,182 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+ package org.apache.ranger.service;
+
+import org.apache.ranger.common.*;
+import org.apache.ranger.common.SearchField.DATA_TYPE;
+import org.apache.ranger.common.SearchField.SEARCH_TYPE;
+import org.apache.ranger.common.SortField.SORT_ORDER;
+import org.apache.ranger.entity.XXUgsyncAuditInfo;
+import org.apache.ranger.view.VXUgsyncAuditInfo;
+import org.apache.ranger.view.VXUgsyncAuditInfoList;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Service
+@Scope("singleton")
+public class XUgsyncAuditInfoService extends XUgsyncAuditInfoServiceBase<XXUgsyncAuditInfo, VXUgsyncAuditInfo>{
+	@Autowired
+	JSONUtil jsonUtil;
+
+	public static final String NAME = "XUgsyncAuditInfo";
+	protected static final String distinctCountQueryStr = "SELECT COUNT(distinct obj.id) FROM XXUgsyncAuditInfo obj ";
+	protected static final String distinctQueryStr = "SELECT distinct obj FROM XXUgsyncAuditInfo obj ";
+
+	public XUgsyncAuditInfoService() {
+		countQueryStr = "SELECT COUNT(obj) FROM XXUgsyncAuditInfo  obj ";
+		queryStr = "SELECT obj FROM XXUgsyncAuditInfo obj ";
+
+		sortFields.add(new SortField("eventTime", "obj.eventTime", true, SORT_ORDER.DESC));
+		searchFields.add(new SearchField("userName", "obj.userName",
+				DATA_TYPE.STRING, SEARCH_TYPE.PARTIAL));
+		searchFields.add(new SearchField("sessionId", "obj.sessionId",
+				DATA_TYPE.STRING, SEARCH_TYPE.PARTIAL));
+		searchFields.add(new SearchField("syncSource", "obj.syncSource",
+				DATA_TYPE.STRING, SEARCH_TYPE.PARTIAL));
+		searchFields.add(new SearchField("noOfUsers", "obj.noOfUsers",
+				DATA_TYPE.INTEGER, SEARCH_TYPE.FULL));
+		searchFields.add(new SearchField("noOfGroups", "obj.noOfGroups",
+				DATA_TYPE.INTEGER, SEARCH_TYPE.FULL));
+		searchFields.add(new SearchField("syncSourceInfo", "obj.syncSourceInfo", DATA_TYPE.STRING, SEARCH_TYPE.PARTIAL));
+		searchFields.add(new SearchField("startDate", "obj.eventTime",
+				DATA_TYPE.DATE, SEARCH_TYPE.GREATER_EQUAL_THAN));
+		searchFields.add(new SearchField("endDate", "obj.eventTime",
+				DATA_TYPE.DATE, SEARCH_TYPE.LESS_EQUAL_THAN));
+}
+
+	protected XXUgsyncAuditInfo mapViewToEntityBean(VXUgsyncAuditInfo vObj, XXUgsyncAuditInfo mObj, int OPERATION_CONTEXT) {
+		mObj.setId(vObj.getId());
+		mObj.setEventTime(vObj.getEventTime());
+		mObj.setUserName(vObj.getUserName());
+		mObj.setSyncSource(vObj.getSyncSource());
+		mObj.setNoOfUsers(vObj.getNoOfUsers());
+		mObj.setNoOfGroups(vObj.getNoOfGroups());
+		mObj.setSyncSourceInfo(jsonUtil.readMapToString(vObj.getSyncSourceInfo()));
+		mObj.setSessionId(vObj.getSessionId());
+		return mObj;
+	}
+
+	protected VXUgsyncAuditInfo mapEntityToViewBean(VXUgsyncAuditInfo vObj, XXUgsyncAuditInfo mObj) {
+		vObj.setId(mObj.getId());
+		vObj.setEventTime(mObj.getEventTime());
+		vObj.setUserName(mObj.getUserName());
+		vObj.setSyncSource(mObj.getSyncSource());
+		vObj.setNoOfUsers(mObj.getNoOfUsers());
+		vObj.setNoOfGroups(mObj.getNoOfGroups());
+		String jsonString = mObj.getSyncSourceInfo();
+		vObj.setSyncSourceInfo(jsonUtil.jsonToMap(jsonString));
+		vObj.setSessionId( mObj.getSessionId());
+
+		return vObj;
+	}
+
+	/**
+	 * @param searchCriteria
+	 * @return
+	 */
+	public VXUgsyncAuditInfoList searchXUgsyncAuditInfoList(SearchCriteria searchCriteria) {
+        VXUgsyncAuditInfoList returnList = new VXUgsyncAuditInfoList();
+        List<VXUgsyncAuditInfo> xUgsyncAuditInfoList = new ArrayList<VXUgsyncAuditInfo>();
+
+        List<XXUgsyncAuditInfo> resultList = (List<XXUgsyncAuditInfo>) searchResources(searchCriteria,
+                searchFields, sortFields, returnList);
+
+        // Iterate over the result list and create the return list
+        for (XXUgsyncAuditInfo gjXUgsyncAuditInfo : resultList) {
+            VXUgsyncAuditInfo vxUgsyncAuditInfo = populateViewBean(gjXUgsyncAuditInfo);
+
+            if(vxUgsyncAuditInfo != null) {
+				xUgsyncAuditInfoList.add(vxUgsyncAuditInfo);
+            }
+        }
+
+        returnList.setVxUgsyncAuditInfoList(xUgsyncAuditInfoList);
+        return returnList;
+    }
+
+	public VXUgsyncAuditInfoList searchXUgsyncAuditInfoBySyncSource(String syncSource) {
+		VXUgsyncAuditInfoList returnList = new VXUgsyncAuditInfoList();
+		List<VXUgsyncAuditInfo> xUgsyncAuditInfoList = new ArrayList<VXUgsyncAuditInfo>();
+
+		List<XXUgsyncAuditInfo> resultList = daoManager.getXXUgsyncAuditInfo().findBySyncSource(syncSource);
+
+		// Iterate over the result list and create the return list
+		for (XXUgsyncAuditInfo gjXUgsyncAuditInfo : resultList) {
+			VXUgsyncAuditInfo vxUgsyncAuditInfo = populateViewBean(gjXUgsyncAuditInfo);
+
+			if(vxUgsyncAuditInfo != null) {
+				xUgsyncAuditInfoList.add(vxUgsyncAuditInfo);
+			}
+		}
+
+		returnList.setVxUgsyncAuditInfoList(xUgsyncAuditInfoList);
+		return returnList;
+	}
+	
+	public VXUgsyncAuditInfo populateViewBean(XXUgsyncAuditInfo gjXUgsyncAuditInfo) {
+		//VXUgsyncAuditInfo vxUgsyncAuditInfo = new VXUgsyncAuditInfo();
+		VXUgsyncAuditInfo vxUgsyncAuditInfo = super.populateViewBean(gjXUgsyncAuditInfo);
+		return mapEntityToViewBean(vxUgsyncAuditInfo, gjXUgsyncAuditInfo);
+	}
+
+	@Override
+	protected void validateForCreate(VXUgsyncAuditInfo viewBaseBean) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	protected void validateForUpdate(VXUgsyncAuditInfo viewBaseBean, XXUgsyncAuditInfo t) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public VXUgsyncAuditInfo createUgsyncAuditInfo(VXUgsyncAuditInfo vxUgsyncAuditInfo) {
+
+		XXUgsyncAuditInfo xxUgsyncAuditInfo = new XXUgsyncAuditInfo();
+		Long sessionId = ContextUtil.getCurrentUserSession().getSessionId();
+		if (sessionId != null) {
+			vxUgsyncAuditInfo.setSessionId("" + sessionId);
+		}
+		vxUgsyncAuditInfo.setEventTime(DateUtil.getUTCDate());
+		vxUgsyncAuditInfo.setUserName(ContextUtil.getCurrentUserLoginId());
+
+		// Process the sync source information
+		if (vxUgsyncAuditInfo.getUnixSyncSourceInfo() != null) {
+			vxUgsyncAuditInfo.setSyncSourceInfo(jsonUtil.jsonToMap(vxUgsyncAuditInfo.getUnixSyncSourceInfo().toString()));
+		} else if (vxUgsyncAuditInfo.getFileSyncSourceInfo() != null) {
+			vxUgsyncAuditInfo.setSyncSourceInfo(jsonUtil.jsonToMap(vxUgsyncAuditInfo.getFileSyncSourceInfo().toString()));
+		} else if (vxUgsyncAuditInfo.getLdapSyncSourceInfo() != null) {
+			vxUgsyncAuditInfo.setSyncSourceInfo(jsonUtil.jsonToMap(vxUgsyncAuditInfo.getLdapSyncSourceInfo().toString()));
+		}
+
+		mapViewToEntityBean(vxUgsyncAuditInfo, xxUgsyncAuditInfo, 0);
+		preCreate(vxUgsyncAuditInfo);
+		xxUgsyncAuditInfo = getDao().create(xxUgsyncAuditInfo);
+		postCreate(xxUgsyncAuditInfo);
+
+		//logger.info("postCreate ugsync audit info" + vxUgsyncAuditInfo.toString());
+		return vxUgsyncAuditInfo;
+	}
+}

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/src/main/java/org/apache/ranger/service/XUgsyncAuditInfoServiceBase.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/service/XUgsyncAuditInfoServiceBase.java b/security-admin/src/main/java/org/apache/ranger/service/XUgsyncAuditInfoServiceBase.java
new file mode 100644
index 0000000..bf6f6e1
--- /dev/null
+++ b/security-admin/src/main/java/org/apache/ranger/service/XUgsyncAuditInfoServiceBase.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+ package org.apache.ranger.service;
+
+/**
+ *
+ */
+
+import org.apache.ranger.entity.XXUgsyncAuditInfo;
+import org.apache.ranger.view.VXUgsyncAuditInfo;
+
+public abstract class XUgsyncAuditInfoServiceBase<T extends XXUgsyncAuditInfo, V extends VXUgsyncAuditInfo>
+		extends AbstractBaseResourceService<T, V> {
+	public static final String NAME = "XUgsyncAuditInfo";
+
+	public XUgsyncAuditInfoServiceBase() {
+
+	}
+
+	@Override
+	protected T mapViewToEntityBean(V vObj, T mObj, int OPERATION_CONTEXT) {
+		mObj.setEventTime(vObj.getEventTime());
+		mObj.setUserName(vObj.getUserName());
+		mObj.setSyncSource(vObj.getSyncSource());
+		mObj.setNoOfGroups(vObj.getNoOfGroups());
+		mObj.setNoOfUsers(vObj.getNoOfUsers());
+		return mObj;
+	}
+
+	@Override
+	protected V mapEntityToViewBean(V vObj, T mObj) {
+		vObj.setEventTime( mObj.getEventTime());
+		vObj.setUserName( mObj.getUserName());
+		vObj.setSyncSource( mObj.getSyncSource());
+		vObj.setNoOfUsers( mObj.getNoOfUsers());
+		vObj.setNoOfGroups( mObj.getNoOfGroups());
+		return vObj;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/src/main/java/org/apache/ranger/view/VXFileSyncSourceInfo.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/view/VXFileSyncSourceInfo.java b/security-admin/src/main/java/org/apache/ranger/view/VXFileSyncSourceInfo.java
new file mode 100644
index 0000000..d8c66ca
--- /dev/null
+++ b/security-admin/src/main/java/org/apache/ranger/view/VXFileSyncSourceInfo.java
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+ package org.apache.ranger.view;
+
+/**
+ * UserGroupInfo
+ *
+ */
+
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility;
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@JsonAutoDetect(getterVisibility=Visibility.NONE, setterVisibility=Visibility.NONE, fieldVisibility=Visibility.ANY)
+@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL )
+@JsonIgnoreProperties(ignoreUnknown=true)
+@XmlRootElement
+public class VXFileSyncSourceInfo implements java.io.Serializable  {
+
+	private static final long serialVersionUID = 1L;
+
+	private String fileName;
+	private String syncTime;
+	private String lastModified;
+
+	public VXFileSyncSourceInfo() {
+	}
+
+	public String getFileName() {
+		return fileName;
+	}
+
+	public void setFileName(String fileName) {
+		this.fileName = fileName;
+	}
+
+	public String getSyncTime() {
+		return syncTime;
+	}
+
+	public void setSyncTime(String syncTime) {
+		this.syncTime = syncTime;
+	}
+
+	public String getLastModified() {
+		return lastModified;
+	}
+
+	public void setLastModified(String lastModified) {
+		this.lastModified = lastModified;
+	}
+
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder();
+		toString(sb);
+		return sb.toString();
+	}
+
+	public StringBuilder toString(StringBuilder sb) {
+		sb.append("{\"fileName\":\"").append(fileName);
+		sb.append("\", \"syncTime\":\"").append(syncTime);
+		sb.append("\", \"lastModified\":\"").append(lastModified);
+		sb.append("\"}");
+		return sb;
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/src/main/java/org/apache/ranger/view/VXLdapSyncSourceInfo.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/view/VXLdapSyncSourceInfo.java b/security-admin/src/main/java/org/apache/ranger/view/VXLdapSyncSourceInfo.java
new file mode 100644
index 0000000..fd2d8e1
--- /dev/null
+++ b/security-admin/src/main/java/org/apache/ranger/view/VXLdapSyncSourceInfo.java
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+ package org.apache.ranger.view;
+
+/**
+ * UserGroupInfo
+ *
+ */
+
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility;
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@JsonAutoDetect(getterVisibility=Visibility.NONE, setterVisibility=Visibility.NONE, fieldVisibility=Visibility.ANY)
+@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL )
+@JsonIgnoreProperties(ignoreUnknown=true)
+@XmlRootElement
+public class VXLdapSyncSourceInfo implements java.io.Serializable  {
+
+	private static final long serialVersionUID = 1L;
+
+	private String ldapUrl;
+	private String incrementalSycn;
+	private String userSearchFilter;
+	private String groupSearchFilter;
+	private String groupHierarchyLevel;
+
+	public VXLdapSyncSourceInfo() {
+	}
+
+	public String getLdapUrl() {
+		return ldapUrl;
+	}
+
+	public void setLdapUrl(String ldapUrl) {
+		this.ldapUrl = ldapUrl;
+	}
+
+	public String isIncrementalSycn() {
+		return incrementalSycn;
+	}
+
+	public void setIncrementalSycn(String incrementalSycn) {
+		this.incrementalSycn = incrementalSycn;
+	}
+
+	public String getUserSearchFilter() {
+		return userSearchFilter;
+	}
+
+	public void setUserSearchFilter(String userSearchFilter) {
+		this.userSearchFilter = userSearchFilter;
+	}
+
+	public String getGroupSearchFilter() {
+		return groupSearchFilter;
+	}
+
+	public void setGroupSearchFilter(String groupSearchFilter) {
+		this.groupSearchFilter = groupSearchFilter;
+	}
+
+	public String getGroupHierarchyLevel() {
+		return groupHierarchyLevel;
+	}
+
+	public void setGroupHierarchyLevel(String groupHierarchyLevel) {
+		this.groupHierarchyLevel = groupHierarchyLevel;
+	}
+
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder();
+		toString(sb);
+		return sb.toString();
+	}
+
+	public StringBuilder toString(StringBuilder sb) {
+		sb.append("{\"ldapUrl\":\"").append(ldapUrl);
+		sb.append("\", \"isIncrementalSync\":\"").append(incrementalSycn);
+		sb.append("\", \"userSearchFilter\":\"").append(userSearchFilter);
+		sb.append("\", \"groupSearchFilter\":\"").append(groupSearchFilter);
+		sb.append("\", \"groupHierarchyLevel\":\"").append(groupHierarchyLevel);
+		sb.append("\"}");
+		return sb;
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/src/main/java/org/apache/ranger/view/VXUgsyncAuditInfo.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/view/VXUgsyncAuditInfo.java b/security-admin/src/main/java/org/apache/ranger/view/VXUgsyncAuditInfo.java
new file mode 100644
index 0000000..6fef928
--- /dev/null
+++ b/security-admin/src/main/java/org/apache/ranger/view/VXUgsyncAuditInfo.java
@@ -0,0 +1,141 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+ package org.apache.ranger.view;
+
+/**
+ * UserGroupInfo
+ *
+ */
+
+import org.apache.ranger.json.JsonDateSerializer;
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility;
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+@JsonAutoDetect(getterVisibility=Visibility.NONE, setterVisibility=Visibility.NONE, fieldVisibility=Visibility.ANY)
+@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL )
+@JsonIgnoreProperties(ignoreUnknown=true)
+@XmlRootElement
+public class VXUgsyncAuditInfo extends VXDataObject implements java.io.Serializable  {
+
+	private static final long serialVersionUID = 1L;
+
+	@JsonSerialize(using=JsonDateSerializer.class)
+	private Date eventTime;
+
+	private String userName;
+	private Long noOfUsers;
+	private Long noOfGroups;
+	private String syncSource;
+	private String sessionId;
+	private Map<String, String> syncSourceInfo;
+	private VXLdapSyncSourceInfo ldapSyncSourceInfo;
+	private VXFileSyncSourceInfo fileSyncSourceInfo;
+	private VXUnixSyncSourceInfo unixSyncSourceInfo;
+
+	public VXUgsyncAuditInfo() {
+	}
+
+	public Date getEventTime() {
+		return eventTime;
+	}
+
+	public void setEventTime(Date eventTime) {
+		this.eventTime = eventTime;
+	}
+
+	public String getUserName() {
+		return userName;
+	}
+
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
+
+	public Long getNoOfUsers() {
+		return noOfUsers;
+	}
+
+	public void setNoOfUsers(Long noOfUsers) {
+		this.noOfUsers = noOfUsers;
+	}
+
+	public Long getNoOfGroups() {
+		return noOfGroups;
+	}
+
+	public void setNoOfGroups(Long noOfGroups) {
+		this.noOfGroups = noOfGroups;
+	}
+
+	public String getSyncSource() {
+		return syncSource;
+	}
+
+	public void setSyncSource(String syncSource) {
+		this.syncSource = syncSource;
+	}
+
+	public VXLdapSyncSourceInfo getLdapSyncSourceInfo() {
+		return ldapSyncSourceInfo;
+	}
+
+	public void setLdapSyncSourceInfo(VXLdapSyncSourceInfo ldapSyncSourceInfo) {
+		this.ldapSyncSourceInfo = ldapSyncSourceInfo;
+	}
+
+	public VXFileSyncSourceInfo getFileSyncSourceInfo() {
+		return fileSyncSourceInfo;
+	}
+
+	public void setFileSyncSourceInfo(VXFileSyncSourceInfo fileSyncSourceInfo) {
+		this.fileSyncSourceInfo = fileSyncSourceInfo;
+	}
+
+	public VXUnixSyncSourceInfo getUnixSyncSourceInfo() {
+		return unixSyncSourceInfo;
+	}
+
+	public void setUnixSyncSourceInfo(VXUnixSyncSourceInfo unixSyncSourceInfo) {
+		this.unixSyncSourceInfo = unixSyncSourceInfo;
+	}
+
+	public String getSessionId() {
+		return sessionId;
+	}
+
+	public void setSessionId(String sessionId) {
+		this.sessionId = sessionId;
+	}
+
+	public Map<String, String> getSyncSourceInfo() {
+		return syncSourceInfo;
+	}
+
+	public void setSyncSourceInfo(Map<String, String> syncSourceInfo) {
+		this.syncSourceInfo = syncSourceInfo == null ? new HashMap<String, String>() :syncSourceInfo;
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ranger/blob/52f5249b/security-admin/src/main/java/org/apache/ranger/view/VXUgsyncAuditInfoList.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/view/VXUgsyncAuditInfoList.java b/security-admin/src/main/java/org/apache/ranger/view/VXUgsyncAuditInfoList.java
new file mode 100644
index 0000000..c2170e8
--- /dev/null
+++ b/security-admin/src/main/java/org/apache/ranger/view/VXUgsyncAuditInfoList.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+ package org.apache.ranger.view;
+
+/**
+ * List wrapper class for VXAccessAudit
+ *
+ */
+
+import org.apache.ranger.common.view.VList;
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.ArrayList;
+import java.util.List;
+
+@JsonAutoDetect(getterVisibility=Visibility.NONE, setterVisibility=Visibility.NONE, fieldVisibility=Visibility.ANY)
+@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL )
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
+public class VXUgsyncAuditInfoList extends VList {
+	private static final long serialVersionUID = 1L;
+    List<VXUgsyncAuditInfo> vxUgsyncAuditInfoList = new ArrayList<VXUgsyncAuditInfo>();
+
+    public VXUgsyncAuditInfoList() {
+	super();
+    }
+
+    public VXUgsyncAuditInfoList(List<VXUgsyncAuditInfo> objList) {
+	super(objList);
+	this.vxUgsyncAuditInfoList = objList;
+    }
+
+    /**
+     * @return the vXAccessAudits
+     */
+    public List<VXUgsyncAuditInfo> getVxUgsyncAuditInfoList() {
+	return vxUgsyncAuditInfoList;
+    }
+
+    /**
+     * @param vxUgsyncAuditInfoList
+     *            the vXAccessAudits to set
+     */
+    public void setVxUgsyncAuditInfoList(List<VXUgsyncAuditInfo> vxUgsyncAuditInfoList) {
+	this.vxUgsyncAuditInfoList = vxUgsyncAuditInfoList;
+    }
+
+    @Override
+    public int getListSize() {
+	if (vxUgsyncAuditInfoList != null) {
+	    return vxUgsyncAuditInfoList.size();
+	}
+	return 0;
+    }
+
+    @Override
+    public List<VXUgsyncAuditInfo> getList() {
+	return vxUgsyncAuditInfoList;
+    }
+
+}


Mime
View raw message