ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject [02/44] ARGUS-1. Initial code commit (Selvamohan Neethiraj via omalley)
Date Thu, 14 Aug 2014 20:50:13 GMT
http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/unixusersync/config/UserGroupSyncConfig.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/unixusersync/config/UserGroupSyncConfig.java b/ugsync/src/main/java/com/xasecure/unixusersync/config/UserGroupSyncConfig.java
new file mode 100644
index 0000000..7a5938b
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/unixusersync/config/UserGroupSyncConfig.java
@@ -0,0 +1,353 @@
+package com.xasecure.unixusersync.config;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import com.hortonworks.credentialapi.CredentialReader;
+import com.xasecure.usergroupsync.UserGroupSink;
+import com.xasecure.usergroupsync.UserGroupSource;
+
+public class UserGroupSyncConfig  {
+
+	public static final String CONFIG_FILE = "unixauthservice.properties" ;
+	
+	public static final String  UGSYNC_ENABLED_PROP = "usergroupSync.enabled" ;
+	
+	public static final String  UGSYNC_PM_URL_PROP = 	"usergroupSync.policymanager.baseURL" ;
+	
+	public static final String  UGSYNC_MIN_USERID_PROP  = 	"usergroupSync.unix.minUserId" ;
+	
+	public static final String  UGSYNC_MAX_RECORDS_PER_API_CALL_PROP  = 	"usergroupSync.policymanager.MaxRecordsPerAPICall" ;
+
+	public static final String  UGSYNC_MOCK_RUN_PROP  = 	"usergroupSync.policymanager.mockRun" ;
+	
+	private static final String SSL_KEYSTORE_PATH_PARAM = "keyStore" ;
+
+	private static final String SSL_KEYSTORE_PATH_PASSWORD_PARAM = "keyStorePassword" ;
+	
+	private static final String SSL_TRUSTSTORE_PATH_PARAM = "trustStore" ;
+	
+	private static final String SSL_TRUSTSTORE_PATH_PASSWORD_PARAM = "trustStorePassword" ;
+	
+	private static final String UGSYNC_SLEEP_TIME_IN_MILLIS_BETWEEN_CYCLE_PARAM = "usergroupSync.sleepTimeInMillisBetweenSyncCycle" ;
+	
+	private static final long UGSYNC_SLEEP_TIME_IN_MILLIS_BETWEEN_CYCLE_UNIX_DEFAULT_VALUE = 300000L ;
+	
+	private static final long UGSYNC_SLEEP_TIME_IN_MILLIS_BETWEEN_CYCLE_LDAP_DEFAULT_VALUE = 21600000L ;
+
+	private static final String UGSYNC_SOURCE_CLASS_PARAM = "usergroupSync.source.impl.class";
+
+	private static final String UGSYNC_SINK_CLASS_PARAM = "usergroupSync.sink.impl.class";
+
+	private static final String UGSYNC_SOURCE_CLASS = "com.xasecure.unixusersync.process.UnixUserGroupBuilder";
+
+	private static final String UGSYNC_SINK_CLASS = "com.xasecure.unixusersync.process.PolicyMgrUserGroupBuilder";
+
+	private static final String LGSYNC_SOURCE_CLASS = "com.xasecure.ldapusersync.process.LdapUserGroupBuilder";
+	
+	private static final String LGSYNC_LDAP_URL = "ldapGroupSync.ldapUrl";
+	
+	private static final String LGSYNC_LDAP_BIND_DN = "ldapGroupSync.ldapBindDn";
+	
+	private static final String LGSYNC_LDAP_BIND_KEYSTORE = "ldapGroupSync.ldapBindKeystore";
+	
+	private static final String LGSYNC_LDAP_BIND_ALIAS = "ldapGroupSync.ldapBindAlias";
+	
+	private static final String LGSYNC_LDAP_BIND_PASSWORD = "ldapGroupSync.ldapBindPassword";	
+	
+	private static final String LGSYNC_LDAP_AUTHENTICATION_MECHANISM = "ldapGroupSync.ldapAuthenticationMechanism";
+	
+	private static final String LGSYNC_USER_SEARCH_BASE = "ldapGroupSync.userSearchBase";
+	
+	private static final String LGSYNC_USER_OBJECT_CLASS = "ldapGroupSync.userObjectClass";
+	
+	private static final String LGSYNC_USER_SEARCH_FILTER = "ldapGroupSync.userSearchFilter";
+	
+	private static final String LGSYNC_USER_NAME_ATTRIBUTE = "ldapGroupSync.userNameAttribute";
+	
+	private static final String LGSYNC_USER_GROUP_NAME_ATTRIBUTE = "ldapGroupSync.userGroupNameAttribute";
+	
+	private static final String DEFAULT_AUTHENTICATION_MECHANISM = "simple";
+	
+	private static final String DEFAULT_USER_OBJECT_CLASS = "person";
+	
+	private static final String DEFAULT_USER_NAME_ATTRIBUTE = "cn";
+	
+	private static final String DEFAULT_USER_GROUP_NAME_ATTRIBUTE = "memberof,ismemberof";
+
+	private Properties prop = new Properties() ;
+	
+	private static UserGroupSyncConfig me = null ;
+	
+	public static UserGroupSyncConfig getInstance() {
+		if (me == null) {
+			synchronized(UserGroupSyncConfig.class) {
+				UserGroupSyncConfig temp = me ;
+				if (temp == null) {
+					me = new UserGroupSyncConfig() ;
+				}
+			}
+		}
+		return me ;
+	}
+	
+	
+	private UserGroupSyncConfig() {
+		init() ;
+	}
+	
+	
+	private void init() {
+		try {
+			InputStream in = getFileInputStream(CONFIG_FILE) ;
+			if (in != null) {
+				prop.load(in) ;
+			}
+		} catch (Throwable e) {
+			throw new RuntimeException("Unable to load configuration file [" + CONFIG_FILE + "]", e) ;
+		}
+	}
+	
+	
+	private InputStream getFileInputStream(String path) throws FileNotFoundException {
+
+		InputStream ret = null;
+
+		File f = new File(path);
+
+		if (f.exists()) {
+			ret = new FileInputStream(f);
+		} else {
+			ret = getClass().getResourceAsStream(path);
+			
+			if (ret == null) {
+				if (! path.startsWith("/")) {
+					ret = getClass().getResourceAsStream("/" + path);
+				}
+			}
+			
+			if (ret == null) {
+				ret = ClassLoader.getSystemClassLoader().getResourceAsStream(path) ;
+				if (ret == null) {
+					if (! path.startsWith("/")) {
+						ret = ClassLoader.getSystemResourceAsStream("/" + path);
+					}
+				}
+			}
+		}
+
+		return ret;
+	}
+	
+	
+	public boolean isUserSyncEnabled() {
+		String val = prop.getProperty(UGSYNC_ENABLED_PROP) ;
+		return (val != null && val.trim().equalsIgnoreCase("true")) ;
+	}
+
+	
+	public boolean isMockRunEnabled() {
+		String val = prop.getProperty(UGSYNC_MOCK_RUN_PROP) ;
+		return (val != null && val.trim().equalsIgnoreCase("true")) ;
+	}
+	
+	
+	public String getPolicyManagerBaseURL() {
+		return prop.getProperty(UGSYNC_PM_URL_PROP) ;
+	}
+	
+	
+	public String getMinUserId() {
+		return prop.getProperty(UGSYNC_MIN_USERID_PROP) ;
+	}
+	
+	public String getMaxRecordsPerAPICall() {
+		return prop.getProperty(UGSYNC_MAX_RECORDS_PER_API_CALL_PROP) ;
+	}
+	
+	
+	public String getSSLKeyStorePath() {
+		return  prop.getProperty(SSL_KEYSTORE_PATH_PARAM) ;
+	}
+
+	
+	public String getSSLKeyStorePathPassword() {
+		return  prop.getProperty(SSL_KEYSTORE_PATH_PASSWORD_PARAM) ;
+	}
+	
+	public String getSSLTrustStorePath() {
+		return  prop.getProperty(SSL_TRUSTSTORE_PATH_PARAM) ;
+	}
+	
+	
+	public String getSSLTrustStorePathPassword() {
+		return  prop.getProperty(SSL_TRUSTSTORE_PATH_PASSWORD_PARAM) ;
+	}
+	
+	
+	public long getSleepTimeInMillisBetweenCycle() throws Throwable {
+		String val =  prop.getProperty(UGSYNC_SLEEP_TIME_IN_MILLIS_BETWEEN_CYCLE_PARAM) ;
+		if (val == null) {
+			if (LGSYNC_SOURCE_CLASS.equals(getUserGroupSource())) {
+				return UGSYNC_SLEEP_TIME_IN_MILLIS_BETWEEN_CYCLE_LDAP_DEFAULT_VALUE ;
+			} else {
+				return UGSYNC_SLEEP_TIME_IN_MILLIS_BETWEEN_CYCLE_UNIX_DEFAULT_VALUE ;
+			}
+		}
+		else {
+			long ret = Long.parseLong(val) ;
+			return ret;
+		}
+		
+	}
+	
+	
+	public UserGroupSource getUserGroupSource() throws Throwable {
+		String val =  prop.getProperty(UGSYNC_SOURCE_CLASS_PARAM) ;
+
+		if(val == null) {
+			val = UGSYNC_SOURCE_CLASS;
+		}
+
+		Class<UserGroupSource> ugSourceClass = (Class<UserGroupSource>)Class.forName(val);
+
+		UserGroupSource ret = ugSourceClass.newInstance();
+
+		return ret;
+	}
+
+	
+	public UserGroupSink getUserGroupSink() throws Throwable {
+		String val =  prop.getProperty(UGSYNC_SINK_CLASS_PARAM) ;
+
+		if(val == null) {
+			val = UGSYNC_SINK_CLASS;
+		}
+
+		Class<UserGroupSink> ugSinkClass = (Class<UserGroupSink>)Class.forName(val);
+
+		UserGroupSink ret = ugSinkClass.newInstance();
+
+		return ret;
+	}
+
+	
+	public String getLdapUrl() throws Throwable {
+		String val =  prop.getProperty(LGSYNC_LDAP_URL);
+		if(val == null || val.trim().isEmpty()) {
+			throw new Exception(LGSYNC_LDAP_URL + " for LdapGroupSync is not specified");
+		}
+		return val;
+	}
+
+	
+	public String getLdapBindDn() throws Throwable {
+		String val =  prop.getProperty(LGSYNC_LDAP_BIND_DN);
+		if(val == null || val.trim().isEmpty()) {
+			throw new Exception(LGSYNC_LDAP_BIND_DN + " for LdapGroupSync is not specified");
+		}
+		return val;
+	}
+	
+	
+	public String getLdapBindPassword() {
+		//update credential from keystore
+		if(prop!=null && prop.containsKey(LGSYNC_LDAP_BIND_KEYSTORE) &&  prop.containsKey(LGSYNC_LDAP_BIND_ALIAS)){	
+			String path=prop.getProperty(LGSYNC_LDAP_BIND_KEYSTORE);
+			String alias=prop.getProperty(LGSYNC_LDAP_BIND_ALIAS);
+			if(path!=null && alias!=null){
+				if(!path.trim().isEmpty() && !alias.trim().isEmpty()){
+					String password=CredentialReader.getDecryptedString(path.trim(),alias.trim());
+					if(password!=null&& !password.trim().isEmpty() && !password.trim().equalsIgnoreCase("none")){
+						prop.setProperty(LGSYNC_LDAP_BIND_PASSWORD,password);
+						//System.out.println("Password IS :"+password);
+					}
+				}
+			}		
+		}
+		return prop.getProperty(LGSYNC_LDAP_BIND_PASSWORD);
+	}
+	
+	
+	public String getLdapAuthenticationMechanism() {
+		String val =  prop.getProperty(LGSYNC_LDAP_AUTHENTICATION_MECHANISM);
+		if(val == null || val.trim().isEmpty()) {
+			return DEFAULT_AUTHENTICATION_MECHANISM;
+		}
+		return val;
+	}
+	
+	
+	public String getUserSearchBase()  throws Throwable {
+		String val =  prop.getProperty(LGSYNC_USER_SEARCH_BASE);
+		if(val == null || val.trim().isEmpty()) {
+			throw new Exception(LGSYNC_USER_SEARCH_BASE + " for LdapGroupSync is not specified");
+		}
+		return val;
+	}
+	
+	
+	public int getUserSearchScope() {
+		String val =  prop.getProperty(LGSYNC_USER_SEARCH_BASE);
+		if (val == null || val.trim().isEmpty()) {
+			return 2; //subtree scope
+		}
+		
+		val = val.trim().toLowerCase();
+		if (val.equals(0) || val.startsWith("base")) {
+			return 0; // object scope
+		} else if (val.equals(1) || val.startsWith("one")) {
+			return 1; // one level scope
+		} else {
+			return 2; // subtree scope
+		}
+	}
+	
+	
+	public String getUserObjectClass() {
+		String val =  prop.getProperty(LGSYNC_USER_OBJECT_CLASS);
+		if (val == null || val.trim().isEmpty()) {
+			return DEFAULT_USER_OBJECT_CLASS;
+		}
+		return val;
+	}
+	
+	public String getUserSearchFilter() {
+		return prop.getProperty(LGSYNC_USER_SEARCH_FILTER);
+	}
+
+	
+	public String getUserNameAttribute() {
+		String val =  prop.getProperty(LGSYNC_USER_NAME_ATTRIBUTE);
+		if(val == null || val.trim().isEmpty()) {
+			return DEFAULT_USER_NAME_ATTRIBUTE;
+		}
+		return val;
+	}
+	
+	public String getUserGroupNameAttribute() {
+		String val =  prop.getProperty(LGSYNC_USER_GROUP_NAME_ATTRIBUTE);
+		if(val == null || val.trim().isEmpty()) {
+			return DEFAULT_USER_GROUP_NAME_ATTRIBUTE;
+		}
+		return val;
+	}
+	
+	public Set<String> getUserGroupNameAttributeSet() {
+		String uga =  getUserGroupNameAttribute();
+		StringTokenizer st = new StringTokenizer(uga, ",");
+		Set<String> userGroupNameAttributeSet = new HashSet<String>();
+		while (st.hasMoreTokens()) {
+			userGroupNameAttributeSet.add(st.nextToken().trim());
+		}
+		return userGroupNameAttributeSet;
+	}
+	
+	
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/unixusersync/model/GetXGroupListResponse.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/unixusersync/model/GetXGroupListResponse.java b/ugsync/src/main/java/com/xasecure/unixusersync/model/GetXGroupListResponse.java
new file mode 100644
index 0000000..7523ee9
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/unixusersync/model/GetXGroupListResponse.java
@@ -0,0 +1,31 @@
+package com.xasecure.unixusersync.model;
+
+import java.util.List;
+
+import com.google.gson.annotations.SerializedName;
+
+public class GetXGroupListResponse {
+	private int totalCount ;
+
+	@SerializedName("vXGroups")
+	List<XGroupInfo> xgroupInfoList ;
+
+	public int getTotalCount() {
+		return totalCount;
+	}
+
+	public void setTotalCount(int totalCount) {
+		this.totalCount = totalCount;
+	}
+
+	public List<XGroupInfo> getXgroupInfoList() {
+		return xgroupInfoList;
+	}
+
+	public void setXgroupInfoList(List<XGroupInfo> xgroupInfoList) {
+		this.xgroupInfoList = xgroupInfoList;
+	}
+	
+	
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/unixusersync/model/GetXUserGroupListResponse.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/unixusersync/model/GetXUserGroupListResponse.java b/ugsync/src/main/java/com/xasecure/unixusersync/model/GetXUserGroupListResponse.java
new file mode 100644
index 0000000..afc4cd6
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/unixusersync/model/GetXUserGroupListResponse.java
@@ -0,0 +1,31 @@
+package com.xasecure.unixusersync.model;
+
+import java.util.List;
+
+import com.google.gson.annotations.SerializedName;
+
+public class GetXUserGroupListResponse {
+	private int totalCount ;
+
+	@SerializedName("vXGroupUsers")
+	List<XUserGroupInfo> xusergroupInfoList ;
+
+	public int getTotalCount() {
+		return totalCount;
+	}
+
+	public void setTotalCount(int totalCount) {
+		this.totalCount = totalCount;
+	}
+
+	public List<XUserGroupInfo> getXusergroupInfoList() {
+		return xusergroupInfoList;
+	}
+
+	public void setXusergroupInfoList(List<XUserGroupInfo> xusergroupInfoList) {
+		this.xusergroupInfoList = xusergroupInfoList;
+	}
+
+	
+	
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/unixusersync/model/GetXUserListResponse.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/unixusersync/model/GetXUserListResponse.java b/ugsync/src/main/java/com/xasecure/unixusersync/model/GetXUserListResponse.java
new file mode 100644
index 0000000..a7ae9ef
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/unixusersync/model/GetXUserListResponse.java
@@ -0,0 +1,32 @@
+package com.xasecure.unixusersync.model;
+
+import java.util.List;
+
+import com.google.gson.annotations.SerializedName;
+
+public class GetXUserListResponse {
+
+	private int totalCount ;
+
+	@SerializedName("vXUsers")
+	List<XUserInfo> xuserInfoList ;
+	
+	public int getTotalCount() {
+		return totalCount;
+	}
+
+	public void setTotalCount(int totalCount) {
+		this.totalCount = totalCount;
+	}
+
+	public List<XUserInfo> getXuserInfoList() {
+		return xuserInfoList;
+	}
+
+	public void setXuserInfoList(List<XUserInfo> xuserInfoList) {
+		this.xuserInfoList = xuserInfoList;
+	}
+
+	
+	
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/unixusersync/model/MUserInfo.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/unixusersync/model/MUserInfo.java b/ugsync/src/main/java/com/xasecure/unixusersync/model/MUserInfo.java
new file mode 100644
index 0000000..7933353
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/unixusersync/model/MUserInfo.java
@@ -0,0 +1,43 @@
+package com.xasecure.unixusersync.model;
+
+public class MUserInfo {
+	
+	private String loginId ;
+	private String firstName ; 
+	private String lastName ; 
+	private String emailAddress ; 
+	private String[] userRoleList = { "ROLE_USER" } ;
+	
+	
+	public String getLoginId() {
+		return loginId;
+	}
+	public void setLoginId(String loginId) {
+		this.loginId = loginId;
+	}
+	public String getFirstName() {
+		return firstName;
+	}
+	public void setFirstName(String firstName) {
+		this.firstName = firstName;
+	}
+	public String getLastName() {
+		return lastName;
+	}
+	public void setLastName(String lastName) {
+		this.lastName = lastName;
+	}
+	public String getEmailAddress() {
+		return emailAddress;
+	}
+	public void setEmailAddress(String emailAddress) {
+		this.emailAddress = emailAddress;
+	}
+	public String[] getUserRoleList() {
+		return userRoleList;
+	}
+	public void setUserRoleList(String[] userRoleList) {
+		this.userRoleList = userRoleList;
+	} 
+	
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/unixusersync/model/XGroupInfo.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/unixusersync/model/XGroupInfo.java b/ugsync/src/main/java/com/xasecure/unixusersync/model/XGroupInfo.java
new file mode 100644
index 0000000..671b5cc
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/unixusersync/model/XGroupInfo.java
@@ -0,0 +1,37 @@
+package com.xasecure.unixusersync.model;
+
+public class XGroupInfo {
+	
+	private String id ;
+	private String name ;
+	private String description ;
+	private String groupType ;
+	
+	public String getId() {
+		return id;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public String getDescription() {
+		return description;
+	}
+	public void setDescription(String description) {
+		this.description = description;
+	}
+	
+	public String getGroupType() {
+		return groupType;
+	}
+	public void setGroupType(String groupType) {
+		this.groupType = groupType;
+	}
+	
+	
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/unixusersync/model/XUserGroupInfo.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/unixusersync/model/XUserGroupInfo.java b/ugsync/src/main/java/com/xasecure/unixusersync/model/XUserGroupInfo.java
new file mode 100644
index 0000000..72d3fe7
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/unixusersync/model/XUserGroupInfo.java
@@ -0,0 +1,40 @@
+package com.xasecure.unixusersync.model;
+
+import com.google.gson.annotations.SerializedName;
+
+public class XUserGroupInfo {
+
+	private String userId ;
+	@SerializedName("name") 
+	private String groupName ;
+	private String parentGroupId ;
+
+	
+	
+	public String getUserId() {
+		return userId;
+	}
+
+	public void setUserId(String userId) {
+		this.userId = userId;
+	}
+
+	public String getGroupName() {
+		return groupName;
+	}
+
+	public void setGroupName(String groupName) {
+		this.groupName = groupName;
+	}
+	
+	public String getParentGroupId() {
+		return parentGroupId;
+	}
+
+	public void setParentGroupId(String parentGroupId) {
+		this.parentGroupId = parentGroupId;
+	}
+
+	
+	
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/unixusersync/model/XUserInfo.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/unixusersync/model/XUserInfo.java b/ugsync/src/main/java/com/xasecure/unixusersync/model/XUserInfo.java
new file mode 100644
index 0000000..1a94ffa
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/unixusersync/model/XUserInfo.java
@@ -0,0 +1,36 @@
+package com.xasecure.unixusersync.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class XUserInfo {
+	private String id ;
+	private String name ;
+	private String 	description ;
+	
+	private List<String>  groups = new ArrayList<String>() ;
+	
+	public String getId() {
+		return id;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public String getDescription() {
+		return description;
+	}
+	public void setDescription(String description) {
+		this.description = description;
+	}
+	
+	public List<String> getGroups() {
+		return groups;
+	}
+	
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/unixusersync/poc/InvalidGroupException.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/unixusersync/poc/InvalidGroupException.java b/ugsync/src/main/java/com/xasecure/unixusersync/poc/InvalidGroupException.java
new file mode 100644
index 0000000..9fd7ee9
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/unixusersync/poc/InvalidGroupException.java
@@ -0,0 +1,20 @@
+package com.xasecure.unixusersync.poc;
+
+public class InvalidGroupException extends Exception
+
+{
+     private static final long serialVersionUID = 1L;
+     private final String line;
+
+     public InvalidGroupException(final String msg, final String ln)
+     {
+         super(msg);
+
+         line = ln;
+     }
+
+     public String getLine()
+     {
+         return (line);
+     }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/unixusersync/poc/InvalidUserException.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/unixusersync/poc/InvalidUserException.java b/ugsync/src/main/java/com/xasecure/unixusersync/poc/InvalidUserException.java
new file mode 100644
index 0000000..e860cc4
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/unixusersync/poc/InvalidUserException.java
@@ -0,0 +1,20 @@
+package com.xasecure.unixusersync.poc;
+
+public class InvalidUserException extends Exception
+
+{
+     private static final long serialVersionUID = 1L;
+     private final String line;
+
+     public InvalidUserException(final String msg, final String ln)
+     {
+         super(msg);
+
+         line = ln;
+     }
+
+     public String getLine()
+     {
+         return (line);
+     }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/unixusersync/poc/ListUserGroupTest.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/unixusersync/poc/ListUserGroupTest.java b/ugsync/src/main/java/com/xasecure/unixusersync/poc/ListUserGroupTest.java
new file mode 100644
index 0000000..1da1cbd
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/unixusersync/poc/ListUserGroupTest.java
@@ -0,0 +1,20 @@
+package com.xasecure.unixusersync.poc;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+
+public class ListUserGroupTest {
+	
+	//test code for client user group mapping fetch
+ 	
+  private static String passwdfile = "C:\\git\\xa_server\\conf\\client\\passwd";
+		   		
+  private static ArrayList<HashMap<String, String>> clientusergroupmapping = null;
+  
+  public static void main(String[] args) {
+
+	clientusergroupmapping = XaSecureClientUserGroupMapping.buildClientUserGroupMapping(passwdfile) ;
+	System.out.println(clientusergroupmapping);
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/unixusersync/poc/ListUserTest.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/unixusersync/poc/ListUserTest.java b/ugsync/src/main/java/com/xasecure/unixusersync/poc/ListUserTest.java
new file mode 100644
index 0000000..1186254
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/unixusersync/poc/ListUserTest.java
@@ -0,0 +1,30 @@
+package com.xasecure.unixusersync.poc;
+
+import java.io.BufferedReader;
+import java.io.FileReader;
+
+
+public class ListUserTest
+{
+ public static String strLine;
+
+ public static void main(String args[])
+  {
+	 
+  try{
+  
+	  FileReader file = new FileReader("C:\\git\\xa_server\\conf\\client\\passwd");
+      BufferedReader br = new BufferedReader(file);
+  
+	  while ((strLine = br.readLine()) != null)   {
+		 ListXaSecureUser userList = ListXaSecureUser.parseUser(strLine);
+		 System.out.println(userList.getName() + " " + userList.getUid() + " " + userList.getGid());
+	  }
+	
+	  file.close();
+    }catch (Exception e){//Catch exception if any
+    	System.err.println("Error: " + e.getMessage());
+    }
+  }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/unixusersync/poc/ListXaSecureUser.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/unixusersync/poc/ListXaSecureUser.java b/ugsync/src/main/java/com/xasecure/unixusersync/poc/ListXaSecureUser.java
new file mode 100644
index 0000000..1127374
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/unixusersync/poc/ListXaSecureUser.java
@@ -0,0 +1,97 @@
+package com.xasecure.unixusersync.poc;
+
+
+public class ListXaSecureUser
+{
+    private final String uid;
+    private final String uname;
+    private final String gid;
+    
+    public static ListXaSecureUser parseUser(final String userLine)
+        throws InvalidUserException
+    {
+        final String   line;
+        final String[] parts;
+
+        if(userLine == null)
+        {
+            throw new IllegalArgumentException("userLine cannot be null");
+        }
+
+        line = userLine.trim();
+
+        if(line.startsWith("#") || line.isEmpty())
+        {
+             return null;
+        }
+
+        parts = line.split(":");
+
+        if(parts.length < 3)
+        {
+            throw new InvalidUserException(userLine + "must be in the format of name:passwd:gid[:userlist]", line);
+        }
+
+        try
+        {
+            final ListXaSecureUser       xaUser;
+            final String       uname;
+            final String	   uid;
+            final String       gid;
+          
+            uname  = parts[0];
+            uid    = parts[2];
+            gid    = parts[3];
+            
+            xaUser = new ListXaSecureUser(uname, uid, gid);
+
+            return xaUser;
+        }
+        catch(final NumberFormatException ex)
+        {
+            throw new InvalidUserException(userLine + " uid must be a number", line);
+        }
+    }
+
+    public ListXaSecureUser(final String nm, final String userid, final String grpid )
+    {
+        uname    = nm;
+        uid      = userid;
+        gid 	 = grpid;
+        
+    }
+
+    public String getGid()
+    {
+        return (gid);
+    }
+
+    public String getName()
+    {
+        return (uname);
+    }
+
+    public String getUid()
+    {
+        return (uid);
+    }
+
+   
+    @Override
+    public String toString()
+    {
+        final StringBuilder sb;
+
+        sb = new StringBuilder();
+        sb.append(uname);
+        sb.append(":");
+        sb.append(uid);
+        sb.append(":");
+        sb.append(gid);
+        
+        sb.setLength(sb.length() - 1);
+
+        return (sb.toString());
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/unixusersync/poc/ListXaSecureUserGroup.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/unixusersync/poc/ListXaSecureUserGroup.java b/ugsync/src/main/java/com/xasecure/unixusersync/poc/ListXaSecureUserGroup.java
new file mode 100644
index 0000000..78881fe
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/unixusersync/poc/ListXaSecureUserGroup.java
@@ -0,0 +1,123 @@
+package com.xasecure.unixusersync.poc;
+
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public class ListXaSecureUserGroup
+{
+    private final int gid;
+    private final String name;
+    private final String passwd;
+    private final List<String> userList;
+
+    public static ListXaSecureUserGroup parseGroup(final String groupLine)
+        throws InvalidGroupException
+    {
+        final String   line;
+        final String[] parts;
+
+        if(groupLine == null)
+        {
+            throw new IllegalArgumentException("groupLine cannot be null");
+        }
+
+        line = groupLine.trim();
+
+        if(line.startsWith("#") || line.isEmpty())
+        {
+             return null;
+        }
+
+        parts = line.split(":");
+
+        if(parts.length < 3)
+        {
+            throw new InvalidGroupException(groupLine + "must be in the format of name:passwd:gid[:userlist]", line);
+        }
+
+        try
+        {
+            final ListXaSecureUserGroup        group;
+            final String       name;
+            final String       passwd;
+            final int          gid;
+            final List<String> userList;
+
+            name   = parts[0];
+            passwd = parts[1];
+            gid    = Integer.parseInt(parts[2]);
+
+            if(parts.length == 4)
+            {
+                userList = Arrays.asList(parts[3].split(","));
+            }
+            else
+            {
+                userList = Collections.emptyList();
+            }
+
+            group = new ListXaSecureUserGroup(name, passwd, gid, userList);
+
+            return group;
+        }
+        catch(final NumberFormatException ex)
+        {
+            throw new InvalidGroupException(groupLine + " gid must be a number", line);
+        }
+    }
+
+    public ListXaSecureUserGroup(final String nm, final String pw, final int id, final List<String> users)
+    {
+        name     = nm;
+        passwd   = pw;
+        gid      = id;
+        userList = Collections.unmodifiableList(new ArrayList<String>(users));
+    }
+
+    public int getGid()
+    {
+        return (gid);
+    }
+
+    public String getName()
+    {
+        return (name);
+    }
+
+    public String getPasswd()
+    {
+        return (passwd);
+    }
+
+    public List<String> getUserList()
+    {
+        return (userList);
+    }
+
+    @Override
+    public String toString()
+    {
+        final StringBuilder sb;
+
+        sb = new StringBuilder();
+        sb.append(name);
+        sb.append(":");
+        sb.append(passwd);
+        sb.append(":");
+        sb.append(gid);
+        sb.append(":");
+
+        for(final String user : userList)
+        {
+            sb.append(user);
+            sb.append(",");
+        }
+
+        sb.setLength(sb.length() - 1);
+
+        return (sb.toString());
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/unixusersync/poc/RestClientPost.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/unixusersync/poc/RestClientPost.java b/ugsync/src/main/java/com/xasecure/unixusersync/poc/RestClientPost.java
new file mode 100644
index 0000000..82167d2
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/unixusersync/poc/RestClientPost.java
@@ -0,0 +1,36 @@
+package com.xasecure.unixusersync.poc;
+
+import com.sun.jersey.api.client.Client;
+import com.sun.jersey.api.client.ClientResponse;
+import com.sun.jersey.api.client.WebResource;
+ 
+public class RestClientPost {
+ 
+  public static void main(String[] args) {
+ 
+	try {
+ 
+		Client client = Client.create();
+ 
+		WebResource webResource = client
+				   .resource("http://domain/service/xusers/group/testGroup/user/testUser");
+		ClientResponse response = webResource.type("application/json")
+				.post(ClientResponse.class);
+		 
+		if (response.getStatus() != 200) {
+			throw new RuntimeException("Failed : HTTP error code : "
+			     + response.getStatus());
+		}
+ 
+		System.out.println("Output from Server .... \n");
+		String output = response.getEntity(String.class);
+		System.out.println(output);
+ 
+	  } catch (Exception e) {
+ 
+		e.printStackTrace();
+ 
+	  }
+ 
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/unixusersync/poc/XaSecureClientUserGroupMapping.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/unixusersync/poc/XaSecureClientUserGroupMapping.java b/ugsync/src/main/java/com/xasecure/unixusersync/poc/XaSecureClientUserGroupMapping.java
new file mode 100644
index 0000000..c7658b5
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/unixusersync/poc/XaSecureClientUserGroupMapping.java
@@ -0,0 +1,48 @@
+package com.xasecure.unixusersync.poc;
+
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+public class XaSecureClientUserGroupMapping {
+	
+	private static String strLine;
+	private static final String TAG_USER_NAME = "name";
+	private static final String TAG_USER_ID = "userId";
+	private static final String TAG_GROUP_ID = "id";
+	
+	public static ArrayList<HashMap<String, String>> buildClientUserGroupMapping(String passwdFile){
+	
+	ArrayList<HashMap<String, String>> ClientUserGroupMapping = new ArrayList<HashMap<String, String>>();
+
+	try{
+		FileReader file = new FileReader(passwdFile);
+		
+	    BufferedReader br = new BufferedReader(file);
+	  
+		
+	    while ((strLine = br.readLine()) != null)  {
+	    	
+	    	ListXaSecureUser userList = ListXaSecureUser.parseUser(strLine);
+		 
+	    	HashMap<String, String> map = new HashMap<String, String>();
+         
+	    	// adding each child node to HashMap key => value
+	    	map.put(TAG_USER_NAME, userList.getName());
+	    	map.put(TAG_USER_ID, userList.getUid());
+	    	map.put(TAG_GROUP_ID, userList.getGid());
+	    	
+	    	// adding HashList to ArrayList
+            ClientUserGroupMapping.add(map);
+            
+			// System.out.println(userList.getName() + " " + userList.getUid() + " " + userList.getGid());
+		  }
+	
+	    file.close();
+		}catch (Exception e){//Catch exception if any
+			System.err.println("Error: " + e.getMessage());
+		}
+		return ClientUserGroupMapping;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/unixusersync/poc/XaSecureJSONParser.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/unixusersync/poc/XaSecureJSONParser.java b/ugsync/src/main/java/com/xasecure/unixusersync/poc/XaSecureJSONParser.java
new file mode 100644
index 0000000..9ac70f6
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/unixusersync/poc/XaSecureJSONParser.java
@@ -0,0 +1,44 @@
+package com.xasecure.unixusersync.poc;
+
+
+
+
+public class XaSecureJSONParser {
+
+	/*
+ private static final Log LOG = LogFactory.getLog(XaSecureJSONParser.class);
+ 
+ private static JSONObject jObj = null;
+ 
+ private static String jsonstr = "";
+
+ 
+ public  JSONObject getJSONFromUrl(String url) {
+	
+     try {
+		
+		Client client = Client.create();
+	 	WebResource webResource = client
+		   .resource(url);
+		
+	 	ClientResponse response = webResource.accept("application/json")
+                  .get(ClientResponse.class);
+
+		if (response.getStatus() != 200) {
+		   throw new RuntimeException("Failed : HTTP error code : "
+			+ response.getStatus());
+		}
+
+		jsonstr = response.getEntity(String.class);
+		jObj = new JSONObject(jsonstr);
+		
+	    } catch (Exception e) {
+	    	LOG.error("XaSecure JSON Parser:Error parsing data" , e);
+		}
+     	
+     	return jObj;
+    }
+    
+    */
+ 
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/unixusersync/poc/XaSecureUpdateUserGroupMapping.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/unixusersync/poc/XaSecureUpdateUserGroupMapping.java b/ugsync/src/main/java/com/xasecure/unixusersync/poc/XaSecureUpdateUserGroupMapping.java
new file mode 100644
index 0000000..f22ec9a
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/unixusersync/poc/XaSecureUpdateUserGroupMapping.java
@@ -0,0 +1,58 @@
+package com.xasecure.unixusersync.poc;
+
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Set;
+
+
+public class XaSecureUpdateUserGroupMapping {
+	
+  private static ArrayList<HashMap<String, String>> usergroupmapping = null;
+  
+  private static ArrayList<HashMap<String, String>> clientusergroupmapping = null;
+  
+  private static void compare_and_update(ArrayList<HashMap<String, String>> fromDB, ArrayList<HashMap<String, String>> fromFile ){
+	
+	  for(HashMap<String, String> hmap: fromDB) {
+		  String dbuserid = hmap.get("id");
+		  String dbgroupid = hmap.get("userId");
+		  if ( !findMatchingUserGroupId(dbuserid,dbgroupid,fromFile)) {
+			  	System.out.println(dbuserid + " " + dbgroupid);
+		  } 
+			   
+	  }
+  }
+  
+  private static boolean findMatchingUserGroupId(String dbuserid, String dbgroupid,ArrayList<HashMap<String, String>>  fromFile) {
+	  
+	  boolean matchFound = false;
+	  
+	  for(HashMap<String, String> fhmap: fromFile) {
+		  String fileuserid = fhmap.get("id");
+		  String filegroupid = fhmap.get("userId");
+		  
+		  if ( dbuserid.equals(fileuserid) && dbgroupid.equals(filegroupid) ) {
+			  matchFound = true;
+			  return matchFound;
+		  }
+	  }
+	  return matchFound;
+  }
+  
+  public static void main(String[] args) {
+
+	  /*
+	//get user group mapping from DB
+	usergroupmapping = XaSecureUserGroupMapping.buildUserGroupMapping(url) ;
+	
+	//get user group mapping from client system file
+	clientusergroupmapping = XaSecureClientUserGroupMapping.buildClientUserGroupMapping(passwdfile) ;
+	
+	compare_and_update(usergroupmapping,clientusergroupmapping);
+	
+	*/
+	}
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/unixusersync/poc/XaSecureUserGroupMapping.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/unixusersync/poc/XaSecureUserGroupMapping.java b/ugsync/src/main/java/com/xasecure/unixusersync/poc/XaSecureUserGroupMapping.java
new file mode 100644
index 0000000..3200d98
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/unixusersync/poc/XaSecureUserGroupMapping.java
@@ -0,0 +1,66 @@
+package com.xasecure.unixusersync.poc;
+
+
+public class XaSecureUserGroupMapping {
+
+	/*
+private static final String TAG_XGROUP_USERS ="vXGroupUsers";
+private static final String TAG_USER_NAME = "name";
+private static final String TAG_USER_ID = "userId";
+//private static final String TAG_GROUP_NAME = "name";
+private static final String TAG_GROUP_ID = "id";
+
+public static JSONArray vXGroupUsers = null;
+
+public static ArrayList<HashMap<String, String>> buildUserGroupMapping(String url){
+
+	//HashMap for UserGroupMapping
+	
+	ArrayList<HashMap<String, String>> UserGroupMapping = new ArrayList<HashMap<String, String>>();
+	 
+    // Creating JSON Parser instance
+    XaSecureJSONParser jParser = new XaSecureJSONParser();
+    
+    // getting JSON string from URL
+    JSONObject json = jParser.getJSONFromUrl(url);
+    
+    try {
+        // Getting Array of vXGroupUsers
+    	
+    	vXGroupUsers = json.getJSONArray(TAG_XGROUP_USERS);
+         
+        // looping through All vXGroupUsers
+    	
+        for(int i = 0; i < vXGroupUsers.length(); i++) {
+        	
+            JSONObject xausergroup = vXGroupUsers.getJSONObject(i);
+             
+            // Storing each json item in variable
+            String uname = xausergroup.getString(TAG_USER_NAME);
+            String uid = xausergroup.getString(TAG_USER_ID);
+            String gid = xausergroup.getString(TAG_GROUP_ID);
+           
+            
+            // creating new HashMap
+            HashMap<String, String> map = new HashMap<String, String>();
+             
+            // adding each child node to HashMap key => value
+            map.put(TAG_USER_NAME, uname);
+            map.put(TAG_USER_ID, uid);
+            map.put(TAG_GROUP_ID, gid);
+
+            // adding HashList to ArrayList
+            UserGroupMapping.add(map);
+            }
+        
+        } catch (JSONException e) {
+        e.printStackTrace();
+       	}
+    
+     return UserGroupMapping;
+    
+    }
+    */
+}
+
+

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/unixusersync/process/PolicyMgrUserGroupBuilder.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/unixusersync/process/PolicyMgrUserGroupBuilder.java b/ugsync/src/main/java/com/xasecure/unixusersync/process/PolicyMgrUserGroupBuilder.java
new file mode 100644
index 0000000..3ed7f72
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/unixusersync/process/PolicyMgrUserGroupBuilder.java
@@ -0,0 +1,684 @@
+package com.xasecure.unixusersync.process;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.net.UnknownHostException;
+import java.security.KeyStore;
+import java.security.SecureRandom;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.regex.Pattern;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.KeyManager;
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+import javax.ws.rs.core.MediaType;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.sun.jersey.api.client.Client;
+import com.sun.jersey.api.client.ClientResponse;
+import com.sun.jersey.api.client.WebResource;
+import com.sun.jersey.api.client.config.ClientConfig;
+import com.sun.jersey.api.client.config.DefaultClientConfig;
+import com.sun.jersey.client.urlconnection.HTTPSProperties;
+import com.xasecure.unixusersync.config.UserGroupSyncConfig;
+import com.xasecure.unixusersync.model.GetXGroupListResponse;
+import com.xasecure.unixusersync.model.GetXUserGroupListResponse;
+import com.xasecure.unixusersync.model.GetXUserListResponse;
+import com.xasecure.unixusersync.model.MUserInfo;
+import com.xasecure.unixusersync.model.XGroupInfo;
+import com.xasecure.unixusersync.model.XUserGroupInfo;
+import com.xasecure.unixusersync.model.XUserInfo;
+import com.xasecure.usergroupsync.UserGroupSink;
+
+public class PolicyMgrUserGroupBuilder implements UserGroupSink {
+	
+	private static final Logger LOG = Logger.getLogger(PolicyMgrUserGroupBuilder.class) ;
+	
+	public static final String PM_USER_LIST_URI  = "/service/xusers/users/" ;				// GET
+	private static final String PM_ADD_USER_URI  = "/service/xusers/users/" ;				// POST
+	
+	public static final String PM_GROUP_LIST_URI = "/service/xusers/groups/" ;				// GET
+	private static final String PM_ADD_GROUP_URI = "/service/xusers/groups/" ;				// POST
+	
+	public static final String PM_USER_GROUP_MAP_LIST_URI = "/service/xusers/groupusers/" ;		// GET
+	private static final String PM_ADD_USER_GROUP_LINK_URI = "/service/xusers/groupusers/" ;	// POST
+	
+	private static final String PM_DEL_USER_GROUP_LINK_URI = "/service/xusers/group/${groupName}/user/${userName}" ; // DELETE
+	
+	private static final String PM_ADD_LOGIN_USER_URI = "/service/users/default" ;			// POST
+	
+	private static String LOCAL_HOSTNAME = "unknown" ;
+	private String recordsToPullPerCall = "1000" ;
+	private boolean isMockRun = false ;
+	private String policyMgrBaseUrl ;
+	
+	private UserGroupSyncConfig  config = UserGroupSyncConfig.getInstance() ;
+
+	private List<XGroupInfo> 			xgroupList = new ArrayList<XGroupInfo>() ;
+	private List<XUserInfo> 			xuserList = new ArrayList<XUserInfo>() ;
+	private List<XUserGroupInfo> 		xusergroupList = new ArrayList<XUserGroupInfo>() ;
+	private HashMap<String,XUserInfo>  	userId2XUserInfoMap = new HashMap<String,XUserInfo>() ;
+	private HashMap<String,XUserInfo>  	userName2XUserInfoMap = new HashMap<String,XUserInfo>() ;
+	private HashMap<String,XGroupInfo>  groupName2XGroupInfoMap = new HashMap<String,XGroupInfo>() ;
+	
+	private String keyStoreFile =  null ;
+	private String keyStoreFilepwd = null; 
+	private String trustStoreFile = null ;
+	private String trustStoreFilepwd = null ;
+	private String keyStoreType = null ;
+	private String trustStoreType = null ;
+	private HostnameVerifier hv =  null ;
+
+	private SSLContext sslContext = null ;
+
+	
+	static {
+		try {
+			LOCAL_HOSTNAME = java.net.InetAddress.getLocalHost().getHostName();
+		} catch (UnknownHostException e) {
+			LOCAL_HOSTNAME = "unknown" ;
+		} 
+	}
+	
+	
+	public static void main(String[] args) throws Throwable {
+		PolicyMgrUserGroupBuilder  ugbuilder = new PolicyMgrUserGroupBuilder() ;
+		ugbuilder.init() ;
+//		ugbuilder.print();
+//		ugbuilder.addMUser("testuser") ;
+//		ugbuilder.addXUserInfo("testuser") ;
+//		ugbuilder.addXGroupInfo("testgroup") ;
+// 		XUserInfo u = ugbuilder.addXUserInfo("testuser") ;
+//		XGroupInfo g = ugbuilder.addXGroupInfo("testgroup") ;
+//		 ugbuilder.addXUserGroupInfo(u, g) ;
+		
+	}
+
+	
+	public void init() throws Throwable {
+		recordsToPullPerCall = config.getMaxRecordsPerAPICall() ;
+		policyMgrBaseUrl = config.getPolicyManagerBaseURL() ;
+		isMockRun = config.isMockRunEnabled() ;
+		
+		if (isMockRun) {
+			LOG.setLevel(Level.DEBUG) ;
+		}
+		
+		keyStoreFile =  config.getSSLKeyStorePath() ;
+		keyStoreFilepwd = config.getSSLKeyStorePathPassword() ; 
+		trustStoreFile = config.getSSLTrustStorePath() ;
+		trustStoreFilepwd = config.getSSLTrustStorePathPassword() ;
+		keyStoreType = KeyStore.getDefaultType() ;
+		trustStoreType = KeyStore.getDefaultType() ;
+		
+		buildUserGroupInfo() ;
+	}
+	
+	private void buildUserGroupInfo() throws Throwable {
+		buildGroupList(); 
+		buildUserList();
+		buildUserGroupLinkList() ;
+		rebuildUserGroupMap() ;
+		if (LOG.isDebugEnabled()) {
+			this.print(); 
+		}
+	}
+	
+	private String getURL(String uri) {
+		String ret = null ;
+		ret = policyMgrBaseUrl + (uri.startsWith("/") ? uri : ("/" + uri)) ;
+		return ret;
+	}
+	
+	
+	
+	private void rebuildUserGroupMap() {
+		
+		for(XUserInfo user : xuserList) {
+			addUserToList(user);
+		}
+		
+		for(XGroupInfo group : xgroupList) {
+			addGroupToList(group);
+		}
+		
+		for(XUserGroupInfo ug : xusergroupList) {
+			addUserGroupToList(ug);
+		}
+	}
+	
+	
+	private void addUserToList(XUserInfo aUserInfo) {
+		if (! xuserList.contains(aUserInfo)) {
+			xuserList.add(aUserInfo) ;
+		}
+		
+		String userId = aUserInfo.getId() ;
+		
+		if (userId != null) {
+			userId2XUserInfoMap.put(userId, aUserInfo) ;
+		}
+		
+		String userName = aUserInfo.getName();
+		
+		if (userName != null) {
+			userName2XUserInfoMap.put(userName, aUserInfo) ;
+		}
+	}
+	
+
+	private void addGroupToList(XGroupInfo aGroupInfo) {
+		
+		if (! xgroupList.contains(aGroupInfo) ) {
+			xgroupList.add(aGroupInfo) ;
+		}
+
+		if (aGroupInfo.getName() != null) {
+			groupName2XGroupInfoMap.put(aGroupInfo.getName(), aGroupInfo) ;
+		}
+
+	}
+	
+	
+	private void addUserGroupToList(XUserGroupInfo ugInfo) {
+		String userId = ugInfo.getUserId() ;
+		
+		if (userId != null) {
+			XUserInfo user = userId2XUserInfoMap.get(userId) ;
+			
+			if (user != null) {
+				List<String> groups = user.getGroups() ;
+				if (! groups.contains(ugInfo.getGroupName())) {
+					groups.add(ugInfo.getGroupName()) ;
+				}
+			}
+		}
+	}
+
+	private void delUserGroupFromList(XUserInfo userInfo, XGroupInfo groupInfo) {
+		List<String> groups = userInfo.getGroups() ;
+		if (groups.contains(groupInfo.getName())) {
+			groups.remove(groupInfo.getName()) ;
+		}
+	}
+	
+	private void print() {
+		LOG.debug("Number of users read [" + xuserList.size() + "]");
+		for(XUserInfo user : xuserList) {
+			LOG.debug("USER: " + user.getName()) ;
+			for(String group : user.getGroups()) {
+				LOG.debug("\tGROUP: " + group) ;
+			}
+		}
+	}
+
+	@Override
+	public void addOrUpdateUser(String userName, List<String> groups) {
+		XUserInfo user = userName2XUserInfoMap.get(userName) ;
+		
+		if (groups == null) {
+			groups = new ArrayList<String>() ;
+		}
+		
+		if (user == null) {    // Does not exists
+			LOG.debug("INFO: addPMAccount(" + userName + ")" ) ;
+			if (! isMockRun) {
+				addMUser(userName) ;
+			}
+			
+			LOG.debug("INFO: addPMXAUser(" + userName + ")" ) ;
+			if (! isMockRun) {
+				user = addXUserInfo(userName) ;
+			}
+			
+ 			for(String g : groups) {
+ 				LOG.debug("INFO: addPMXAGroupToUser(" + userName + "," + g + ")" ) ;
+ 			}
+ 			if (! isMockRun ) { 
+ 				addXUserGroupInfo(user, groups) ;
+ 			}
+		}
+		else {					// Validate group memberships
+			List<String> oldGroups = user.getGroups() ;
+			
+			List<String> addGroups = new ArrayList<String>() ;
+			List<String> delGroups = new ArrayList<String>() ;
+			
+			for(String group : groups) {
+				if (! oldGroups.contains(group)) {
+					addGroups.add(group) ;
+				}
+			}
+			
+			for(String group : oldGroups) {
+				if (! groups.contains(group) ) {
+					delGroups.add(group) ;
+				}
+			}
+			
+ 			for(String g : addGroups) {
+ 				LOG.debug("INFO: addPMXAGroupToUser(" + userName + "," + g + ")" ) ;
+ 			}
+ 			if (! isMockRun) {
+ 				addXUserGroupInfo(user, addGroups) ;
+ 			}
+ 			
+ 			for(String g : delGroups) {
+ 				LOG.debug("INFO: delPMXAGroupFromUser(" + userName + "," + g + ")" ) ;
+ 			}
+ 			
+ 			if (! isMockRun ) {
+ 				delXUserGroupInfo(user, delGroups) ;
+ 			}
+			
+		}
+	}
+	
+	
+	private void buildGroupList() {
+		
+	    Client c = getClient() ;
+	    
+	    int totalCount = 100 ;
+	    int retrievedCount = 0 ;
+	    
+	    while (retrievedCount < totalCount) {
+	    	
+		    WebResource r = c.resource(getURL(PM_GROUP_LIST_URI))
+		    					.queryParam("pageSize", recordsToPullPerCall)
+		    					.queryParam("startIndex", String.valueOf(retrievedCount)) ;
+		    
+		    String response = r.accept(MediaType.APPLICATION_JSON_TYPE).get(String.class);
+		    
+		    LOG.debug("RESPONSE: [" + response + "]") ;
+		    		    
+		    Gson gson = new GsonBuilder().create() ;
+	
+		    GetXGroupListResponse groupList = gson.fromJson(response, GetXGroupListResponse.class) ;
+		    
+		    totalCount = groupList.getTotalCount() ;
+		    
+		    if (groupList.getXgroupInfoList() != null) {
+		    	xgroupList.addAll(groupList.getXgroupInfoList()) ;
+		    	retrievedCount = xgroupList.size() ;
+
+		    	for(XGroupInfo g : groupList.getXgroupInfoList()) {
+		    		LOG.debug("GROUP:  Id:" + g.getId() + ", Name: " + g.getName() + ", Description: " + g.getDescription()) ;
+			    }
+		    }
+	    }
+
+	}
+
+	
+	private void buildUserList() {
+		
+	    Client c = getClient() ;	
+	    
+	    int totalCount = 100 ;
+	    int retrievedCount = 0 ;
+	    
+	    while (retrievedCount < totalCount) {
+		    
+		    WebResource r = c.resource(getURL(PM_USER_LIST_URI))
+		    					.queryParam("pageSize", recordsToPullPerCall)
+		    					.queryParam("startIndex", String.valueOf(retrievedCount)) ;
+		    
+		    String response = r.accept(MediaType.APPLICATION_JSON_TYPE).get(String.class);
+		    
+		    Gson gson = new GsonBuilder().create() ;
+	
+		    LOG.debug("RESPONSE: [" + response + "]") ;
+	
+		    GetXUserListResponse userList = gson.fromJson(response, GetXUserListResponse.class) ;
+		    
+		    totalCount = userList.getTotalCount() ;
+		    
+		    if (userList.getXuserInfoList() != null) {
+		    	xuserList.addAll(userList.getXuserInfoList()) ;
+		    	retrievedCount = xuserList.size() ;
+
+		    	for(XUserInfo u : userList.getXuserInfoList()) {
+			    	LOG.debug("USER: Id:" + u.getId() + ", Name: " + u.getName() + ", Description: " + u.getDescription()) ;
+			    }
+		    }
+	    }
+	    
+	}
+	
+	
+	private void buildUserGroupLinkList() {
+
+		Client c = getClient() ;
+	    
+	    int totalCount = 100 ;
+	    int retrievedCount = 0 ;
+	    
+	    while (retrievedCount < totalCount) {
+		    
+		    WebResource r = c.resource(getURL(PM_USER_GROUP_MAP_LIST_URI))
+		    					.queryParam("pageSize", recordsToPullPerCall)
+		    					.queryParam("startIndex", String.valueOf(retrievedCount)) ;
+		    
+		    String response = r.accept(MediaType.APPLICATION_JSON_TYPE).get(String.class);
+		    
+		    LOG.debug("RESPONSE: [" + response + "]") ;
+		    
+		    Gson gson = new GsonBuilder().create() ;
+	
+		    GetXUserGroupListResponse usergroupList = gson.fromJson(response, GetXUserGroupListResponse.class) ;
+		    
+		    totalCount = usergroupList.getTotalCount() ;
+		    
+		    if (usergroupList.getXusergroupInfoList() != null) {
+		    	xusergroupList.addAll(usergroupList.getXusergroupInfoList()) ;
+		    	retrievedCount = xusergroupList.size() ;
+
+		    	for(XUserGroupInfo ug : usergroupList.getXusergroupInfoList()) {
+			    	LOG.debug("USER_GROUP: UserId:" + ug.getUserId() + ", Name: " + ug.getGroupName()) ;
+			    }
+		    }
+	    }
+
+	}
+	
+	
+	
+	private XUserInfo addXUserInfo(String aUserName) {
+		XUserInfo ret = null ;
+		
+		XUserInfo addUser = new XUserInfo() ;
+		addUser.setName(aUserName);
+		addUser.setDescription(aUserName + " - add from Unix box") ;
+		
+	    Client c = getClient() ;
+	    
+	    WebResource r = c.resource(getURL(PM_ADD_USER_URI)) ;
+	    
+	    Gson gson = new GsonBuilder().create() ;
+
+	    String jsonString = gson.toJson(addUser) ;
+	    
+	    String response = r.accept(MediaType.APPLICATION_JSON_TYPE).type(MediaType.APPLICATION_JSON_TYPE).post(String.class, jsonString) ;
+	    
+	    LOG.debug("RESPONSE: [" + response + "]") ;
+
+	    ret = gson.fromJson(response, XUserInfo.class) ;
+
+	    if (ret != null) {
+	    	addUserToList(ret);
+	    }
+		
+		return ret ;
+	}
+	
+	private XGroupInfo addXGroupInfo(String aGroupName) {
+		
+		XGroupInfo ret = null ;
+		
+		XGroupInfo addGroup = new XGroupInfo() ;
+		addGroup.setName(aGroupName);
+		addGroup.setDescription(aGroupName + " - add from Unix box") ;
+		addGroup.setGroupType("1") ;
+		
+	    Client c = getClient() ;
+	    
+	    WebResource r = c.resource(getURL(PM_ADD_GROUP_URI)) ;
+	    
+	    Gson gson = new GsonBuilder().create() ;
+
+	    String jsonString = gson.toJson(addGroup) ;
+	    
+	    String response = r.accept(MediaType.APPLICATION_JSON_TYPE).type(MediaType.APPLICATION_JSON_TYPE).post(String.class, jsonString) ;
+	    
+	    LOG.debug("RESPONSE: [" + response + "]") ;
+
+	    ret = gson.fromJson(response, XGroupInfo.class) ;
+	    
+	    if (ret != null) {
+	    	addGroupToList(ret);
+	    }
+		
+		return ret ;
+	}
+	
+	
+	
+	private void addXUserGroupInfo(XUserInfo aUserInfo, List<String> aGroupList) {
+		for(String groupName : aGroupList) {
+			XGroupInfo group = groupName2XGroupInfoMap.get(groupName) ;
+			if (group == null) {
+				group = addXGroupInfo(groupName) ;
+			}
+			addXUserGroupInfo(aUserInfo, group) ;
+		}
+	}
+
+	private XUserGroupInfo addXUserGroupInfo(XUserInfo aUserInfo, XGroupInfo aGroupInfo) {
+		
+		XUserGroupInfo ret = null ;
+		
+		XUserGroupInfo ugInfo = new XUserGroupInfo() ;
+		
+		ugInfo.setUserId(aUserInfo.getId());
+		ugInfo.setGroupName(aGroupInfo.getName()) ;
+		// ugInfo.setParentGroupId("1");
+		
+	    Client c = getClient() ;
+	    
+	    WebResource r = c.resource(getURL(PM_ADD_USER_GROUP_LINK_URI)) ;
+	    
+	    Gson gson = new GsonBuilder().create() ;
+
+	    String jsonString = gson.toJson(ugInfo) ;
+	    
+	    String response = r.accept(MediaType.APPLICATION_JSON_TYPE).type(MediaType.APPLICATION_JSON_TYPE).post(String.class, jsonString) ;
+	    
+	    LOG.debug("RESPONSE: [" + response + "]") ;
+
+	    ret = gson.fromJson(response, XUserGroupInfo.class) ;
+	    
+	    if (ret != null) {
+	    	addUserGroupToList(ret);
+	    }
+		
+		return ret ;
+		
+	}
+	
+	private void delXUserGroupInfo(XUserInfo aUserInfo, List<String> aGroupList) {
+		for(String groupName : aGroupList) {
+			XGroupInfo group = groupName2XGroupInfoMap.get(groupName) ;
+			if (group != null) {
+				delXUserGroupInfo(aUserInfo, group) ;
+			}
+		}
+	}
+
+	private void delXUserGroupInfo(XUserInfo aUserInfo, XGroupInfo aGroupInfo) {
+		
+		Client c = getClient() ;
+	    
+	    String uri = PM_DEL_USER_GROUP_LINK_URI.replaceAll(Pattern.quote("${groupName}"), aGroupInfo.getName()).replaceAll(Pattern.quote("${userName}"), aUserInfo.getName()) ;
+	    
+	    WebResource r = c.resource(getURL(uri)) ;
+	    
+	    ClientResponse response = r.delete(ClientResponse.class) ;
+	    
+	    LOG.debug("RESPONSE: [" + response.toString() + "]") ;
+
+	    
+	    if (response.getStatus() == 200) {
+	    	delUserGroupFromList(aUserInfo, aGroupInfo) ;
+	    }
+		
+	}
+	
+	
+	private MUserInfo addMUser(String aUserName) {
+		
+		MUserInfo ret = null ;
+		
+		MUserInfo userInfo = new MUserInfo() ;
+
+		userInfo.setLoginId(aUserName);
+		userInfo.setFirstName(aUserName);
+		userInfo.setLastName(aUserName);
+		userInfo.setEmailAddress(aUserName + "@" + LOCAL_HOSTNAME);
+		
+	    Client c = getClient() ;
+	    
+	    WebResource r = c.resource(getURL(PM_ADD_LOGIN_USER_URI)) ;
+	    
+	    Gson gson = new GsonBuilder().create() ;
+
+	    String jsonString = gson.toJson(userInfo) ;
+	    
+	    String response = r.accept(MediaType.APPLICATION_JSON_TYPE).type(MediaType.APPLICATION_JSON_TYPE).post(String.class, jsonString) ;
+	    
+	    LOG.debug("RESPONSE[" + response + "]") ;
+	    
+	    ret = gson.fromJson(response, MUserInfo.class) ;
+	    
+	    LOG.debug("MUser Creation successful " + ret);
+		
+		return ret ;
+
+	}
+
+	
+	private synchronized Client getClient() {
+		
+		Client ret = null; 
+		
+		if (policyMgrBaseUrl.startsWith("https://")) {
+			
+			ClientConfig config = new DefaultClientConfig();
+			
+			if (sslContext == null) {
+				
+				try {
+
+				KeyManager[] kmList = null;
+				TrustManager[] tmList = null;
+	
+				if (keyStoreFile != null && keyStoreFilepwd != null) {
+	
+					KeyStore keyStore = KeyStore.getInstance(keyStoreType);
+					InputStream in = null ;
+					try {
+						in = getFileInputStream(keyStoreFile) ;
+						if (in == null) {
+							LOG.error("Unable to obtain keystore from file [" + keyStoreFile + "]");
+							return ret ;
+						}
+						keyStore.load(in, keyStoreFilepwd.toCharArray());
+						KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
+						keyManagerFactory.init(keyStore, keyStoreFilepwd.toCharArray());
+						kmList = keyManagerFactory.getKeyManagers();
+					}
+					finally {
+						if (in != null) {
+							in.close(); 
+						}
+					}
+					 
+				}
+	
+				if (trustStoreFile != null && trustStoreFilepwd != null) {
+	
+					KeyStore trustStore = KeyStore.getInstance(trustStoreType);
+					InputStream in = null ;
+					try {
+						in = getFileInputStream(trustStoreFile) ;
+						if (in == null) {
+							LOG.error("Unable to obtain keystore from file [" + trustStoreFile + "]");
+							return ret ;
+						}
+						trustStore.load(in, trustStoreFilepwd.toCharArray());
+						TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
+						trustManagerFactory.init(trustStore);
+						tmList = trustManagerFactory.getTrustManagers();
+					}
+					finally {
+						if (in != null) {
+							in.close() ;
+						}
+					}
+				}
+
+				sslContext = SSLContext.getInstance("SSL");
+	
+				sslContext.init(kmList, tmList, new SecureRandom());
+
+				hv = new HostnameVerifier() {
+					public boolean verify(String urlHostName, SSLSession session) {
+						return session.getPeerHost().equals(urlHostName);
+					}
+				};
+				}
+				catch(Throwable t) {
+					throw new RuntimeException("Unable to create SSLConext for communication to policy manager", t);
+				}
+
+			}
+
+			config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, new HTTPSProperties(hv, sslContext));
+
+			ret = Client.create(config);
+
+			
+		}
+		else {
+			ClientConfig cc = new DefaultClientConfig();
+		    cc.getProperties().put(ClientConfig.PROPERTY_FOLLOW_REDIRECTS, true);
+		    ret = Client.create(cc);	
+		}
+		
+		return ret ;
+	}
+	
+	private InputStream getFileInputStream(String path) throws FileNotFoundException {
+
+		InputStream ret = null;
+
+		File f = new File(path);
+
+		if (f.exists()) {
+			ret = new FileInputStream(f);
+		} else {
+			ret = getClass().getResourceAsStream(path);
+			
+			if (ret == null) {
+				if (! path.startsWith("/")) {
+					ret = getClass().getResourceAsStream("/" + path);
+				}
+			}
+			
+			if (ret == null) {
+				ret = ClassLoader.getSystemClassLoader().getResourceAsStream(path) ;
+				if (ret == null) {
+					if (! path.startsWith("/")) {
+						ret = ClassLoader.getSystemResourceAsStream("/" + path);
+					}
+				}
+			}
+		}
+
+		return ret;
+	}
+
+	
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/unixusersync/process/UnixUserGroupBuilder.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/unixusersync/process/UnixUserGroupBuilder.java b/ugsync/src/main/java/com/xasecure/unixusersync/process/UnixUserGroupBuilder.java
new file mode 100644
index 0000000..bc20966
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/unixusersync/process/UnixUserGroupBuilder.java
@@ -0,0 +1,244 @@
+package com.xasecure.unixusersync.process;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+
+import com.xasecure.unixusersync.config.UserGroupSyncConfig;
+import com.xasecure.usergroupsync.UserGroupSink;
+import com.xasecure.usergroupsync.UserGroupSource;
+
+public class UnixUserGroupBuilder implements UserGroupSource {
+	
+	private static final Logger LOG = Logger.getLogger(UnixUserGroupBuilder.class) ;
+
+	public static final String UNIX_USER_PASSWORD_FILE = "/etc/passwd" ;
+	public static final String UNIX_GROUP_FILE = "/etc/group" ;
+
+	private UserGroupSyncConfig config = UserGroupSyncConfig.getInstance() ;
+	private Map<String,List<String>>  	user2GroupListMap = new HashMap<String,List<String>>();
+	private Map<String,String>			groupId2groupNameMap = new HashMap<String,String>() ;
+	private List<String>				userList = new ArrayList<String>() ;
+	private int 						minimumUserId  = 0 ;
+	
+	private long  passwordFileModiiedAt = 0 ;
+	private long  groupFileModifiedAt = 0 ;
+		
+	
+	public static void main(String[] args) throws Throwable {
+		UnixUserGroupBuilder  ugbuilder = new UnixUserGroupBuilder() ;
+		ugbuilder.init();
+		ugbuilder.print(); 
+	}
+	
+	public UnixUserGroupBuilder() {
+		minimumUserId = Integer.parseInt(config.getMinUserId()) ;
+		LOG.debug("Minimum UserId: " + minimumUserId) ;
+	}
+
+	@Override
+	public void init() throws Throwable {
+		buildUserGroupInfo() ;
+	}
+	
+	@Override
+	public boolean isChanged() {
+		long TempPasswordFileModiiedAt = new File(UNIX_USER_PASSWORD_FILE).lastModified() ;
+		if (passwordFileModiiedAt != TempPasswordFileModiiedAt) {
+			return true ;
+		}
+		
+		long TempGroupFileModifiedAt = new File(UNIX_GROUP_FILE).lastModified() ;
+		if (groupFileModifiedAt != TempGroupFileModifiedAt) {
+			return true ;
+		}
+		
+		return false ;
+	}
+	
+
+	@Override
+	public void updateSink(UserGroupSink sink) throws Throwable {
+		buildUserGroupInfo() ;
+
+		for (Map.Entry<String, List<String>> entry : user2GroupListMap.entrySet()) {
+		    String       user   = entry.getKey();
+		    List<String> groups = entry.getValue();
+		    
+		    sink.addOrUpdateUser(user, groups);
+		}
+	}
+	
+	
+	private void buildUserGroupInfo() throws Throwable {
+		user2GroupListMap = new HashMap<String,List<String>>();
+		groupId2groupNameMap = new HashMap<String,String>() ;
+		userList = new ArrayList<String>() ;
+
+		buildUnixGroupList(); 
+		buildUnixUserList();
+		if (LOG.isDebugEnabled()) {
+			print() ;
+		}
+	}
+	
+	public void print() {
+		for(String user : userList) {
+			LOG.debug("USER:" + user) ;
+			List<String> groups = user2GroupListMap.get(user) ;
+			if (groups != null) {
+				for(String group : groups) {
+					LOG.debug("\tGROUP: " + group) ;
+				}
+			}
+		}
+	}
+	
+	private List<String>  getUserList() {
+		return userList ;
+	}
+	
+	private List<String>  getGroupListForUser(String aUserName) {
+		return user2GroupListMap.get(aUserName) ;
+	}
+	
+	private void buildUnixUserList() throws Throwable {
+		
+		File f = new File(UNIX_USER_PASSWORD_FILE) ;
+
+		if (f.exists()) {
+			
+			
+			BufferedReader reader = null ;
+			
+			reader = new BufferedReader(new FileReader(f)) ;
+			
+			String line = null ;
+			
+			while ( (line = reader.readLine()) != null) {
+				
+				if (line.trim().isEmpty()) 
+					continue ;
+				
+				String[] tokens = line.split(":") ;
+				
+				int len = tokens.length ;
+				
+				if (len < 2) {
+					continue ;
+				}
+				
+				String userName = tokens[0] ;
+				String userId = tokens[2] ;
+				String groupId = tokens[3] ;
+				
+				int numUserId = -1 ; 
+				
+				try {
+					numUserId = Integer.parseInt(userId) ;
+				}
+				catch(NumberFormatException nfe) {
+					LOG.warn("Unix UserId: [" + userId + "]: can not be parsed as valid int. considering as  -1.", nfe);
+					numUserId = -1 ;
+				}
+									
+				if (numUserId >= minimumUserId ) {
+					userList.add(userName) ;
+					String groupName = groupId2groupNameMap.get(groupId) ;
+					if (groupName != null) {
+						List<String> groupList = user2GroupListMap.get(userName) ;
+						if (groupList == null) {
+							groupList = new ArrayList<String>() ;
+							user2GroupListMap.put(userName, groupList) ;
+						}
+						if (! groupList.contains(groupName)) {
+							groupList.add(groupName) ;
+						}
+					}
+					else {
+						LOG.warn("Group Name could not be found for group id: [" + groupId + "]") ;
+					}
+				}
+			}
+			
+			reader.close() ;
+			
+			passwordFileModiiedAt = f.lastModified() ;
+
+		}
+	}
+
+	
+	private void buildUnixGroupList() throws Throwable {
+		
+		File f = new File(UNIX_GROUP_FILE) ;
+		
+		if (f.exists()) {
+			
+			BufferedReader reader = null ;
+			
+			reader = new BufferedReader(new FileReader(f)) ;
+			
+			String line = null ;
+			
+			
+			
+			while ( (line = reader.readLine()) != null) {
+
+				if (line.trim().isEmpty()) 
+					continue ;
+				
+				String[] tokens = line.split(":") ;
+				
+				int len = tokens.length ;
+				
+				if (len < 2) {
+					continue ;
+				}
+				
+				String groupName = tokens[0] ;
+				String groupId = tokens[2] ;
+				String groupMembers = null ;
+				
+				if (tokens.length > 3) {
+					groupMembers = tokens[3] ;
+				}
+				
+				if (groupId2groupNameMap.containsKey(groupId)) {
+					groupId2groupNameMap.remove(groupId) ;
+				}
+				
+				groupId2groupNameMap.put(groupId,groupName) ;
+				
+				if (groupMembers != null && ! groupMembers.trim().isEmpty()) {
+					for(String user : groupMembers.split(",")) {
+						List<String> groupList = user2GroupListMap.get(user) ;
+						if (groupList == null) {
+							groupList = new ArrayList<String>() ;
+							user2GroupListMap.put(user, groupList) ;
+						}
+						if (! groupList.contains(groupName)) {
+							groupList.add(groupName) ;
+						}
+					}
+				}
+
+				
+			}
+			
+			reader.close() ;
+			
+			groupFileModifiedAt = f.lastModified() ;
+
+		
+		}
+	}
+	
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/usergroupsync/UserGroupSink.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/usergroupsync/UserGroupSink.java b/ugsync/src/main/java/com/xasecure/usergroupsync/UserGroupSink.java
new file mode 100644
index 0000000..e8622ad
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/usergroupsync/UserGroupSink.java
@@ -0,0 +1,9 @@
+package com.xasecure.usergroupsync;
+
+import java.util.List;
+
+public interface UserGroupSink {
+	public void init() throws Throwable;
+
+	public void addOrUpdateUser(String user, List<String> groups);
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/usergroupsync/UserGroupSource.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/usergroupsync/UserGroupSource.java b/ugsync/src/main/java/com/xasecure/usergroupsync/UserGroupSource.java
new file mode 100644
index 0000000..63221cc
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/usergroupsync/UserGroupSource.java
@@ -0,0 +1,10 @@
+package com.xasecure.usergroupsync;
+
+
+public interface UserGroupSource {
+	public void init() throws Throwable;
+
+	public boolean isChanged();
+
+	public void updateSink(UserGroupSink sink) throws Throwable;
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/ugsync/src/main/java/com/xasecure/usergroupsync/UserGroupSync.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/com/xasecure/usergroupsync/UserGroupSync.java b/ugsync/src/main/java/com/xasecure/usergroupsync/UserGroupSync.java
new file mode 100644
index 0000000..506c53b
--- /dev/null
+++ b/ugsync/src/main/java/com/xasecure/usergroupsync/UserGroupSync.java
@@ -0,0 +1,103 @@
+package com.xasecure.usergroupsync;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+import com.xasecure.unixusersync.config.UserGroupSyncConfig;
+import com.xasecure.unixusersync.process.PolicyMgrUserGroupBuilder;
+import com.xasecure.unixusersync.process.UnixUserGroupBuilder;
+
+public class UserGroupSync implements Runnable {
+	
+	private static final Logger LOG = Logger.getLogger(UserGroupSync.class) ;
+
+	private boolean         shutdownFlag = false ;
+	private UserGroupSink   ugSink       = null ;
+	private UserGroupSource ugSource     =  null ;
+
+
+
+	public static void main(String[] args) {
+		UserGroupSync userGroupSync = new UserGroupSync() ;
+		userGroupSync.run() ;
+	}
+
+	public void run() {
+		try {
+			long sleepTimeBetweenCycleInMillis = UserGroupSyncConfig.getInstance().getSleepTimeInMillisBetweenCycle() ;
+
+			boolean initDone = false ;
+
+			while (! initDone ) {
+				try {
+					ugSink = UserGroupSyncConfig.getInstance().getUserGroupSink();
+					LOG.info("initializing sink: " + ugSink.getClass().getName());
+					ugSink.init();
+
+					ugSource = UserGroupSyncConfig.getInstance().getUserGroupSource();
+					LOG.info("initializing source: " + ugSource.getClass().getName());
+					ugSource.init();
+
+					LOG.info("Begin: initial load of user/group from source==>sink");
+					ugSource.updateSink(ugSink);
+					LOG.info("End: initial load of user/group from source==>sink");
+
+					initDone = true ;
+
+					LOG.info("Done initializing user/group source and sink") ;
+				}
+				catch(Throwable t) {
+					LOG.error("Failed to initialize UserGroup source/sink. Will retry after " + sleepTimeBetweenCycleInMillis + " milliseconds. Error details: ", t) ;
+
+					try {
+						Thread.sleep(sleepTimeBetweenCycleInMillis) ;
+					} catch (Exception e) {
+						LOG.error("Failed to wait for [" + sleepTimeBetweenCycleInMillis + "] milliseconds before attempting to initialize UserGroup source/sink", e) ;
+					}
+				}
+			}
+
+			while (! shutdownFlag ) {
+				try {
+					Thread.sleep(sleepTimeBetweenCycleInMillis);
+				} catch (InterruptedException e) {
+					LOG.error("Failed to wait for [" + sleepTimeBetweenCycleInMillis + "] milliseconds before attempting to synchronize UserGroup information", e) ;
+				}
+
+				try {
+					syncUserGroup() ;
+				}
+				catch(Throwable t) {
+					LOG.error("Failed to synchronize UserGroup information. Error details: ", t) ;
+
+					System.exit(1);
+				}
+			}
+		
+		}
+		catch(Throwable t) {
+			LOG.error("UserGroupSync thread got an error", t) ;
+		}
+		finally {
+			LOG.error("Shutting down the UserGroupSync thread") ;
+		}
+	}
+	
+	private void syncUserGroup() throws Throwable {
+		UserGroupSyncConfig config = UserGroupSyncConfig.getInstance() ;
+
+		if (config.isUserSyncEnabled()) {
+			if (ugSource.isChanged()) {
+				LOG.info("Begin: update user/group from source==>sink");
+				ugSource.updateSink(ugSink);
+				LOG.info("End: update user/group from source==>sink");
+			}
+			else {
+				LOG.debug("UserGroupSource: no change found for synchronization.") ;
+			}
+		}
+		
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/unixauthclient/pom.xml
----------------------------------------------------------------------
diff --git a/unixauthclient/pom.xml b/unixauthclient/pom.xml
new file mode 100644
index 0000000..7a18371
--- /dev/null
+++ b/unixauthclient/pom.xml
@@ -0,0 +1,80 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+      <groupId>com.hortonworks.hadoop.security</groupId>
+      <artifactId>argus</artifactId>
+      <version>3.5.000</version>
+      <relativePath>..</relativePath>
+    </parent>
+
+    <artifactId>unixauthclient</artifactId>
+
+    <packaging>jar</packaging>
+
+    <name>unixauthclient</name>
+    <description>HDP Advanced Security - Unix authentication client</description>
+    <url>http:/hortonworks.com/</url>
+
+    <dependencies>
+      <dependency>
+        <groupId>log4j</groupId>
+        <artifactId>log4j</artifactId>
+        <version>${log4j.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>com.google.code.gson</groupId>
+        <artifactId>gson</artifactId>
+        <version>${gson.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>com.sun.jersey</groupId>
+        <artifactId>jersey-bundle</artifactId>
+        <version>${jersey-bundle.version}</version>
+      </dependency>
+      <dependency>
+      	<groupId>commons-cli</groupId>
+      	<artifactId>commons-cli</artifactId>
+      	<version>${commons.cli.version}</version>
+      </dependency>
+      <dependency>
+      	<groupId>commons-collections</groupId>
+      	<artifactId>commons-collections</artifactId>
+      	<version>${commons.collections.version}</version>
+      </dependency>
+      <dependency>
+      	<groupId>commons-configuration</groupId>
+      	<artifactId>commons-configuration</artifactId>
+      	<version>${commons.configuration.version}</version>
+      </dependency>
+      <dependency>
+      	<groupId>commons-lang</groupId>
+      	<artifactId>commons-lang</artifactId>
+      	<version>${commons.lang.version}</version>
+      </dependency>
+      <dependency>
+      	<groupId>commons-logging</groupId>
+      	<artifactId>commons-logging</artifactId>
+      	<version>${commons.logging.version}</version>
+      </dependency>
+      <dependency>
+      	<groupId>com.google.guava</groupId>
+      	<artifactId>guava</artifactId>
+      	<version>${guava.version}</version>
+      </dependency>
+      <dependency>
+      	<groupId>org.apache.hadoop</groupId>
+      	<artifactId>hadoop-auth</artifactId>
+      	<version>${hadoop-auth.version}</version>
+      </dependency>
+      <dependency>
+      	<groupId>org.slf4j</groupId>
+      	<artifactId>slf4j-api</artifactId>
+      	<version>${slf4j-api.version}</version>
+      </dependency>   
+    </dependencies>
+
+</project>
+

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/unixauthclient/src/main/java/com/xasecure/authentication/unix/jaas/ConsolePromptCallbackHandler.java
----------------------------------------------------------------------
diff --git a/unixauthclient/src/main/java/com/xasecure/authentication/unix/jaas/ConsolePromptCallbackHandler.java b/unixauthclient/src/main/java/com/xasecure/authentication/unix/jaas/ConsolePromptCallbackHandler.java
new file mode 100644
index 0000000..fa76ccb
--- /dev/null
+++ b/unixauthclient/src/main/java/com/xasecure/authentication/unix/jaas/ConsolePromptCallbackHandler.java
@@ -0,0 +1,40 @@
+package com.xasecure.authentication.unix.jaas;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+public class ConsolePromptCallbackHandler implements CallbackHandler {
+
+
+	@Override
+	public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+		
+		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)) ;
+		
+		for(Callback cb : callbacks) {
+			if (cb instanceof NameCallback) {
+		          NameCallback nc = (NameCallback)cb ;
+		          System.out.print(nc.getPrompt());
+		          System.out.flush();
+		          nc.setName(reader.readLine());
+			}
+			else if (cb instanceof PasswordCallback) {
+		          PasswordCallback pc = (PasswordCallback)cb;
+		          System.out.print(pc.getPrompt());
+		          System.out.flush();
+		          pc.setPassword(reader.readLine().toCharArray());				
+			}
+			else {
+				System.out.println("Unknown callbacl [" + cb.getClass().getName() + "]") ;
+			}
+		}
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/unixauthclient/src/main/java/com/xasecure/authentication/unix/jaas/UnixGroupPrincipal.java
----------------------------------------------------------------------
diff --git a/unixauthclient/src/main/java/com/xasecure/authentication/unix/jaas/UnixGroupPrincipal.java b/unixauthclient/src/main/java/com/xasecure/authentication/unix/jaas/UnixGroupPrincipal.java
new file mode 100644
index 0000000..4e921f7
--- /dev/null
+++ b/unixauthclient/src/main/java/com/xasecure/authentication/unix/jaas/UnixGroupPrincipal.java
@@ -0,0 +1,21 @@
+package com.xasecure.authentication.unix.jaas;
+
+import java.io.Serializable;
+import java.security.Principal;
+
+public class UnixGroupPrincipal implements Principal, Serializable {
+
+	private static final long serialVersionUID = 8137147441841439754L;
+
+	private String groupName ;
+	
+	public UnixGroupPrincipal(String groupName) {
+		this.groupName = groupName ;
+	}
+
+	@Override
+	public String getName() {
+		return groupName ;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/unixauthclient/src/main/java/com/xasecure/authentication/unix/jaas/UnixUserPrincipal.java
----------------------------------------------------------------------
diff --git a/unixauthclient/src/main/java/com/xasecure/authentication/unix/jaas/UnixUserPrincipal.java b/unixauthclient/src/main/java/com/xasecure/authentication/unix/jaas/UnixUserPrincipal.java
new file mode 100644
index 0000000..a742c2c
--- /dev/null
+++ b/unixauthclient/src/main/java/com/xasecure/authentication/unix/jaas/UnixUserPrincipal.java
@@ -0,0 +1,21 @@
+package com.xasecure.authentication.unix.jaas;
+
+import java.io.Serializable;
+import java.security.Principal;
+
+public class UnixUserPrincipal implements Principal, Serializable {
+
+	private static final long serialVersionUID = -3568658536591178268L;
+	
+	private String userName ;
+	
+	public UnixUserPrincipal(String userName) {
+		this.userName = userName ;
+	}
+
+	@Override
+	public String getName() {
+		return userName ;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/unixauthclient/src/test/com/xasecure/test/authentication/UnixAuthenticationTester.java
----------------------------------------------------------------------
diff --git a/unixauthclient/src/test/com/xasecure/test/authentication/UnixAuthenticationTester.java b/unixauthclient/src/test/com/xasecure/test/authentication/UnixAuthenticationTester.java
new file mode 100644
index 0000000..1ab3d19
--- /dev/null
+++ b/unixauthclient/src/test/com/xasecure/test/authentication/UnixAuthenticationTester.java
@@ -0,0 +1,19 @@
+package com.xasecure.test.authentication;
+
+import javax.security.auth.login.LoginContext;
+
+public class UnixAuthenticationTester {
+
+	public static void main(String[] args) throws Throwable {
+		new UnixAuthenticationTester().run();
+	}
+		
+	public void run() throws Throwable {
+		LoginContext loginContext =  new LoginContext("PolicyManager") ;
+		System.err.println("After login ...") ;
+		loginContext.login(); 
+		System.err.println("Subject:" + loginContext.getSubject() ) ;
+		loginContext.logout(); 
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/unixauthnative/native/credValidator
----------------------------------------------------------------------
diff --git a/unixauthnative/native/credValidator b/unixauthnative/native/credValidator
new file mode 100755
index 0000000..0b46484
Binary files /dev/null and b/unixauthnative/native/credValidator differ

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/unixauthnative/pom.xml
----------------------------------------------------------------------
diff --git a/unixauthnative/pom.xml b/unixauthnative/pom.xml
new file mode 100644
index 0000000..8afff7f
--- /dev/null
+++ b/unixauthnative/pom.xml
@@ -0,0 +1,56 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+      <groupId>com.hortonworks.hadoop.security</groupId>
+      <artifactId>security-usergroup-sync</artifactId>
+      <version>3.5.000</version>
+      <relativePath>..</relativePath>
+    </parent>
+
+    <groupId>com.hortonworks.hadoop.security</groupId>
+    <artifactId>credValidator</artifactId>
+    <version>3.5.000</version>
+
+    <packaging>uexe</packaging>
+
+    <name>unixauth-native</name>
+    <description>HDP Advanced Security - Unix authentication service</description>
+    <url>http:/hortonworks.com/</url>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>native-maven-plugin</artifactId>
+        <extensions>true</extensions>
+        <configuration>
+          <compilerStartOptions>
+            <compilerStartOption>${commonCompilerOptions}</compilerStartOption>
+          </compilerStartOptions>
+          
+          <sources>
+            <source>
+              <directory>src/main/c</directory>
+              <includes>
+                <include>**/*.c</include>
+              </includes>
+            </source>  
+          </sources>
+            
+          <linkerStartOptions>
+            <linkerStartOption>-lcrypt</linkerStartOption>
+          </linkerStartOptions>
+                    
+        </configuration>
+        
+      </plugin>
+
+    </plugins>    
+
+  </build>
+
+</project>
+

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/unixauthnative/src/main/c/credValidator.c
----------------------------------------------------------------------
diff --git a/unixauthnative/src/main/c/credValidator.c b/unixauthnative/src/main/c/credValidator.c
new file mode 100644
index 0000000..5a1b8da
--- /dev/null
+++ b/unixauthnative/src/main/c/credValidator.c
@@ -0,0 +1,47 @@
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <pwd.h>
+#include <shadow.h>
+#include <string.h>
+#include <sys/types.h>
+#include <crypt.h>
+
+int main(int ac, char **av, char **ev)
+{
+	char username[64] ;
+	char password[64] ;
+	char line[512] ;
+	struct passwd *pwp;
+	struct spwd *spwd ; 
+
+	fgets(line,512,stdin) ;
+
+	sscanf(line, "LOGIN:%s %s",username,password) ;
+
+	pwp = getpwnam(username) ;
+
+	if (pwp == (struct passwd *)NULL) {
+		fprintf(stdout, "FAILED: [%s] does not exists.\n", username) ;
+		exit(1) ;
+	}
+	
+	spwd = getspnam(pwp->pw_name) ;
+
+	if (spwd == (struct spwd *)NULL) {
+		fprintf(stdout, "FAILED: unable to get (shadow) password for %s\n", username) ;
+		exit(1) ;
+	}
+	else {
+		char *gen = crypt(password,spwd->sp_pwdp) ;
+		if (strcmp(spwd->sp_pwdp,gen) == 0) {
+			fprintf(stdout, "OK:\n") ;
+			exit(0);
+		}
+		else {
+			fprintf(stdout, "FAILED: Password did not match.\n") ;
+			exit(1) ;
+		}
+	}
+	exit(0) ;
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/unixauthservice/cert/authserver.jks
----------------------------------------------------------------------
diff --git a/unixauthservice/cert/authserver.jks b/unixauthservice/cert/authserver.jks
new file mode 100644
index 0000000..85dfb88
Binary files /dev/null and b/unixauthservice/cert/authserver.jks differ

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/unixauthservice/cert/mytruststore.jks
----------------------------------------------------------------------
diff --git a/unixauthservice/cert/mytruststore.jks b/unixauthservice/cert/mytruststore.jks
new file mode 100644
index 0000000..8a00a73
Binary files /dev/null and b/unixauthservice/cert/mytruststore.jks differ

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/unixauthservice/conf/jaas.conf
----------------------------------------------------------------------
diff --git a/unixauthservice/conf/jaas.conf b/unixauthservice/conf/jaas.conf
new file mode 100644
index 0000000..e0d70e6
--- /dev/null
+++ b/unixauthservice/conf/jaas.conf
@@ -0,0 +1,6 @@
+PolicyManager {
+	com.xasecure.authentication.unix.jaas.RemoteUnixLoginModule REQUIRED  
+			authServiceHostName="192.168.22.88" authServicePort="5151" debug="true"
+			keyStore="keystore.jks" keyStorePassword="password"
+			trustStore="unixauthclient.jks" trustStorePassword="mEmePaS3w9rD" ;
+} ;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/unixauthservice/conf/log4j.xml
----------------------------------------------------------------------
diff --git a/unixauthservice/conf/log4j.xml b/unixauthservice/conf/log4j.xml
new file mode 100644
index 0000000..dd775c2
--- /dev/null
+++ b/unixauthservice/conf/log4j.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true">
+
+   <appender name="logFile" class="org.apache.log4j.DailyRollingFileAppender">
+        <param name="file" value="/var/log/uxugsync/unix-auth-sync.log" />
+        <param name="DatePattern" value="'.'yyyy-MM-dd" />
+        <layout class="org.apache.log4j.PatternLayout">
+		<param name="ConversionPattern" value="%d{dd MMM yyyy HH:mm:ss} %5p %c{1} [%t] - %m%n"/>
+        </layout>
+   </appender>
+
+  <appender name="console" class="org.apache.log4j.ConsoleAppender"> 
+    <param name="Target" value="System.out"/> 
+    <layout class="org.apache.log4j.PatternLayout"> 
+	<param name="ConversionPattern" value="%d{dd MMM yyyy HH:mm:ss} %5p %c{1} [%t] - %m%n"/>
+    </layout> 
+  </appender> 
+
+  <root> 
+    <priority value ="info" /> 
+    <appender-ref ref="logFile" /> 
+  </root>
+  
+</log4j:configuration>


Mime
View raw message