ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject [28/44] ARGUS-1. Initial code commit (Selvamohan Neethiraj via omalley)
Date Thu, 14 Aug 2014 20:50:39 GMT
http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/security-admin/src/main/java/com/xasecure/common/SearchUtil.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/com/xasecure/common/SearchUtil.java b/security-admin/src/main/java/com/xasecure/common/SearchUtil.java
new file mode 100644
index 0000000..e246c56
--- /dev/null
+++ b/security-admin/src/main/java/com/xasecure/common/SearchUtil.java
@@ -0,0 +1,800 @@
+/**
+ *
+ */
+package com.xasecure.common;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+
+@Component
+public class SearchUtil {
+	final static Logger logger = Logger.getLogger(SearchUtil.class);
+
+	@Autowired
+	RESTErrorUtil restErrorUtil;
+
+	@Autowired
+	XAConfigUtil configUtil;
+
+	// @Autowired
+	// AKADomainObjectSecurityHandler securityHandler;
+
+	@Autowired
+	StringUtil stringUtil;
+
+	int minInListLength = 20;
+	String defaultDateFormat="MM/dd/yyyy";
+
+	public SearchUtil() {
+		minInListLength = PropertiesUtil.getIntProperty(
+				"xa.db.min_inlist", minInListLength);
+		defaultDateFormat = PropertiesUtil.getProperty(
+				"xa.ui.defaultDateformat", defaultDateFormat);
+		
+	}
+
+	@Deprecated
+	public SearchCriteria extractCommonCriterias(HttpServletRequest request,
+			String[] approvedSortByParams) {
+		SearchCriteria searchCriteria = new SearchCriteria();
+
+		int startIndex = restErrorUtil.parseInt(
+				request.getParameter("startIndex"), 0,
+				"Invalid value for parameter startIndex",
+				MessageEnums.INVALID_INPUT_DATA, null, "startIndex");
+		searchCriteria.setStartIndex(startIndex);
+
+		int pageSize = restErrorUtil.parseInt(request.getParameter("pageSize"),
+				configUtil.getDefaultMaxRows(),
+				"Invalid value for parameter pageSize",
+				MessageEnums.INVALID_INPUT_DATA, null, "pageSize");
+		searchCriteria.setMaxRows(pageSize);
+
+		String sortBy = restErrorUtil.validateString(
+				request.getParameter("sortBy"), StringUtil.VALIDATION_ALPHA,
+				"Invalid value for parameter sortBy",
+				MessageEnums.INVALID_INPUT_DATA, null, "sortBy");
+
+		boolean sortSet = false;
+		for (int i = 0; approvedSortByParams != null
+				&& i < approvedSortByParams.length; i++) {
+
+			if (approvedSortByParams[i].equalsIgnoreCase(sortBy)) {
+				searchCriteria.setSortBy(approvedSortByParams[i]);
+				String sortType = restErrorUtil.validateString(
+						request.getParameter("sortType"),
+						StringUtil.VALIDATION_ALPHA,
+						"Invalid value for parameter sortType",
+						MessageEnums.INVALID_INPUT_DATA, null, "sortType");
+				searchCriteria.setSortType(sortType);
+				sortSet = true;
+				break;
+			}
+		}
+		if (!sortSet && !stringUtil.isEmpty(sortBy)) {
+			logger.info("Invalid or unsupported sortBy field passed. sortBy="
+					+ sortBy, new Throwable());
+		}
+
+		return searchCriteria;
+	}
+
+	/**
+	 * @param request
+	 * @param sortFields
+	 * @return
+	 */
+	public SearchCriteria extractCommonCriterias(HttpServletRequest request,
+			List<SortField> sortFields) {
+		SearchCriteria searchCriteria = new SearchCriteria();
+
+		int startIndex = restErrorUtil.parseInt(
+				request.getParameter("startIndex"), 0,
+				"Invalid value for parameter startIndex",
+				MessageEnums.INVALID_INPUT_DATA, null, "startIndex");
+		searchCriteria.setStartIndex(startIndex);
+
+		int pageSize = restErrorUtil.parseInt(request.getParameter("pageSize"),
+				configUtil.getDefaultMaxRows(),
+				"Invalid value for parameter pageSize",
+				MessageEnums.INVALID_INPUT_DATA, null, "pageSize");
+		searchCriteria.setMaxRows(pageSize);
+
+		// is count needed
+		searchCriteria.setGetCount(restErrorUtil.parseBoolean(
+				request.getParameter("getCount"), true));
+
+		searchCriteria.setOwnerId(restErrorUtil.parseLong(
+				request.getParameter("ownerId"), null));
+		searchCriteria.setGetChildren(restErrorUtil.parseBoolean(
+				request.getParameter("getChildren"), false));
+
+		String sortBy = restErrorUtil.validateString(
+				request.getParameter("sortBy"), StringUtil.VALIDATION_ALPHA,
+				"Invalid value for parameter sortBy",
+				MessageEnums.INVALID_INPUT_DATA, null, "sortBy");
+
+		boolean sortSet = false;
+		if (!stringUtil.isEmpty(sortBy)) {
+			for (SortField sortField : sortFields) {
+				if (sortField.getParamName().equalsIgnoreCase(sortBy)) {
+					searchCriteria.setSortBy(sortField.getParamName());
+					String sortType = restErrorUtil.validateString(
+							request.getParameter("sortType"),
+							StringUtil.VALIDATION_ALPHA,
+							"Invalid value for parameter sortType",
+							MessageEnums.INVALID_INPUT_DATA, null, "sortType");
+					searchCriteria.setSortType(sortType);
+					sortSet = true;
+					break;
+				}
+			}
+		}
+
+		if (!sortSet && !stringUtil.isEmpty(sortBy)) {
+			logger.info("Invalid or unsupported sortBy field passed. sortBy="
+					+ sortBy, new Throwable());
+		}
+
+		return searchCriteria;
+	}
+
+	
+
+	public Long extractLong(HttpServletRequest request,
+			SearchCriteria searchCriteria, String paramName,
+			String userFriendlyParamName) {
+		String[] values = getParamMultiValues(request, paramName, paramName);
+		if (values != null && values.length > 1) {
+			List<Long> multiValues = extractLongList(request, searchCriteria,
+					paramName, userFriendlyParamName, paramName);
+			if (multiValues != null && multiValues.size() > 0) {
+				return multiValues.get(0);
+			} else {
+				return null;
+			}
+		} else {
+			Long value = restErrorUtil.parseLong(
+					request.getParameter(paramName), "Invalid value for "
+							+ userFriendlyParamName,
+					MessageEnums.INVALID_INPUT_DATA, null, paramName);
+			if (value != null) {
+				searchCriteria.getParamList().put(paramName, value);
+			}
+			return value;
+		}
+	}
+
+	public Integer extractInt(HttpServletRequest request,
+			SearchCriteria searchCriteria, String paramName,
+			String userFriendlyParamName) {
+		Integer value = restErrorUtil.parseInt(request.getParameter(paramName),
+				"Invalid value for " + userFriendlyParamName,
+				MessageEnums.INVALID_INPUT_DATA, null, paramName);
+		if (value != null) {
+			searchCriteria.getParamList().put(paramName, value);
+		}
+		return value;
+	}
+
+	/**
+	 * 
+	 * @param request
+	 * @param searchCriteria
+	 * @param paramName
+	 * @param userFriendlyParamName
+	 * @param dateFormat
+	 * @return
+	 */
+	public Date extractDate(HttpServletRequest request,
+			SearchCriteria searchCriteria, String paramName,
+			String userFriendlyParamName, String dateFormat) {
+		Date value = null;
+		if (dateFormat == null || dateFormat.isEmpty()) {
+			dateFormat = defaultDateFormat;
+		}
+		value = restErrorUtil.parseDate(request.getParameter(paramName),
+				"Invalid value for" + userFriendlyParamName,
+				MessageEnums.INVALID_INPUT_DATA, null, paramName, dateFormat);
+		if (value != null) {
+			searchCriteria.getParamList().put(paramName, value);
+		}
+
+		return value;
+	}
+
+	public String extractString(HttpServletRequest request,
+			SearchCriteria searchCriteria, String paramName,
+			String userFriendlyParamName, String regEx) {
+		String value = request.getParameter(paramName);
+		if (!stringUtil.isEmpty(value)) {
+			value = value.trim();
+			// TODO need to handle this in more generic way
+			// 		so as to take care of all possible special
+			//		characters.
+			if(value.contains("%")){
+				value = value.replaceAll("%", "\\\\%");
+			}
+			if (!stringUtil.isEmpty(regEx)) {
+				restErrorUtil.validateString(value, regEx, "Invalid value for "
+						+ userFriendlyParamName,
+						MessageEnums.INVALID_INPUT_DATA, null, paramName);
+			}
+			searchCriteria.getParamList().put(paramName, value);
+		}
+		return value;
+	}
+
+	public List<Integer> extractEnum(HttpServletRequest request,
+			SearchCriteria searchCriteria, String paramName,
+			String userFriendlyParamName, String listName, int maxValue) {
+
+		ArrayList<Integer> valueList = new ArrayList<Integer>();
+		String[] values = getParamMultiValues(request, paramName, listName);
+		for (int i = 0; values != null && i < values.length; i++) {
+			Integer value = restErrorUtil.parseInt(values[i],
+					"Invalid value for " + userFriendlyParamName,
+					MessageEnums.INVALID_INPUT_DATA, null, paramName);
+
+			restErrorUtil.validateMinMax(value, 0, maxValue,
+					"Invalid value for " + userFriendlyParamName, null,
+					paramName);
+			valueList.add(value);
+		}
+		if (valueList.size() > 0) {
+			searchCriteria.getParamList().put(listName, valueList);
+		}
+		return valueList;
+	}
+
+	/**
+	 * @param request
+	 * @param paramName
+	 * @param listName
+	 * @return
+	 */
+	String[] getParamMultiValues(HttpServletRequest request, String paramName,
+			String listName) {
+		String[] values = request.getParameterValues(paramName);
+		if (values == null || values.length == 0) {
+			values = request.getParameterValues(paramName + "[]");
+			if (listName != null && (values == null || values.length == 0)) {
+				values = request.getParameterValues(listName);
+				if (values == null || values.length == 0) {
+					// Let's try after appending []
+					values = request.getParameterValues(listName + "[]");
+				}
+			}
+		}
+		return values;
+	}
+
+	public List<String> extractStringList(HttpServletRequest request,
+			SearchCriteria searchCriteria, String paramName,
+			String userFriendlyParamName, String listName,
+			String[] validValues, String regEx) {
+		ArrayList<String> valueList = new ArrayList<String>();
+		String[] values = getParamMultiValues(request, paramName, listName);
+
+		for (int i = 0; values != null && i < values.length; i++) {
+			if (!stringUtil.isEmpty(regEx)) {
+				restErrorUtil.validateString(values[i], regEx,
+						"Invalid value for " + userFriendlyParamName,
+						MessageEnums.INVALID_INPUT_DATA, null, paramName);
+			}
+			valueList.add(values[i]);
+		}
+		searchCriteria.getParamList().put(listName, valueList);
+		return valueList;
+	}
+
+	public List<Long> extractLongList(HttpServletRequest request,
+			SearchCriteria searchCriteria, String paramName,
+			String userFriendlyParamName, String listName) {
+		ArrayList<Long> valueList = new ArrayList<Long>();
+		String[] values = getParamMultiValues(request, paramName, listName);
+
+		for (int i = 0; values != null && i < values.length; i++) {
+			Long value = restErrorUtil.parseLong(
+					values[i], "Invalid value for "
+							+ userFriendlyParamName,
+					MessageEnums.INVALID_INPUT_DATA, null, paramName);
+			valueList.add(value);
+		}
+		searchCriteria.getParamList().put(listName, valueList);
+		return valueList;
+	}
+
+	public void updateQueryPageSize(Query query, SearchCriteria searchCriteria) {
+		// Set max records
+		int pageSize = validatePageSize(searchCriteria.getMaxRows());
+
+		query.setMaxResults(pageSize);
+
+		// Set hint for max records
+		query.setHint("eclipselink.jdbc.max-rows", "" + pageSize);
+
+	}
+
+	public int validatePageSize(int inputPageSize) {
+		int pageSize = inputPageSize;
+
+		if (pageSize < 1) {
+			// Use default max Records
+			pageSize = configUtil.getDefaultMaxRows();
+		}
+		return pageSize;
+	}
+
+	/**
+	 * @param searchCriteria
+	 * @param sortFields
+	 * @return
+	 */
+	public String constructSortClause(SearchCriteria searchCriteria,
+			List<SortField> sortFields) {
+		String sortBy = searchCriteria.getSortBy();
+		String querySortBy = null;
+		if (!stringUtil.isEmpty(sortBy)) {
+			sortBy = sortBy.trim();
+			for (SortField sortField : sortFields) {
+				if (sortBy.equalsIgnoreCase(sortField.getParamName())) {
+					querySortBy = sortField.getFieldName();
+					// Override the sortBy using the normalized value
+					searchCriteria.setSortBy(sortField.getParamName());
+					break;
+				}
+			}
+		}
+
+		if (querySortBy == null) {
+			for (SortField sortField : sortFields) {
+				if (sortField.isDefault()) {
+					querySortBy = sortField.getFieldName();
+					// Override the sortBy using the default value
+					searchCriteria.setSortBy(sortField.getParamName());
+					searchCriteria.setSortType(sortField.getDefaultOrder()
+							.name());
+					break;
+				}
+			}
+		}
+
+		if (querySortBy != null) {
+			// Add sort type
+			String sortType = searchCriteria.getSortType();
+			String querySortType = "asc";
+			if (sortType != null) {
+				if (sortType.equalsIgnoreCase("asc")
+						|| sortType.equalsIgnoreCase("desc")) {
+					querySortType = sortType;
+				} else {
+					logger.error("Invalid sortType. sortType=" + sortType);
+				}
+			}
+			// Override the sortType using the final value
+			if(querySortType!=null){
+				searchCriteria.setSortType(querySortType.toLowerCase());
+			}
+			String sortClause = " ORDER BY " + querySortBy + " "
+					+ querySortType;
+
+			return sortClause;
+		}
+		return null;
+	}
+
+	protected StringBuilder buildWhereClause(SearchCriteria searchCriteria,
+			List<SearchField> searchFields) {
+		return buildWhereClause(searchCriteria, searchFields, false, false);
+	}
+
+	@SuppressWarnings("unchecked")
+	protected StringBuilder buildWhereClause(SearchCriteria searchCriteria,
+			List<SearchField> searchFields, boolean isNativeQuery,
+			boolean excludeWhereKeyword) {
+
+		Map<String, Object> paramList = searchCriteria.getParamList();
+
+		StringBuilder whereClause = new StringBuilder(excludeWhereKeyword ? ""
+				: "WHERE 1 = 1 ");
+
+		List<String> joinTableList = new ArrayList<String>();
+
+		String addedByFieldName = isNativeQuery ? "added_by_id"
+				: "addedByUserId";
+
+		Number ownerId = searchCriteria.getOwnerId();
+		if (ownerId != null) {
+			whereClause.append(" and obj.").append(addedByFieldName)
+					.append(" = :ownerId");
+		}
+
+		// Let's handle search groups first
+		int groupCount = -1;
+		for (SearchGroup searchGroup : searchCriteria.getSearchGroups()) {
+			groupCount++;
+			whereClause.append(" and ").append(
+					searchGroup.getWhereClause("" + groupCount));
+//			searchGroup.getJoinTableList(joinTableList, searchGroup);
+		}
+		
+	
+
+		for (SearchField searchField : searchFields) {
+			int startWhereLen = whereClause.length();
+
+			if (searchField.getFieldName() == null
+					&& searchField.getCustomCondition() == null) { // this field
+				// is used
+				// only for
+				// binding!
+				continue;
+			}
+
+			Object paramValue = paramList.get(searchField.getClientFieldName());
+			boolean isListValue = false;
+			if (paramValue != null && paramValue instanceof Collection) {
+				isListValue = true;
+			}
+
+			if (searchCriteria.getNullParamList().contains(
+					searchField.getClientFieldName())) {
+				whereClause.append(" and ").append(searchField.getFieldName())
+						.append(" is null");
+			} else if (searchCriteria.getNotNullParamList().contains(
+					searchField.getClientFieldName())) {
+				whereClause.append(" and ").append(searchField.getFieldName())
+						.append(" is not null");
+
+			} else if (searchField.getDataType() == SearchField.DATA_TYPE.INT_LIST
+					|| isListValue
+					&& searchField.getDataType() == SearchField.DATA_TYPE.INTEGER) {
+				Collection<Number> intValueList = null;
+				if (paramValue != null
+						&& (paramValue instanceof Integer || paramValue instanceof Long)) {
+					intValueList = new ArrayList<Number>();
+					intValueList.add((Number) paramValue);
+				} else {
+					intValueList = (Collection<Number>) paramValue;
+				}
+
+				if (intValueList != null && intValueList.size() > 0) {
+					if (searchField.getCustomCondition() == null) {
+						if (intValueList.size() <= minInListLength) {
+							whereClause.append(" and ");
+							if (intValueList.size() > 1) {
+								whereClause.append(" ( ");
+							}
+							for (int count = 0; count < intValueList.size(); count++) {
+								if (count > 0) {
+									whereClause.append(" or ");
+								}
+								whereClause
+										.append(searchField.getFieldName())
+										.append(" = :")
+										.append(searchField
+												.getClientFieldName()
+												+ "_"
+												+ count);
+							}
+
+							if (intValueList.size() > 1) {
+								whereClause.append(" ) ");
+							}
+
+						} else {
+							whereClause.append(" and ")
+									.append(searchField.getFieldName())
+									.append(" in ( :")
+									.append(searchField.getClientFieldName())
+									.append(")");
+						}
+					} else {
+						whereClause.append(" and ").append(
+								searchField.getCustomCondition());
+					}
+				}
+
+			} else if (searchField.getDataType() == SearchField.DATA_TYPE.STR_LIST) {
+				if (paramValue != null
+						&& (((Collection) paramValue).size()) >=1) {
+					whereClause.append(" and ")
+							.append(searchField.getFieldName())
+							.append(" in ( :")
+							.append(searchField.getClientFieldName())
+							.append(")");
+				}
+			}
+			else if (searchField.getDataType() == SearchField.DATA_TYPE.INTEGER) {
+				Number intFieldValue = (Number) paramList.get(searchField
+						.getClientFieldName());
+				if (intFieldValue != null) {
+					if (searchField.getCustomCondition() == null) {
+						whereClause.append(" and ")
+								.append(searchField.getFieldName())
+								.append("=:")
+								.append(searchField.getClientFieldName());
+					} else {
+						whereClause.append(" and ").append(
+								searchField.getCustomCondition());
+					}
+				}
+			} else if (searchField.getDataType() == SearchField.DATA_TYPE.STRING) {
+				String strFieldValue = (String) paramList.get(searchField
+						.getClientFieldName());
+				if (strFieldValue != null) {
+					if (searchField.getCustomCondition() == null) {
+						whereClause.append(" and ").append("LOWER(")
+								.append(searchField.getFieldName()).append(")");
+						if (searchField.getSearchType() == SearchField.SEARCH_TYPE.FULL) {
+							whereClause.append("= :").append(
+									searchField.getClientFieldName());
+						} else {
+							whereClause.append("like :").append(
+									searchField.getClientFieldName());
+						}
+					} else {
+						whereClause.append(" and ").append(
+								searchField.getCustomCondition());
+					}
+				}
+			} else if (searchField.getDataType() == SearchField.DATA_TYPE.BOOLEAN) {
+				Boolean boolFieldValue = (Boolean) paramList.get(searchField
+						.getClientFieldName());
+				if (boolFieldValue != null) {
+					if (searchField.getCustomCondition() == null) {
+						whereClause.append(" and ")
+								.append(searchField.getFieldName())
+								.append("=:")
+								.append(searchField.getClientFieldName());
+					} else {
+						whereClause.append(" and ").append(
+								searchField.getCustomCondition());
+					}
+				}
+			} else if (searchField.getDataType() == SearchField.DATA_TYPE.DATE) {
+				Date fieldValue = (Date) paramList.get(searchField
+						.getClientFieldName());
+				if (fieldValue != null) {
+					if (searchField.getCustomCondition() == null) {
+						whereClause.append(" and ").append(
+								searchField.getFieldName());
+						if (searchField.getSearchType().equals(
+								SearchField.SEARCH_TYPE.LESS_THAN)) {
+							whereClause.append("< :");
+						} else if (searchField.getSearchType().equals(
+								SearchField.SEARCH_TYPE.LESS_EQUAL_THAN)) {
+							whereClause.append("<= :");
+						} else if (searchField.getSearchType().equals(
+								SearchField.SEARCH_TYPE.GREATER_THAN)) {
+							whereClause.append("> :");
+						} else if (searchField.getSearchType().equals(
+								SearchField.SEARCH_TYPE.GREATER_EQUAL_THAN)) {
+							whereClause.append(">= :");
+						}
+						whereClause.append(searchField.getClientFieldName());
+					} else {
+						whereClause.append(" and ").append(
+								searchField.getCustomCondition());
+					}
+				}
+
+			}
+
+			if (whereClause.length() > startWhereLen
+					&& searchField.getJoinTables() != null) {
+				for (String table : searchField.getJoinTables()) {
+					if (!joinTableList.contains(table)) {
+						joinTableList.add(table);
+					}
+				}
+
+				whereClause.append(" and (")
+						.append(searchField.getJoinCriteria()).append(")");
+			}
+		} // for
+
+		for (String joinTable : joinTableList) {
+			whereClause.insert(0, ", " + joinTable + " ");
+		}
+
+		return whereClause;
+	}
+
+	protected void addOrderByClause(StringBuilder queryClause, String sortClause) {
+		if (sortClause != null) {
+			queryClause.append(sortClause);
+		}
+	}
+
+	@SuppressWarnings("unchecked")
+	protected void resolveQueryParams(Query query, SearchCriteria searchCriteria,
+			List<SearchField> searchFields) {
+
+		Map<String, Object> paramList = searchCriteria.getParamList();
+
+		Number ownerId = searchCriteria.getOwnerId();
+		if (ownerId != null) {
+			query.setParameter("ownerId", ownerId);
+		}
+
+		// Let's handle search groups first
+		int groupCount = -1;
+		for (SearchGroup searchGroup : searchCriteria.getSearchGroups()) {
+			groupCount++;
+			searchGroup.resolveValues(query, "" + groupCount);
+		}
+
+		for (SearchField searchField : searchFields) {
+			Object paramValue = paramList.get(searchField.getClientFieldName());
+			boolean isListValue = false;
+			if (paramValue != null && paramValue instanceof Collection) {
+				isListValue = true;
+			}
+
+			if (searchCriteria.getNullParamList().contains(
+					searchField.getClientFieldName())
+					|| searchCriteria.getNotNullParamList().contains(
+							searchField.getClientFieldName())) {
+				// Already addressed while building where clause
+			} else if (searchField.getDataType() == SearchField.DATA_TYPE.INT_LIST
+					|| isListValue
+					&& searchField.getDataType() == SearchField.DATA_TYPE.INTEGER) {
+				Collection<Number> intValueList = null;
+				if (paramValue != null
+						&& (paramValue instanceof Integer || paramValue instanceof Long)) {
+					intValueList = new ArrayList<Number>();
+					intValueList.add((Number) paramValue);
+				} else {
+					intValueList = (Collection<Number>) paramValue;
+				}
+
+				if (intValueList != null && intValueList.size() > 0
+						&& intValueList.size() <= minInListLength) {
+					int count = -1;
+					for (Number value : intValueList) {
+						count++;
+						query.setParameter(searchField.getClientFieldName()
+								+ "_" + count, value);
+
+					}
+
+				} else if (intValueList != null && intValueList.size() > 1) {
+					query.setParameter(searchField.getClientFieldName(),
+							intValueList);
+				}
+
+			}else if (searchField.getDataType() == SearchField.DATA_TYPE.STR_LIST) {
+				if (paramValue != null
+						&& (((Collection) paramValue).size()) >=1) {
+					query.setParameter(searchField.getClientFieldName(),
+							paramValue);
+				}			
+			}
+			else if (searchField.getDataType() == SearchField.DATA_TYPE.INTEGER) {
+				Number intFieldValue = (Number) paramList.get(searchField
+						.getClientFieldName());
+				if (intFieldValue != null) {
+					query.setParameter(searchField.getClientFieldName(),
+							intFieldValue);
+				}
+			} else if (searchField.getDataType() == SearchField.DATA_TYPE.STRING) {
+				String strFieldValue = (String) paramList.get(searchField
+						.getClientFieldName());
+				if (strFieldValue != null) {
+					if (searchField.getSearchType() == SearchField.SEARCH_TYPE.FULL) {
+						query.setParameter(searchField.getClientFieldName(),
+								strFieldValue);
+					} else {
+						query.setParameter(searchField.getClientFieldName(),
+								"%" + strFieldValue + "%");
+					}
+				}
+			} else if (searchField.getDataType() == SearchField.DATA_TYPE.BOOLEAN) {
+				Boolean boolFieldValue = (Boolean) paramList.get(searchField
+						.getClientFieldName());
+				if (boolFieldValue != null) {
+					query.setParameter(searchField.getClientFieldName(),
+							boolFieldValue);
+				}
+			} else if (searchField.getDataType() == SearchField.DATA_TYPE.DATE) {
+				Date fieldValue = (Date) paramList.get(searchField
+						.getClientFieldName());
+				if (fieldValue != null) {
+					query.setParameter(searchField.getClientFieldName(),
+							fieldValue);
+				}
+			}
+
+		} // for
+	}
+
+	public Query createSearchQuery(EntityManager em, String queryStr, String sortClause,
+			SearchCriteria searchCriteria, List<SearchField> searchFields,
+			int objectClassType, boolean hasAttributes, boolean isCountQuery) {
+
+		// [1] Build where clause
+		StringBuilder queryClause = buildWhereClause(searchCriteria,
+				searchFields);
+
+		// [2] Add domain-object-security clause if needed
+		// if (objectClassType != -1
+		// && !ContextUtil.getCurrentUserSession().isUserAdmin()) {
+		// addDomainObjectSecuirtyClause(queryClause, hasAttributes);
+		// }
+
+		// [2] Add order by clause
+		addOrderByClause(queryClause, sortClause);
+
+		// [3] Create Query Object
+		Query query = em.createQuery(
+				queryStr + queryClause);
+
+		// [4] Resolve query parameters with values
+		resolveQueryParams(query, searchCriteria, searchFields);
+
+		// [5] Resolve domain-object-security parameters
+		// if (objectClassType != -1 &&
+		// !securityHandler.hasModeratorPermission()) {
+		// resolveDomainObjectSecuirtyParams(query, objectClassType);
+		// }
+
+		if (!isCountQuery) {
+			query.setFirstResult(searchCriteria.getStartIndex());
+			updateQueryPageSize(query, searchCriteria);
+		}
+
+		return query;
+	}
+
+	public Query createSearchQuery(EntityManager em, String queryStr, String sortClause,
+			SearchCriteria searchCriteria, List<SearchField> searchFields,
+			boolean isCountQuery) {
+		return createSearchQuery(em, queryStr, sortClause, searchCriteria,
+				searchFields, -1, false, isCountQuery);
+	}
+	
+	public List<Integer> extractIntList(HttpServletRequest request,
+			SearchCriteria searchCriteria, String paramName,
+			String userFriendlyParamName, String listName) {
+		ArrayList<Integer> valueList = new ArrayList<Integer>();
+		String[] values = getParamMultiValues(request, paramName, listName);
+
+		for (int i = 0; values != null && i < values.length; i++) {
+			Integer value = restErrorUtil.parseInt(
+					values[i], "Invalid value for "
+							+ userFriendlyParamName,
+					MessageEnums.INVALID_INPUT_DATA, null, paramName);
+			valueList.add(value);
+		}
+		searchCriteria.getParamList().put(listName, valueList);
+		return valueList;
+	}		
+
+	public Boolean extractBoolean(HttpServletRequest request,
+			SearchCriteria searchCriteria, String paramName,
+			String userFriendlyParamName) {
+		Boolean value = restErrorUtil.parseBoolean(
+				request.getParameter(paramName), "Invalid value for "
+						+ userFriendlyParamName,
+				MessageEnums.INVALID_INPUT_DATA, null, paramName);
+		if (value != null) {
+			searchCriteria.getParamList().put(paramName, value);
+		}
+		return value;
+	}
+	
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/security-admin/src/main/java/com/xasecure/common/SearchValue.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/com/xasecure/common/SearchValue.java b/security-admin/src/main/java/com/xasecure/common/SearchValue.java
new file mode 100644
index 0000000..1fb9bec
--- /dev/null
+++ b/security-admin/src/main/java/com/xasecure/common/SearchValue.java
@@ -0,0 +1,59 @@
+/**
+ *
+ */
+package com.xasecure.common;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+/**
+ * 
+ *
+ */
+public class SearchValue {
+    static final Logger logger = Logger.getLogger(SearchValue.class);
+
+    SearchField searchField;
+    Object value = null;
+    List<?> valueList = null;
+    boolean isNull = false;
+
+   /**
+     * @return the value
+     */
+    public Object getValue() {
+	if (value != null) {
+	    return value;
+	}
+	if (valueList.size() == 1) {
+	    return valueList.get(0);
+	}
+	logger.error("getValue() called for null.", new Throwable());
+	return value;
+    }
+
+    
+
+    /**
+     * @return the valueList
+     */
+    public List<?> getValueList() {
+	return valueList;
+    }
+
+    /**
+     * @return the searchField
+     */
+    public SearchField getSearchField() {
+	return searchField;
+    }
+
+   
+
+
+    public boolean isList() {
+	return valueList != null && valueList.size() > 1;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/security-admin/src/main/java/com/xasecure/common/SortField.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/com/xasecure/common/SortField.java b/security-admin/src/main/java/com/xasecure/common/SortField.java
new file mode 100644
index 0000000..a3b4669
--- /dev/null
+++ b/security-admin/src/main/java/com/xasecure/common/SortField.java
@@ -0,0 +1,80 @@
+/**
+ *
+ */
+package com.xasecure.common;
+
+/**
+ *
+ *
+ */
+public class SortField {
+    public enum SORT_ORDER {
+	ASC, DESC
+    };
+
+    String paramName;
+    String fieldName;
+    boolean isDefault = false;
+    SORT_ORDER defaultOrder = SORT_ORDER.ASC;
+
+    /**
+     * @param string
+     * @param string2
+     */
+    public SortField(String paramName, String fieldName) {
+	this.paramName = paramName;
+	this.fieldName = fieldName;
+	isDefault = false;
+    }
+
+    /**
+     * @param paramName
+     * @param fieldName
+     * @param isDefault
+     */
+    public SortField(String paramName, String fieldName, boolean isDefault,
+	    SORT_ORDER defaultOrder) {
+	this.paramName = paramName;
+	this.fieldName = fieldName;
+	this.isDefault = isDefault;
+	this.defaultOrder = defaultOrder;
+    }
+
+    /**
+     * @return the paramName
+     */
+    public String getParamName() {
+	return paramName;
+    }
+
+    
+
+    /**
+     * @return the fieldName
+     */
+    public String getFieldName() {
+	return fieldName;
+    }
+
+    
+
+    /**
+     * @return the isDefault
+     */
+    public boolean isDefault() {
+	return isDefault;
+    }
+
+    
+
+    /**
+     * @return the defaultOrder
+     */
+    public SORT_ORDER getDefaultOrder() {
+        return defaultOrder;
+    }
+
+    
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/security-admin/src/main/java/com/xasecure/common/StringUtil.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/com/xasecure/common/StringUtil.java b/security-admin/src/main/java/com/xasecure/common/StringUtil.java
new file mode 100644
index 0000000..a186781
--- /dev/null
+++ b/security-admin/src/main/java/com/xasecure/common/StringUtil.java
@@ -0,0 +1,225 @@
+package com.xasecure.common;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+@Component
+public class StringUtil implements Serializable {
+	static final Logger logger = Logger.getLogger(StringUtil.class);
+
+	static final public int MIN_PASSWORD_LENGTH = 8;
+
+	static final public String VALIDATION_NAME = "[\\w\\ \\-\\']*";
+	static final public String VALIDATION_TEXT = "[a-zA-Z0-9\\ \"!@#$%^&amp;*()-_=+;:'&quot;|~`&lt;&gt;?/{}\\.\\,\\-\\?<>]*";
+	// Only for Student loginId
+	static final public String VALIDATION_LOGINID = "[a-z,A-Z][\\w\\-\\_]*[a-z,A-Z,0-9]";
+
+	static final public String VALIDATION_ALPHA = "[a-z,A-Z]*";
+	static final public String VALIDATION_IP_ADDRESS = "[\\d\\.\\%\\:]*";
+
+	static HashMap<String, Pattern> compiledRegEx = new HashMap<String, Pattern>();
+
+	String[] invalidNames = null;
+
+	/**
+     *
+     */
+	private static final long serialVersionUID = -2102399594424760213L;
+
+	public StringUtil() {
+		// Default constructor
+		invalidNames = PropertiesUtil.getPropertyStringList("xa.names.invalid");
+	}
+
+	/**
+	 * Checks if the string is null or empty string.
+	 * 
+	 * @param str
+	 * @return true if it is empty string or null
+	 */
+	public boolean isEmpty(String str) {
+		if (str == null || str.trim().length() == 0) {
+			return true;
+		}
+		return false;
+	}
+
+	public boolean equals(String str1, String str2) {
+		if (str1 == str2) {
+			return true;
+		}
+
+		if (str1 == null || str2 == null) {
+			return false;
+		}
+
+		return str1.equals(str2);
+	}
+
+	public String toCamelCaseAllWords(String str) {
+		if (str == null) {
+			return null;
+		}
+		str = str.trim().toLowerCase();
+		StringBuffer result = new StringBuffer(str.length());
+		boolean makeUpper = true;
+		boolean lastCharSpace = true;
+		for (int c = 0; c < str.length(); c++) {
+			char ch = str.charAt(c);
+			if (lastCharSpace && ch == ' ') {
+				continue;
+			}
+
+			if (makeUpper) {
+				result.append(str.substring(c, c + 1).toUpperCase());
+				makeUpper = false;
+			} else {
+				result.append(ch);
+			}
+			if (ch == ' ') {
+				lastCharSpace = true;
+				makeUpper = true;
+			} else {
+				lastCharSpace = false;
+			}
+
+		}
+		return result.toString();
+	}
+
+	public boolean validatePassword(String password, String[] invalidValues) {
+		// For now let's make sure we have minimum 8 characters
+		if (password == null) {
+			return false;
+		}
+		password = password.trim();
+		if (password.length() < MIN_PASSWORD_LENGTH) {
+			return false;
+		}
+
+		boolean hasAlpha = false;
+		boolean hasNum = false;
+		for (int i = 0; i < password.length(); i++) {
+			char ch = password.charAt(i);
+
+			if (Character.isDigit(ch)) {
+				hasNum = true;
+			} else if (Character.isLetter(ch)) {
+				hasAlpha = true;
+			}
+		}
+
+		if (!hasAlpha || !hasNum) {
+			return false;
+		}
+
+		for (int i = 0; invalidValues != null && i < invalidValues.length; i++) {
+			if (password.equalsIgnoreCase(invalidValues[i])) {
+				return false;
+			}
+		}
+		return true;
+	}
+
+	public boolean validateEmail(String emailAddress) {
+		if (emailAddress == null || emailAddress.trim().length() > 128) {
+			return false;
+		}
+		emailAddress = emailAddress.trim();
+		String expression = "^[\\w]([\\-\\.\\w])+[\\w]+@[\\w]+[\\w\\-]+[\\w]*\\.([\\w]+[\\w\\-]+[\\w]*(\\.[a-z][a-z|0-9]*)?)$";
+		return regExPatternMatch(expression, emailAddress);
+
+	}
+
+	public boolean regExPatternMatch(String expression, String inputStr) {
+		Pattern pattern = compiledRegEx.get(expression);
+		if (pattern == null) {
+			pattern = Pattern.compile(expression, Pattern.CASE_INSENSITIVE);
+			compiledRegEx.put(expression, pattern);
+		}
+
+		Matcher matcher = pattern.matcher(inputStr);
+		return matcher.matches();
+	}
+
+	public boolean validateString(String regExStr, String str) {
+		try {
+			return regExPatternMatch(regExStr, str);
+		} catch (Throwable t) {
+			logger.info("Error validating string. str=" + str, t);
+			return false;
+		}
+	}
+
+	public String normalizeEmail(String email) {
+		// Make email address as lower case
+		if (email != null) {
+			return email.trim().toLowerCase();
+		}
+		return null;
+	}
+
+	public String[] split(String value) {
+		return split(value, ",");
+	}
+
+	public String[] split(String value, String delimiter) {
+		if (value != null) {
+			value = value.startsWith(delimiter) ? value.substring(1) : value;
+			String[] splitValues = value.split(delimiter);
+			String[] returnValues = new String[splitValues.length];
+			int c = -1;
+			for (int i = 0; i < splitValues.length; i++) {
+				String str = splitValues[i].trim();
+				if (str.length() > 0) {
+					c++;
+					returnValues[c] = str;
+				}
+			}
+			return returnValues;
+		} else {
+			return new String[0];
+		}
+	}
+
+	public static String trim(String str) {
+		return str != null ? str.trim() : null;
+	}
+
+	/**
+	 * @param firstName
+	 * @return
+	 */
+	public boolean isValidName(String name) {
+		if (name == null || name.trim().length() < 1) {
+			return false;
+		}
+		for (String invalidName : invalidNames) {
+			if (name.toUpperCase().trim()
+					.startsWith(invalidName.toUpperCase().trim())) {
+				return false;
+			}
+		}
+		return validateString(VALIDATION_NAME, name);
+	}
+
+	/**
+	 * Checks if the list is null or empty list.
+	 * 
+	 * @param list
+	 * @return true if it is empty list or null
+	 */
+	public boolean isEmpty(List<?> list) {
+		if (list == null || list.size() == 0) {
+			return true;
+		}
+		return false;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/security-admin/src/main/java/com/xasecure/common/TimedEventUtil.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/com/xasecure/common/TimedEventUtil.java b/security-admin/src/main/java/com/xasecure/common/TimedEventUtil.java
new file mode 100644
index 0000000..6a9dbf5
--- /dev/null
+++ b/security-admin/src/main/java/com/xasecure/common/TimedEventUtil.java
@@ -0,0 +1,59 @@
+package com.xasecure.common;
+
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeoutException;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+@Component
+public class TimedEventUtil{
+
+	static final Logger logger = Logger.getLogger(TimedEventUtil.class);
+
+	public static void runWithTimeout(final Runnable runnable, long timeout, TimeUnit timeUnit) throws Exception {
+		timedTask(new Callable<Object>() {
+			@Override
+			public Object call() throws Exception {
+				runnable.run();
+				return null;
+			}
+		}, timeout, timeUnit);
+	}
+
+	public static <T> T timedTask(Callable<T> callableObj, long timeout, 
+			TimeUnit timeUnit) throws Exception{
+		
+		return callableObj.call();
+		
+		/*
+		final ExecutorService executor = Executors.newSingleThreadExecutor();
+		final Future<T> future = executor.submit(callableObj);
+		executor.shutdownNow();
+
+		try {
+			return future.get(timeout, timeUnit);
+		} catch (TimeoutException | InterruptedException | ExecutionException e) {
+			if(logger.isDebugEnabled()){
+				logger.debug("Error executing task", e);
+			}
+			Throwable t = e.getCause();
+			if (t instanceof Error) {
+				throw (Error) t;
+			} else if (t instanceof Exception) {
+				throw (Exception) e;
+			} else {
+				throw new IllegalStateException(t);
+			}
+		}
+		*/
+		
+	}
+	
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/security-admin/src/main/java/com/xasecure/common/UserSessionBase.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/com/xasecure/common/UserSessionBase.java b/security-admin/src/main/java/com/xasecure/common/UserSessionBase.java
new file mode 100644
index 0000000..15d73e2
--- /dev/null
+++ b/security-admin/src/main/java/com/xasecure/common/UserSessionBase.java
@@ -0,0 +1,96 @@
+package com.xasecure.common;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import com.xasecure.entity.XXAuthSession;
+import com.xasecure.entity.XXPortalUser;
+
+public class UserSessionBase implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	XXPortalUser xXPortalUser;
+	XXAuthSession xXAuthSession;
+	private boolean userAdmin;
+	private int authProvider = XAConstants.USER_APP;
+	private List<String> userRoleList = new ArrayList<String>();
+	int clientTimeOffsetInMinute = 0;
+	public Long getUserId() {
+		if (xXPortalUser != null) {
+			return xXPortalUser.getId();
+		}
+		return null;
+	}
+
+	public String getLoginId() {
+		if (xXPortalUser != null) {
+			return xXPortalUser.getLoginId();
+		}
+		return null;
+	}
+
+	public Long getSessionId() {
+		if (xXAuthSession != null) {
+			return xXAuthSession.getId();
+		}
+		return null;
+	}
+
+	
+
+	public boolean isUserAdmin() {
+		return userAdmin;
+	}
+
+	
+
+	
+	public void setUserAdmin(boolean userAdmin) {
+		this.userAdmin = userAdmin;
+	}
+
+	public XXPortalUser getXXPortalUser() {
+		return xXPortalUser;
+	}
+
+	public String getUserName() {
+		if (xXPortalUser != null) {
+			return xXPortalUser.getFirstName() + " " + xXPortalUser.getLastName();
+		}
+		return null;
+	}
+
+	public void setXXAuthSession(XXAuthSession gjAuthSession) {
+		this.xXAuthSession = gjAuthSession;
+	}
+
+	public void setXXPortalUser(XXPortalUser gjUser) {
+		this.xXPortalUser = gjUser;
+	}
+
+	public void setAuthProvider(int userSource) {
+		this.authProvider = userSource;
+	}
+
+	public void setUserRoleList(List<String> strRoleList) {
+		this.userRoleList = strRoleList;
+	}
+
+	public int getAuthProvider() {
+		return this.authProvider;
+	}
+
+	public int getClientTimeOffsetInMinute() {
+		return clientTimeOffsetInMinute;
+	}
+
+	public void setClientTimeOffsetInMinute(int clientTimeOffsetInMinute) {
+		this.clientTimeOffsetInMinute = clientTimeOffsetInMinute;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/security-admin/src/main/java/com/xasecure/common/XACommonEnums.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/com/xasecure/common/XACommonEnums.java b/security-admin/src/main/java/com/xasecure/common/XACommonEnums.java
new file mode 100644
index 0000000..53f107b
--- /dev/null
+++ b/security-admin/src/main/java/com/xasecure/common/XACommonEnums.java
@@ -0,0 +1,1413 @@
+package com.xasecure.common;
+/*
+ * Copyright (c) 2014 XASecure
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information of
+ * XASecure ("Confidential Information").  You shall not
+ * disclose such Confidential Information and shall use it only in
+ * accordance with the terms of the license agreement you entered into
+ * with XASecure
+ */
+
+/**
+ * 
+ */
+
+import java.util.*;
+import com.xasecure.common.*;
+
+public class XACommonEnums {
+
+	/***************************************************************
+	 * Enum values for ActiveStatus
+	 **************************************************************/
+	/**
+	 * STATUS_DISABLED is an element of enum ActiveStatus. Its value is "STATUS_DISABLED".
+	 */
+	public static final int STATUS_DISABLED = 0;
+	/**
+	 * STATUS_ENABLED is an element of enum ActiveStatus. Its value is "STATUS_ENABLED".
+	 */
+	public static final int STATUS_ENABLED = 1;
+	/**
+	 * STATUS_DELETED is an element of enum ActiveStatus. Its value is "STATUS_DELETED".
+	 */
+	public static final int STATUS_DELETED = 2;
+
+	/**
+	 * Max value for enum ActiveStatus_MAX
+	 */
+	public static final int ActiveStatus_MAX = 2;
+
+
+	/***************************************************************
+	 * Enum values for ActivationStatus
+	 **************************************************************/
+	/**
+	 * ACT_STATUS_DISABLED is an element of enum ActivationStatus. Its value is "ACT_STATUS_DISABLED".
+	 */
+	public static final int ACT_STATUS_DISABLED = 0;
+	/**
+	 * ACT_STATUS_ACTIVE is an element of enum ActivationStatus. Its value is "ACT_STATUS_ACTIVE".
+	 */
+	public static final int ACT_STATUS_ACTIVE = 1;
+	/**
+	 * ACT_STATUS_PENDING_APPROVAL is an element of enum ActivationStatus. Its value is "ACT_STATUS_PENDING_APPROVAL".
+	 */
+	public static final int ACT_STATUS_PENDING_APPROVAL = 2;
+	/**
+	 * ACT_STATUS_PENDING_ACTIVATION is an element of enum ActivationStatus. Its value is "ACT_STATUS_PENDING_ACTIVATION".
+	 */
+	public static final int ACT_STATUS_PENDING_ACTIVATION = 3;
+	/**
+	 * ACT_STATUS_REJECTED is an element of enum ActivationStatus. Its value is "ACT_STATUS_REJECTED".
+	 */
+	public static final int ACT_STATUS_REJECTED = 4;
+	/**
+	 * ACT_STATUS_DEACTIVATED is an element of enum ActivationStatus. Its value is "ACT_STATUS_DEACTIVATED".
+	 */
+	public static final int ACT_STATUS_DEACTIVATED = 5;
+	/**
+	 * ACT_STATUS_PRE_REGISTRATION is an element of enum ActivationStatus. Its value is "ACT_STATUS_PRE_REGISTRATION".
+	 */
+	public static final int ACT_STATUS_PRE_REGISTRATION = 6;
+	/**
+	 * ACT_STATUS_NO_LOGIN is an element of enum ActivationStatus. Its value is "ACT_STATUS_NO_LOGIN".
+	 */
+	public static final int ACT_STATUS_NO_LOGIN = 7;
+
+	/**
+	 * Max value for enum ActivationStatus_MAX
+	 */
+	public static final int ActivationStatus_MAX = 7;
+
+
+	/***************************************************************
+	 * Enum values for BooleanValue
+	 **************************************************************/
+	/**
+	 * BOOL_NONE is an element of enum BooleanValue. Its value is "BOOL_NONE".
+	 */
+	public static final int BOOL_NONE = 0;
+	/**
+	 * BOOL_TRUE is an element of enum BooleanValue. Its value is "BOOL_TRUE".
+	 */
+	public static final int BOOL_TRUE = 1;
+	/**
+	 * BOOL_FALSE is an element of enum BooleanValue. Its value is "BOOL_FALSE".
+	 */
+	public static final int BOOL_FALSE = 2;
+
+	/**
+	 * Max value for enum BooleanValue_MAX
+	 */
+	public static final int BooleanValue_MAX = 2;
+
+
+	/***************************************************************
+	 * Enum values for DataType
+	 **************************************************************/
+	/**
+	 * DATA_TYPE_UNKNOWN is an element of enum DataType. Its value is "DATA_TYPE_UNKNOWN".
+	 */
+	public static final int DATA_TYPE_UNKNOWN = 0;
+	/**
+	 * DATA_TYPE_INTEGER is an element of enum DataType. Its value is "DATA_TYPE_INTEGER".
+	 */
+	public static final int DATA_TYPE_INTEGER = 1;
+	/**
+	 * DATA_TYPE_DOUBLE is an element of enum DataType. Its value is "DATA_TYPE_DOUBLE".
+	 */
+	public static final int DATA_TYPE_DOUBLE = 2;
+	/**
+	 * DATA_TYPE_STRING is an element of enum DataType. Its value is "DATA_TYPE_STRING".
+	 */
+	public static final int DATA_TYPE_STRING = 3;
+	/**
+	 * DATA_TYPE_BOOLEAN is an element of enum DataType. Its value is "DATA_TYPE_BOOLEAN".
+	 */
+	public static final int DATA_TYPE_BOOLEAN = 4;
+	/**
+	 * DATA_TYPE_DATE is an element of enum DataType. Its value is "DATA_TYPE_DATE".
+	 */
+	public static final int DATA_TYPE_DATE = 5;
+	/**
+	 * DATA_TYPE_STRING_ENUM is an element of enum DataType. Its value is "DATA_TYPE_STRING_ENUM".
+	 */
+	public static final int DATA_TYPE_STRING_ENUM = 6;
+	/**
+	 * DATA_TYPE_LONG is an element of enum DataType. Its value is "DATA_TYPE_LONG".
+	 */
+	public static final int DATA_TYPE_LONG = 7;
+	/**
+	 * DATA_TYPE_INTEGER_ENUM is an element of enum DataType. Its value is "DATA_TYPE_INTEGER_ENUM".
+	 */
+	public static final int DATA_TYPE_INTEGER_ENUM = 8;
+
+	/**
+	 * Max value for enum DataType_MAX
+	 */
+	public static final int DataType_MAX = 8;
+
+
+	/***************************************************************
+	 * Enum values for DeviceType
+	 **************************************************************/
+	/**
+	 * DEVICE_UNKNOWN is an element of enum DeviceType. Its value is "DEVICE_UNKNOWN".
+	 */
+	public static final int DEVICE_UNKNOWN = 0;
+	/**
+	 * DEVICE_BROWSER is an element of enum DeviceType. Its value is "DEVICE_BROWSER".
+	 */
+	public static final int DEVICE_BROWSER = 1;
+	/**
+	 * DEVICE_IPHONE is an element of enum DeviceType. Its value is "DEVICE_IPHONE".
+	 */
+	public static final int DEVICE_IPHONE = 2;
+	/**
+	 * DEVICE_IPAD is an element of enum DeviceType. Its value is "DEVICE_IPAD".
+	 */
+	public static final int DEVICE_IPAD = 3;
+	/**
+	 * DEVICE_IPOD is an element of enum DeviceType. Its value is "DEVICE_IPOD".
+	 */
+	public static final int DEVICE_IPOD = 4;
+	/**
+	 * DEVICE_ANDROID is an element of enum DeviceType. Its value is "DEVICE_ANDROID".
+	 */
+	public static final int DEVICE_ANDROID = 5;
+
+	/**
+	 * Max value for enum DeviceType_MAX
+	 */
+	public static final int DeviceType_MAX = 5;
+
+
+	/***************************************************************
+	 * Enum values for DiffLevel
+	 **************************************************************/
+	/**
+	 * DIFF_UNKNOWN is an element of enum DiffLevel. Its value is "DIFF_UNKNOWN".
+	 */
+	public static final int DIFF_UNKNOWN = 0;
+	/**
+	 * DIFF_LOW is an element of enum DiffLevel. Its value is "DIFF_LOW".
+	 */
+	public static final int DIFF_LOW = 1;
+	/**
+	 * DIFF_MEDIUM is an element of enum DiffLevel. Its value is "DIFF_MEDIUM".
+	 */
+	public static final int DIFF_MEDIUM = 2;
+	/**
+	 * DIFF_HIGH is an element of enum DiffLevel. Its value is "DIFF_HIGH".
+	 */
+	public static final int DIFF_HIGH = 3;
+
+	/**
+	 * Max value for enum DiffLevel_MAX
+	 */
+	public static final int DiffLevel_MAX = 3;
+
+
+	/***************************************************************
+	 * Enum values for FileType
+	 **************************************************************/
+	/**
+	 * FILE_FILE is an element of enum FileType. Its value is "FILE_FILE".
+	 */
+	public static final int FILE_FILE = 0;
+	/**
+	 * FILE_DIR is an element of enum FileType. Its value is "FILE_DIR".
+	 */
+	public static final int FILE_DIR = 1;
+
+	/**
+	 * Max value for enum FileType_MAX
+	 */
+	public static final int FileType_MAX = 1;
+
+
+	/***************************************************************
+	 * Enum values for FreqType
+	 **************************************************************/
+	/**
+	 * FREQ_NONE is an element of enum FreqType. Its value is "FREQ_NONE".
+	 */
+	public static final int FREQ_NONE = 0;
+	/**
+	 * FREQ_MANUAL is an element of enum FreqType. Its value is "FREQ_MANUAL".
+	 */
+	public static final int FREQ_MANUAL = 1;
+	/**
+	 * FREQ_HOURLY is an element of enum FreqType. Its value is "FREQ_HOURLY".
+	 */
+	public static final int FREQ_HOURLY = 2;
+	/**
+	 * FREQ_DAILY is an element of enum FreqType. Its value is "FREQ_DAILY".
+	 */
+	public static final int FREQ_DAILY = 3;
+	/**
+	 * FREQ_WEEKLY is an element of enum FreqType. Its value is "FREQ_WEEKLY".
+	 */
+	public static final int FREQ_WEEKLY = 4;
+	/**
+	 * FREQ_BI_WEEKLY is an element of enum FreqType. Its value is "FREQ_BI_WEEKLY".
+	 */
+	public static final int FREQ_BI_WEEKLY = 5;
+	/**
+	 * FREQ_MONTHLY is an element of enum FreqType. Its value is "FREQ_MONTHLY".
+	 */
+	public static final int FREQ_MONTHLY = 6;
+
+	/**
+	 * Max value for enum FreqType_MAX
+	 */
+	public static final int FreqType_MAX = 6;
+
+
+	/***************************************************************
+	 * Enum values for MimeType
+	 **************************************************************/
+	/**
+	 * MIME_UNKNOWN is an element of enum MimeType. Its value is "MIME_UNKNOWN".
+	 */
+	public static final int MIME_UNKNOWN = 0;
+	/**
+	 * MIME_TEXT is an element of enum MimeType. Its value is "MIME_TEXT".
+	 */
+	public static final int MIME_TEXT = 1;
+	/**
+	 * MIME_HTML is an element of enum MimeType. Its value is "MIME_HTML".
+	 */
+	public static final int MIME_HTML = 2;
+	/**
+	 * MIME_PNG is an element of enum MimeType. Its value is "MIME_PNG".
+	 */
+	public static final int MIME_PNG = 3;
+	/**
+	 * MIME_JPEG is an element of enum MimeType. Its value is "MIME_JPEG".
+	 */
+	public static final int MIME_JPEG = 4;
+
+	/**
+	 * Max value for enum MimeType_MAX
+	 */
+	public static final int MimeType_MAX = 4;
+
+
+	/***************************************************************
+	 * Enum values for NumberFormat
+	 **************************************************************/
+	/**
+	 * NUM_FORMAT_NONE is an element of enum NumberFormat. Its value is "NUM_FORMAT_NONE".
+	 */
+	public static final int NUM_FORMAT_NONE = 0;
+	/**
+	 * NUM_FORMAT_NUMERIC is an element of enum NumberFormat. Its value is "NUM_FORMAT_NUMERIC".
+	 */
+	public static final int NUM_FORMAT_NUMERIC = 1;
+	/**
+	 * NUM_FORMAT_ALPHA is an element of enum NumberFormat. Its value is "NUM_FORMAT_ALPHA".
+	 */
+	public static final int NUM_FORMAT_ALPHA = 2;
+	/**
+	 * NUM_FORMAT_ROMAN is an element of enum NumberFormat. Its value is "NUM_FORMAT_ROMAN".
+	 */
+	public static final int NUM_FORMAT_ROMAN = 3;
+
+	/**
+	 * Max value for enum NumberFormat_MAX
+	 */
+	public static final int NumberFormat_MAX = 3;
+
+
+	/***************************************************************
+	 * Enum values for ObjectStatus
+	 **************************************************************/
+	/**
+	 * OBJ_STATUS_ACTIVE is an element of enum ObjectStatus. Its value is "OBJ_STATUS_ACTIVE".
+	 */
+	public static final int OBJ_STATUS_ACTIVE = 0;
+	/**
+	 * OBJ_STATUS_DELETED is an element of enum ObjectStatus. Its value is "OBJ_STATUS_DELETED".
+	 */
+	public static final int OBJ_STATUS_DELETED = 1;
+	/**
+	 * OBJ_STATUS_ARCHIVED is an element of enum ObjectStatus. Its value is "OBJ_STATUS_ARCHIVED".
+	 */
+	public static final int OBJ_STATUS_ARCHIVED = 2;
+
+	/**
+	 * Max value for enum ObjectStatus_MAX
+	 */
+	public static final int ObjectStatus_MAX = 2;
+
+
+	/***************************************************************
+	 * Enum values for PasswordResetStatus
+	 **************************************************************/
+	/**
+	 * PWD_RESET_ACTIVE is an element of enum PasswordResetStatus. Its value is "PWD_RESET_ACTIVE".
+	 */
+	public static final int PWD_RESET_ACTIVE = 0;
+	/**
+	 * PWD_RESET_USED is an element of enum PasswordResetStatus. Its value is "PWD_RESET_USED".
+	 */
+	public static final int PWD_RESET_USED = 1;
+	/**
+	 * PWD_RESET_EXPIRED is an element of enum PasswordResetStatus. Its value is "PWD_RESET_EXPIRED".
+	 */
+	public static final int PWD_RESET_EXPIRED = 2;
+	/**
+	 * PWD_RESET_DISABLED is an element of enum PasswordResetStatus. Its value is "PWD_RESET_DISABLED".
+	 */
+	public static final int PWD_RESET_DISABLED = 3;
+
+	/**
+	 * Max value for enum PasswordResetStatus_MAX
+	 */
+	public static final int PasswordResetStatus_MAX = 3;
+
+
+	/***************************************************************
+	 * Enum values for PriorityType
+	 **************************************************************/
+	/**
+	 * PRIORITY_NORMAL is an element of enum PriorityType. Its value is "PRIORITY_NORMAL".
+	 */
+	public static final int PRIORITY_NORMAL = 0;
+	/**
+	 * PRIORITY_LOW is an element of enum PriorityType. Its value is "PRIORITY_LOW".
+	 */
+	public static final int PRIORITY_LOW = 1;
+	/**
+	 * PRIORITY_MEDIUM is an element of enum PriorityType. Its value is "PRIORITY_MEDIUM".
+	 */
+	public static final int PRIORITY_MEDIUM = 2;
+	/**
+	 * PRIORITY_HIGH is an element of enum PriorityType. Its value is "PRIORITY_HIGH".
+	 */
+	public static final int PRIORITY_HIGH = 3;
+
+	/**
+	 * Max value for enum PriorityType_MAX
+	 */
+	public static final int PriorityType_MAX = 3;
+
+
+	/***************************************************************
+	 * Enum values for ProgressStatus
+	 **************************************************************/
+	/**
+	 * PROGRESS_PENDING is an element of enum ProgressStatus. Its value is "PROGRESS_PENDING".
+	 */
+	public static final int PROGRESS_PENDING = 0;
+	/**
+	 * PROGRESS_IN_PROGRESS is an element of enum ProgressStatus. Its value is "PROGRESS_IN_PROGRESS".
+	 */
+	public static final int PROGRESS_IN_PROGRESS = 1;
+	/**
+	 * PROGRESS_COMPLETE is an element of enum ProgressStatus. Its value is "PROGRESS_COMPLETE".
+	 */
+	public static final int PROGRESS_COMPLETE = 2;
+	/**
+	 * PROGRESS_ABORTED is an element of enum ProgressStatus. Its value is "PROGRESS_ABORTED".
+	 */
+	public static final int PROGRESS_ABORTED = 3;
+	/**
+	 * PROGRESS_FAILED is an element of enum ProgressStatus. Its value is "PROGRESS_FAILED".
+	 */
+	public static final int PROGRESS_FAILED = 4;
+
+	/**
+	 * Max value for enum ProgressStatus_MAX
+	 */
+	public static final int ProgressStatus_MAX = 4;
+
+
+	/***************************************************************
+	 * Enum values for RelationType
+	 **************************************************************/
+	/**
+	 * REL_NONE is an element of enum RelationType. Its value is "REL_NONE".
+	 */
+	public static final int REL_NONE = 0;
+	/**
+	 * REL_SELF is an element of enum RelationType. Its value is "REL_SELF".
+	 */
+	public static final int REL_SELF = 1;
+
+	/**
+	 * Max value for enum RelationType_MAX
+	 */
+	public static final int RelationType_MAX = 1;
+
+
+	/***************************************************************
+	 * Enum values for UserSource
+	 **************************************************************/
+	/**
+	 * USER_APP is an element of enum UserSource. Its value is "USER_APP".
+	 */
+	public static final int USER_APP = 0;
+	public static final int USER_EXTERNAL = 1;
+	public static final int USER_AD= 2;
+	public static final int USER_LDAP = 3;
+	public static final int USER_UNIX = 4;
+	public static final int USER_REPO = 5;
+	
+	public static final int GROUP_INTERNAL = 0;
+	public static final int GROUP_EXTERNAL = 1;
+	public static final int GROUP_AD= 2;
+	public static final int GROUP_LDAP = 3;
+	public static final int GROUP_UNIX = 4;
+	public static final int GROUP_REPO = 5;
+	/**
+	 * USER_GOOGLE is an element of enum UserSource. Its value is "USER_GOOGLE".
+	 */
+	//public static final int USER_GOOGLE = 1;
+	/**
+	 * USER_FB is an element of enum UserSource. Its value is "USER_FB".
+	 */
+	//public static final int USER_FB = 2;
+
+	/**
+	 * Max value for enum UserSource_MAX
+	 */
+	public static final int UserSource_MAX = 5;
+
+
+	/***************************************************************
+	 * Enum values for AssetType
+	 **************************************************************/
+	/**
+	 * ASSET_UNKNOWN is an element of enum AssetType. Its value is "ASSET_UNKNOWN".
+	 */
+	public static final int ASSET_UNKNOWN = 0;
+	/**
+	 * ASSET_HDFS is an element of enum AssetType. Its value is "ASSET_HDFS".
+	 */
+	public static final int ASSET_HDFS = 1;
+	/**
+	 * ASSET_HBASE is an element of enum AssetType. Its value is "ASSET_HBASE".
+	 */
+	public static final int ASSET_HBASE = 2;
+	/**
+	 * ASSET_HIVE is an element of enum AssetType. Its value is "ASSET_HIVE".
+	 */
+	public static final int ASSET_HIVE = 3;
+
+	/**
+	 * Max value for enum AssetType_MAX
+	 */
+	public static final int AssetType_MAX = 3;
+
+
+	/***************************************************************
+	 * Enum values for AccessResult
+	 **************************************************************/
+	/**
+	 * ACCESS_RESULT_DENIED is an element of enum AccessResult. Its value is "ACCESS_RESULT_DENIED".
+	 */
+	public static final int ACCESS_RESULT_DENIED = 0;
+	/**
+	 * ACCESS_RESULT_ALLOWED is an element of enum AccessResult. Its value is "ACCESS_RESULT_ALLOWED".
+	 */
+	public static final int ACCESS_RESULT_ALLOWED = 1;
+
+	/**
+	 * Max value for enum AccessResult_MAX
+	 */
+	public static final int AccessResult_MAX = 1;
+
+
+	/***************************************************************
+	 * Enum values for PolicyType
+	 **************************************************************/
+	/**
+	 * POLICY_INCLUSION is an element of enum PolicyType. Its value is "POLICY_INCLUSION".
+	 */
+	public static final int POLICY_INCLUSION = 0;
+	/**
+	 * POLICY_EXCLUSION is an element of enum PolicyType. Its value is "POLICY_EXCLUSION".
+	 */
+	public static final int POLICY_EXCLUSION = 1;
+
+	/**
+	 * Max value for enum PolicyType_MAX
+	 */
+	public static final int PolicyType_MAX = 1;
+
+
+	/***************************************************************
+	 * Enum values for XAAuditType
+	 **************************************************************/
+	/**
+	 * XA_AUDIT_TYPE_UNKNOWN is an element of enum XAAuditType. Its value is "XA_AUDIT_TYPE_UNKNOWN".
+	 */
+	public static final int XA_AUDIT_TYPE_UNKNOWN = 0;
+	/**
+	 * XA_AUDIT_TYPE_ALL is an element of enum XAAuditType. Its value is "XA_AUDIT_TYPE_ALL".
+	 */
+	public static final int XA_AUDIT_TYPE_ALL = 1;
+	/**
+	 * XA_AUDIT_TYPE_READ is an element of enum XAAuditType. Its value is "XA_AUDIT_TYPE_READ".
+	 */
+	public static final int XA_AUDIT_TYPE_READ = 2;
+	/**
+	 * XA_AUDIT_TYPE_WRITE is an element of enum XAAuditType. Its value is "XA_AUDIT_TYPE_WRITE".
+	 */
+	public static final int XA_AUDIT_TYPE_WRITE = 3;
+	/**
+	 * XA_AUDIT_TYPE_CREATE is an element of enum XAAuditType. Its value is "XA_AUDIT_TYPE_CREATE".
+	 */
+	public static final int XA_AUDIT_TYPE_CREATE = 4;
+	/**
+	 * XA_AUDIT_TYPE_DELETE is an element of enum XAAuditType. Its value is "XA_AUDIT_TYPE_DELETE".
+	 */
+	public static final int XA_AUDIT_TYPE_DELETE = 5;
+	/**
+	 * XA_AUDIT_TYPE_LOGIN is an element of enum XAAuditType. Its value is "XA_AUDIT_TYPE_LOGIN".
+	 */
+	public static final int XA_AUDIT_TYPE_LOGIN = 6;
+
+	/**
+	 * Max value for enum XAAuditType_MAX
+	 */
+	public static final int XAAuditType_MAX = 6;
+
+
+	/***************************************************************
+	 * Enum values for ResourceType
+	 **************************************************************/
+	/**
+	 * RESOURCE_UNKNOWN is an element of enum ResourceType. Its value is "RESOURCE_UNKNOWN".
+	 */
+	public static final int RESOURCE_UNKNOWN = 0;
+	/**
+	 * RESOURCE_PATH is an element of enum ResourceType. Its value is "RESOURCE_PATH".
+	 */
+	public static final int RESOURCE_PATH = 1;
+	/**
+	 * RESOURCE_DB is an element of enum ResourceType. Its value is "RESOURCE_DB".
+	 */
+	public static final int RESOURCE_DB = 2;
+	/**
+	 * RESOURCE_TABLE is an element of enum ResourceType. Its value is "RESOURCE_TABLE".
+	 */
+	public static final int RESOURCE_TABLE = 3;
+	/**
+	 * RESOURCE_COL_FAM is an element of enum ResourceType. Its value is "RESOURCE_COL_FAM".
+	 */
+	public static final int RESOURCE_COL_FAM = 4;
+	/**
+	 * RESOURCE_COLUMN is an element of enum ResourceType. Its value is "RESOURCE_COLUMN".
+	 */
+	public static final int RESOURCE_COLUMN = 5;
+	/**
+	 * RESOURCE_VIEW is an element of enum ResourceType. Its value is "RESOURCE_VIEW".
+	 */
+	public static final int RESOURCE_VIEW = 6;
+	/**
+	 * RESOURCE_UDF is an element of enum ResourceType. Its value is "RESOURCE_UDF".
+	 */
+	public static final int RESOURCE_UDF = 7;
+	/**
+	 * RESOURCE_VIEW_COL is an element of enum ResourceType. Its value is "RESOURCE_VIEW_COL".
+	 */
+	public static final int RESOURCE_VIEW_COL = 8;
+
+	/**
+	 * Max value for enum ResourceType_MAX
+	 */
+	public static final int ResourceType_MAX = 8;
+
+
+	/***************************************************************
+	 * Enum values for XAGroupType
+	 **************************************************************/
+	/**
+	 * XA_GROUP_UNKNOWN is an element of enum XAGroupType. Its value is "XA_GROUP_UNKNOWN".
+	 */
+	public static final int XA_GROUP_UNKNOWN = 0;
+	/**
+	 * XA_GROUP_USER is an element of enum XAGroupType. Its value is "XA_GROUP_USER".
+	 */
+	public static final int XA_GROUP_USER = 1;
+	/**
+	 * XA_GROUP_GROUP is an element of enum XAGroupType. Its value is "XA_GROUP_GROUP".
+	 */
+	public static final int XA_GROUP_GROUP = 2;
+	/**
+	 * XA_GROUP_ROLE is an element of enum XAGroupType. Its value is "XA_GROUP_ROLE".
+	 */
+	public static final int XA_GROUP_ROLE = 3;
+
+	/**
+	 * Max value for enum XAGroupType_MAX
+	 */
+	public static final int XAGroupType_MAX = 3;
+
+
+	/***************************************************************
+	 * Enum values for XAPermForType
+	 **************************************************************/
+	/**
+	 * XA_PERM_FOR_UNKNOWN is an element of enum XAPermForType. Its value is "XA_PERM_FOR_UNKNOWN".
+	 */
+	public static final int XA_PERM_FOR_UNKNOWN = 0;
+	/**
+	 * XA_PERM_FOR_USER is an element of enum XAPermForType. Its value is "XA_PERM_FOR_USER".
+	 */
+	public static final int XA_PERM_FOR_USER = 1;
+	/**
+	 * XA_PERM_FOR_GROUP is an element of enum XAPermForType. Its value is "XA_PERM_FOR_GROUP".
+	 */
+	public static final int XA_PERM_FOR_GROUP = 2;
+
+	/**
+	 * Max value for enum XAPermForType_MAX
+	 */
+	public static final int XAPermForType_MAX = 2;
+
+
+	/***************************************************************
+	 * Enum values for XAPermType
+	 **************************************************************/
+	/**
+	 * XA_PERM_TYPE_UNKNOWN is an element of enum XAPermType. Its value is "XA_PERM_TYPE_UNKNOWN".
+	 */
+	public static final int XA_PERM_TYPE_UNKNOWN = 0;
+	/**
+	 * XA_PERM_TYPE_RESET is an element of enum XAPermType. Its value is "XA_PERM_TYPE_RESET".
+	 */
+	public static final int XA_PERM_TYPE_RESET = 1;
+	/**
+	 * XA_PERM_TYPE_READ is an element of enum XAPermType. Its value is "XA_PERM_TYPE_READ".
+	 */
+	public static final int XA_PERM_TYPE_READ = 2;
+	/**
+	 * XA_PERM_TYPE_WRITE is an element of enum XAPermType. Its value is "XA_PERM_TYPE_WRITE".
+	 */
+	public static final int XA_PERM_TYPE_WRITE = 3;
+	/**
+	 * XA_PERM_TYPE_CREATE is an element of enum XAPermType. Its value is "XA_PERM_TYPE_CREATE".
+	 */
+	public static final int XA_PERM_TYPE_CREATE = 4;
+	/**
+	 * XA_PERM_TYPE_DELETE is an element of enum XAPermType. Its value is "XA_PERM_TYPE_DELETE".
+	 */
+	public static final int XA_PERM_TYPE_DELETE = 5;
+	/**
+	 * XA_PERM_TYPE_ADMIN is an element of enum XAPermType. Its value is "XA_PERM_TYPE_ADMIN".
+	 */
+	public static final int XA_PERM_TYPE_ADMIN = 6;
+	/**
+	 * XA_PERM_TYPE_OBFUSCATE is an element of enum XAPermType. Its value is "XA_PERM_TYPE_OBFUSCATE".
+	 */
+	public static final int XA_PERM_TYPE_OBFUSCATE = 7;
+	/**
+	 * XA_PERM_TYPE_MASK is an element of enum XAPermType. Its value is "XA_PERM_TYPE_MASK".
+	 */
+	public static final int XA_PERM_TYPE_MASK = 8;
+	/**
+	 * XA_PERM_TYPE_EXECUTE is an element of enum XAPermType. Its value is "XA_PERM_TYPE_EXECUTE".
+	 */
+	public static final int XA_PERM_TYPE_EXECUTE = 9;
+	/**
+	 * XA_PERM_TYPE_SELECT is an element of enum XAPermType. Its value is "XA_PERM_TYPE_SELECT".
+	 */
+	public static final int XA_PERM_TYPE_SELECT = 10;
+	/**
+	 * XA_PERM_TYPE_UPDATE is an element of enum XAPermType. Its value is "XA_PERM_TYPE_UPDATE".
+	 */
+	public static final int XA_PERM_TYPE_UPDATE = 11;
+	/**
+	 * XA_PERM_TYPE_DROP is an element of enum XAPermType. Its value is "XA_PERM_TYPE_DROP".
+	 */
+	public static final int XA_PERM_TYPE_DROP = 12;
+	/**
+	 * XA_PERM_TYPE_ALTER is an element of enum XAPermType. Its value is "XA_PERM_TYPE_ALTER".
+	 */
+	public static final int XA_PERM_TYPE_ALTER = 13;
+	/**
+	 * XA_PERM_TYPE_INDEX is an element of enum XAPermType. Its value is "XA_PERM_TYPE_INDEX".
+	 */
+	public static final int XA_PERM_TYPE_INDEX = 14;
+	/**
+	 * XA_PERM_TYPE_LOCK is an element of enum XAPermType. Its value is "XA_PERM_TYPE_LOCK".
+	 */
+	public static final int XA_PERM_TYPE_LOCK = 15;
+	/**
+	 * XA_PERM_TYPE_ALL is an element of enum XAPermType. Its value is "XA_PERM_TYPE_ALL".
+	 */
+	public static final int XA_PERM_TYPE_ALL = 16;
+
+	/**
+	 * XA_PERM_TYPE_ALL is an element of enum XAPermType. Its value is "XA_PERM_TYPE_ALLOW".
+	 */
+	public static final int XA_PERM_TYPE_ALLOW = 17;
+
+	/**
+	 * Max value for enum XAPermType_MAX
+	 */
+	public static final int XAPermType_MAX = 17;
+
+
+	/***************************************************************
+	 * Enum values for ClassTypes
+	 **************************************************************/
+	/**
+	 * CLASS_TYPE_NONE is an element of enum ClassTypes. Its value is "CLASS_TYPE_NONE".
+	 */
+	public static final int CLASS_TYPE_NONE = 0;
+	/**
+	 * CLASS_TYPE_MESSAGE is an element of enum ClassTypes. Its value is "CLASS_TYPE_MESSAGE".
+	 */
+	public static final int CLASS_TYPE_MESSAGE = 1;
+	/**
+	 * CLASS_TYPE_USER_PROFILE is an element of enum ClassTypes. Its value is "CLASS_TYPE_USER_PROFILE".
+	 */
+	public static final int CLASS_TYPE_USER_PROFILE = 2;
+	/**
+	 * CLASS_TYPE_AUTH_SESS is an element of enum ClassTypes. Its value is "CLASS_TYPE_AUTH_SESS".
+	 */
+	public static final int CLASS_TYPE_AUTH_SESS = 3;
+	/**
+	 * CLASS_TYPE_DATA_OBJECT is an element of enum ClassTypes. Its value is "CLASS_TYPE_DATA_OBJECT".
+	 */
+	public static final int CLASS_TYPE_DATA_OBJECT = 4;
+	/**
+	 * CLASS_TYPE_NAMEVALUE is an element of enum ClassTypes. Its value is "CLASS_TYPE_NAMEVALUE".
+	 */
+	public static final int CLASS_TYPE_NAMEVALUE = 5;
+	/**
+	 * CLASS_TYPE_LONG is an element of enum ClassTypes. Its value is "CLASS_TYPE_LONG".
+	 */
+	public static final int CLASS_TYPE_LONG = 6;
+	/**
+	 * CLASS_TYPE_PASSWORD_CHANGE is an element of enum ClassTypes. Its value is "CLASS_TYPE_PASSWORD_CHANGE".
+	 */
+	public static final int CLASS_TYPE_PASSWORD_CHANGE = 7;
+	/**
+	 * CLASS_TYPE_STRING is an element of enum ClassTypes. Its value is "CLASS_TYPE_STRING".
+	 */
+	public static final int CLASS_TYPE_STRING = 8;
+	/**
+	 * CLASS_TYPE_ENUM is an element of enum ClassTypes. Its value is "CLASS_TYPE_ENUM".
+	 */
+	public static final int CLASS_TYPE_ENUM = 9;
+	/**
+	 * CLASS_TYPE_ENUM_ELEMENT is an element of enum ClassTypes. Its value is "CLASS_TYPE_ENUM_ELEMENT".
+	 */
+	public static final int CLASS_TYPE_ENUM_ELEMENT = 10;
+	/**
+	 * CLASS_TYPE_RESPONSE is an element of enum ClassTypes. Its value is "CLASS_TYPE_RESPONSE".
+	 */
+	public static final int CLASS_TYPE_RESPONSE = 11;
+	/**
+	 * CLASS_TYPE_XA_ASSET is an element of enum ClassTypes. Its value is "CLASS_TYPE_XA_ASSET".
+	 */
+	public static final int CLASS_TYPE_XA_ASSET = 1000;
+	/**
+	 * CLASS_TYPE_XA_RESOURCE is an element of enum ClassTypes. Its value is "CLASS_TYPE_XA_RESOURCE".
+	 */
+	public static final int CLASS_TYPE_XA_RESOURCE = 1001;
+	/**
+	 * CLASS_TYPE_XA_GROUP is an element of enum ClassTypes. Its value is "CLASS_TYPE_XA_GROUP".
+	 */
+	public static final int CLASS_TYPE_XA_GROUP = 1002;
+	/**
+	 * CLASS_TYPE_XA_USER is an element of enum ClassTypes. Its value is "CLASS_TYPE_XA_USER".
+	 */
+	public static final int CLASS_TYPE_XA_USER = 1003;
+	/**
+	 * CLASS_TYPE_XA_GROUP_USER is an element of enum ClassTypes. Its value is "CLASS_TYPE_XA_GROUP_USER".
+	 */
+	public static final int CLASS_TYPE_XA_GROUP_USER = 1004;
+	/**
+	 * CLASS_TYPE_XA_GROUP_GROUP is an element of enum ClassTypes. Its value is "CLASS_TYPE_XA_GROUP_GROUP".
+	 */
+	public static final int CLASS_TYPE_XA_GROUP_GROUP = 1005;
+	/**
+	 * CLASS_TYPE_XA_PERM_MAP is an element of enum ClassTypes. Its value is "CLASS_TYPE_XA_PERM_MAP".
+	 */
+	public static final int CLASS_TYPE_XA_PERM_MAP = 1006;
+	/**
+	 * CLASS_TYPE_XA_AUDIT_MAP is an element of enum ClassTypes. Its value is "CLASS_TYPE_XA_AUDIT_MAP".
+	 */
+	public static final int CLASS_TYPE_XA_AUDIT_MAP = 1007;
+	/**
+	 * CLASS_TYPE_XA_CRED_STORE is an element of enum ClassTypes. Its value is "CLASS_TYPE_XA_CRED_STORE".
+	 */
+	public static final int CLASS_TYPE_XA_CRED_STORE = 1008;
+	/**
+	 * CLASS_TYPE_XA_POLICY_EXPORT_AUDIT is an element of enum ClassTypes. Its value is "CLASS_TYPE_XA_POLICY_EXPORT_AUDIT".
+	 */
+	public static final int CLASS_TYPE_XA_POLICY_EXPORT_AUDIT = 1009;
+	/**
+	 * CLASS_TYPE_TRX_LOG is an element of enum ClassTypes. Its value is "CLASS_TYPE_TRX_LOG".
+	 */
+	public static final int CLASS_TYPE_TRX_LOG = 1010;
+	/**
+	 * CLASS_TYPE_XA_ACCESS_AUDIT is an element of enum ClassTypes. Its value is "CLASS_TYPE_XA_ACCESS_AUDIT".
+	 */
+	public static final int CLASS_TYPE_XA_ACCESS_AUDIT = 1011;
+	/**
+	 * CLASS_TYPE_XA_TRANSACTION_LOG_ATTRIBUTE is an element of enum ClassTypes. Its value is "CLASS_TYPE_XA_TRANSACTION_LOG_ATTRIBUTE".
+	 */
+	public static final int CLASS_TYPE_XA_TRANSACTION_LOG_ATTRIBUTE = 1012;
+
+	/**
+	 * Max value for enum ClassTypes_MAX
+	 */
+	public static final int ClassTypes_MAX = 1012;
+
+
+
+	static public String getLabelFor_ActiveStatus( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "Disabled"; //STATUS_DISABLED
+		}
+		if( elementValue == 1 ) {
+			return "Enabled"; //STATUS_ENABLED
+		}
+		if( elementValue == 2 ) {
+			return "Deleted"; //STATUS_DELETED
+		}
+		return null;
+	}
+
+	static public String getLabelFor_ActivationStatus( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "Disabled"; //ACT_STATUS_DISABLED
+		}
+		if( elementValue == 1 ) {
+			return "Active"; //ACT_STATUS_ACTIVE
+		}
+		if( elementValue == 2 ) {
+			return "Pending Approval"; //ACT_STATUS_PENDING_APPROVAL
+		}
+		if( elementValue == 3 ) {
+			return "Pending Activation"; //ACT_STATUS_PENDING_ACTIVATION
+		}
+		if( elementValue == 4 ) {
+			return "Rejected"; //ACT_STATUS_REJECTED
+		}
+		if( elementValue == 5 ) {
+			return "Deactivated"; //ACT_STATUS_DEACTIVATED
+		}
+		if( elementValue == 6 ) {
+			return "Registration Pending"; //ACT_STATUS_PRE_REGISTRATION
+		}
+		if( elementValue == 7 ) {
+			return "No login privilege"; //ACT_STATUS_NO_LOGIN
+		}
+		return null;
+	}
+
+	static public String getLabelFor_BooleanValue( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "None"; //BOOL_NONE
+		}
+		if( elementValue == 1 ) {
+			return "True"; //BOOL_TRUE
+		}
+		if( elementValue == 2 ) {
+			return "False"; //BOOL_FALSE
+		}
+		return null;
+	}
+
+	static public String getLabelFor_DataType( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "Unknown"; //DATA_TYPE_UNKNOWN
+		}
+		if( elementValue == 1 ) {
+			return "Integer"; //DATA_TYPE_INTEGER
+		}
+		if( elementValue == 2 ) {
+			return "Double"; //DATA_TYPE_DOUBLE
+		}
+		if( elementValue == 3 ) {
+			return "String"; //DATA_TYPE_STRING
+		}
+		if( elementValue == 4 ) {
+			return "Boolean"; //DATA_TYPE_BOOLEAN
+		}
+		if( elementValue == 5 ) {
+			return "Date"; //DATA_TYPE_DATE
+		}
+		if( elementValue == 6 ) {
+			return "String enumeration"; //DATA_TYPE_STRING_ENUM
+		}
+		if( elementValue == 7 ) {
+			return "Long"; //DATA_TYPE_LONG
+		}
+		if( elementValue == 8 ) {
+			return "Integer enumeration"; //DATA_TYPE_INTEGER_ENUM
+		}
+		return null;
+	}
+
+	static public String getLabelFor_DeviceType( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "Unknown"; //DEVICE_UNKNOWN
+		}
+		if( elementValue == 1 ) {
+			return "Browser"; //DEVICE_BROWSER
+		}
+		if( elementValue == 2 ) {
+			return "iPhone"; //DEVICE_IPHONE
+		}
+		if( elementValue == 3 ) {
+			return "iPad"; //DEVICE_IPAD
+		}
+		if( elementValue == 4 ) {
+			return "iPod"; //DEVICE_IPOD
+		}
+		if( elementValue == 5 ) {
+			return "Android"; //DEVICE_ANDROID
+		}
+		return null;
+	}
+
+	static public String getLabelFor_DiffLevel( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "Unknown"; //DIFF_UNKNOWN
+		}
+		if( elementValue == 1 ) {
+			return "Low"; //DIFF_LOW
+		}
+		if( elementValue == 2 ) {
+			return "Medium"; //DIFF_MEDIUM
+		}
+		if( elementValue == 3 ) {
+			return "High"; //DIFF_HIGH
+		}
+		return null;
+	}
+
+	static public String getLabelFor_FileType( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "File"; //FILE_FILE
+		}
+		if( elementValue == 1 ) {
+			return "Directory"; //FILE_DIR
+		}
+		return null;
+	}
+
+	static public String getLabelFor_FreqType( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "None"; //FREQ_NONE
+		}
+		if( elementValue == 1 ) {
+			return "Manual"; //FREQ_MANUAL
+		}
+		if( elementValue == 2 ) {
+			return "Hourly"; //FREQ_HOURLY
+		}
+		if( elementValue == 3 ) {
+			return "Daily"; //FREQ_DAILY
+		}
+		if( elementValue == 4 ) {
+			return "Weekly"; //FREQ_WEEKLY
+		}
+		if( elementValue == 5 ) {
+			return "Bi Weekly"; //FREQ_BI_WEEKLY
+		}
+		if( elementValue == 6 ) {
+			return "Monthly"; //FREQ_MONTHLY
+		}
+		return null;
+	}
+
+	static public String getLabelFor_MimeType( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "Unknown"; //MIME_UNKNOWN
+		}
+		if( elementValue == 1 ) {
+			return "Text"; //MIME_TEXT
+		}
+		if( elementValue == 2 ) {
+			return "Html"; //MIME_HTML
+		}
+		if( elementValue == 3 ) {
+			return "png"; //MIME_PNG
+		}
+		if( elementValue == 4 ) {
+			return "jpeg"; //MIME_JPEG
+		}
+		return null;
+	}
+
+	static public String getLabelFor_NumberFormat( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "None"; //NUM_FORMAT_NONE
+		}
+		if( elementValue == 1 ) {
+			return "Numeric"; //NUM_FORMAT_NUMERIC
+		}
+		if( elementValue == 2 ) {
+			return "Alphabhet"; //NUM_FORMAT_ALPHA
+		}
+		if( elementValue == 3 ) {
+			return "Roman"; //NUM_FORMAT_ROMAN
+		}
+		return null;
+	}
+
+	static public String getLabelFor_ObjectStatus( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "Active"; //OBJ_STATUS_ACTIVE
+		}
+		if( elementValue == 1 ) {
+			return "Deleted"; //OBJ_STATUS_DELETED
+		}
+		if( elementValue == 2 ) {
+			return "Archived"; //OBJ_STATUS_ARCHIVED
+		}
+		return null;
+	}
+
+	static public String getLabelFor_PasswordResetStatus( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "Active"; //PWD_RESET_ACTIVE
+		}
+		if( elementValue == 1 ) {
+			return "Used"; //PWD_RESET_USED
+		}
+		if( elementValue == 2 ) {
+			return "Expired"; //PWD_RESET_EXPIRED
+		}
+		if( elementValue == 3 ) {
+			return "Disabled"; //PWD_RESET_DISABLED
+		}
+		return null;
+	}
+
+	static public String getLabelFor_PriorityType( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "Normal"; //PRIORITY_NORMAL
+		}
+		if( elementValue == 1 ) {
+			return "Low"; //PRIORITY_LOW
+		}
+		if( elementValue == 2 ) {
+			return "Medium"; //PRIORITY_MEDIUM
+		}
+		if( elementValue == 3 ) {
+			return "High"; //PRIORITY_HIGH
+		}
+		return null;
+	}
+
+	static public String getLabelFor_ProgressStatus( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "Pending"; //PROGRESS_PENDING
+		}
+		if( elementValue == 1 ) {
+			return "In Progress"; //PROGRESS_IN_PROGRESS
+		}
+		if( elementValue == 2 ) {
+			return "Complete"; //PROGRESS_COMPLETE
+		}
+		if( elementValue == 3 ) {
+			return "Aborted"; //PROGRESS_ABORTED
+		}
+		if( elementValue == 4 ) {
+			return "Failed"; //PROGRESS_FAILED
+		}
+		return null;
+	}
+
+	static public String getLabelFor_RelationType( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "None"; //REL_NONE
+		}
+		if( elementValue == 1 ) {
+			return "Self"; //REL_SELF
+		}
+		return null;
+	}
+
+	static public String getLabelFor_UserSource( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "Application"; //USER_APP
+		}
+		if( elementValue == 1 ) {
+			return "External"; //USER_EXTERNAL
+		}
+		/*if( elementValue == 1 ) {
+			return "Google"; //USER_GOOGLE
+		}
+		if( elementValue == 2 ) {
+			return "FaceBook"; //USER_FB
+		}*/
+		return null;
+	}
+
+	static public String getLabelFor_AssetType( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "Unknown"; //ASSET_UNKNOWN
+		}
+		if( elementValue == 1 ) {
+			return "HDFS"; //ASSET_HDFS
+		}
+		if( elementValue == 2 ) {
+			return "HBase"; //ASSET_HBASE
+		}
+		if( elementValue == 3 ) {
+			return "Hive"; //ASSET_HIVE
+		}
+		return null;
+	}
+
+	static public String getLabelFor_AccessResult( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "Denied"; //ACCESS_RESULT_DENIED
+		}
+		if( elementValue == 1 ) {
+			return "Allowed"; //ACCESS_RESULT_ALLOWED
+		}
+		return null;
+	}
+
+	static public String getLabelFor_PolicyType( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "Inclusion"; //POLICY_INCLUSION
+		}
+		if( elementValue == 1 ) {
+			return "Exclusion"; //POLICY_EXCLUSION
+		}
+		return null;
+	}
+
+	static public String getLabelFor_XAAuditType( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "Unknown"; //XA_AUDIT_TYPE_UNKNOWN
+		}
+		if( elementValue == 1 ) {
+			return "All"; //XA_AUDIT_TYPE_ALL
+		}
+		if( elementValue == 2 ) {
+			return "Read"; //XA_AUDIT_TYPE_READ
+		}
+		if( elementValue == 3 ) {
+			return "Write"; //XA_AUDIT_TYPE_WRITE
+		}
+		if( elementValue == 4 ) {
+			return "Create"; //XA_AUDIT_TYPE_CREATE
+		}
+		if( elementValue == 5 ) {
+			return "Delete"; //XA_AUDIT_TYPE_DELETE
+		}
+		if( elementValue == 6 ) {
+			return "Login"; //XA_AUDIT_TYPE_LOGIN
+		}
+		return null;
+	}
+
+	static public String getLabelFor_ResourceType( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "Unknown"; //RESOURCE_UNKNOWN
+		}
+		if( elementValue == 1 ) {
+			return "Path"; //RESOURCE_PATH
+		}
+		if( elementValue == 2 ) {
+			return "Database"; //RESOURCE_DB
+		}
+		if( elementValue == 3 ) {
+			return "Table"; //RESOURCE_TABLE
+		}
+		if( elementValue == 4 ) {
+			return "Column Family"; //RESOURCE_COL_FAM
+		}
+		if( elementValue == 5 ) {
+			return "Column"; //RESOURCE_COLUMN
+		}
+		if( elementValue == 6 ) {
+			return "VIEW"; //RESOURCE_VIEW
+		}
+		if( elementValue == 7 ) {
+			return "UDF"; //RESOURCE_UDF
+		}
+		if( elementValue == 8 ) {
+			return "View Column"; //RESOURCE_VIEW_COL
+		}
+		return null;
+	}
+
+	static public String getLabelFor_XAGroupType( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "Unknown"; //XA_GROUP_UNKNOWN
+		}
+		if( elementValue == 1 ) {
+			return "User"; //XA_GROUP_USER
+		}
+		if( elementValue == 2 ) {
+			return "Group"; //XA_GROUP_GROUP
+		}
+		if( elementValue == 3 ) {
+			return "Role"; //XA_GROUP_ROLE
+		}
+		return null;
+	}
+
+	static public String getLabelFor_XAPermForType( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "Unknown"; //XA_PERM_FOR_UNKNOWN
+		}
+		if( elementValue == 1 ) {
+			return "Permission for Users"; //XA_PERM_FOR_USER
+		}
+		if( elementValue == 2 ) {
+			return "Permission for Groups"; //XA_PERM_FOR_GROUP
+		}
+		return null;
+	}
+
+	static public String getLabelFor_XAPermType( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "Unknown"; //XA_PERM_TYPE_UNKNOWN
+		}
+		if( elementValue == 1 ) {
+			return "Reset"; //XA_PERM_TYPE_RESET
+		}
+		if( elementValue == 2 ) {
+			return "Read"; //XA_PERM_TYPE_READ
+		}
+		if( elementValue == 3 ) {
+			return "Write"; //XA_PERM_TYPE_WRITE
+		}
+		if( elementValue == 4 ) {
+			return "Create"; //XA_PERM_TYPE_CREATE
+		}
+		if( elementValue == 5 ) {
+			return "Delete"; //XA_PERM_TYPE_DELETE
+		}
+		if( elementValue == 6 ) {
+			return "Admin"; //XA_PERM_TYPE_ADMIN
+		}
+		if( elementValue == 7 ) {
+			return "Obfuscate"; //XA_PERM_TYPE_OBFUSCATE
+		}
+		if( elementValue == 8 ) {
+			return "Mask"; //XA_PERM_TYPE_MASK
+		}
+		if( elementValue == 9 ) {
+			return "Execute"; //XA_PERM_TYPE_EXECUTE
+		}
+		if( elementValue == 10 ) {
+			return "Select"; //XA_PERM_TYPE_SELECT
+		}
+		if( elementValue == 11 ) {
+			return "Update"; //XA_PERM_TYPE_UPDATE
+		}
+		if( elementValue == 12 ) {
+			return "Drop"; //XA_PERM_TYPE_DROP
+		}
+		if( elementValue == 13 ) {
+			return "Alter"; //XA_PERM_TYPE_ALTER
+		}
+		if( elementValue == 14 ) {
+			return "Index"; //XA_PERM_TYPE_INDEX
+		}
+		if( elementValue == 15 ) {
+			return "Lock"; //XA_PERM_TYPE_LOCK
+		}
+		if( elementValue == 16 ) {
+			return "All"; //XA_PERM_TYPE_ALL
+		}
+		if( elementValue == 17 ) {
+			return "Allow"; //XA_PERM_TYPE_ALLOW
+		}
+		return null;
+	}
+
+	static public String getLabelFor_ClassTypes( int elementValue ) {
+		if( elementValue == 0 ) {
+			return "None"; //CLASS_TYPE_NONE
+		}
+		if( elementValue == 1 ) {
+			return "Message"; //CLASS_TYPE_MESSAGE
+		}
+		if( elementValue == 2 ) {
+			return "User Profile"; //CLASS_TYPE_USER_PROFILE
+		}
+		if( elementValue == 3 ) {
+			return "Authentication Session"; //CLASS_TYPE_AUTH_SESS
+		}
+		if( elementValue == 4 ) {
+			return null; //CLASS_TYPE_DATA_OBJECT
+		}
+		if( elementValue == 5 ) {
+			return null; //CLASS_TYPE_NAMEVALUE
+		}
+		if( elementValue == 6 ) {
+			return null; //CLASS_TYPE_LONG
+		}
+		if( elementValue == 7 ) {
+			return null; //CLASS_TYPE_PASSWORD_CHANGE
+		}
+		if( elementValue == 8 ) {
+			return null; //CLASS_TYPE_STRING
+		}
+		if( elementValue == 9 ) {
+			return null; //CLASS_TYPE_ENUM
+		}
+		if( elementValue == 10 ) {
+			return null; //CLASS_TYPE_ENUM_ELEMENT
+		}
+		if( elementValue == 11 ) {
+			return "Response"; //CLASS_TYPE_RESPONSE
+		}
+		if( elementValue == 1000 ) {
+			return "Asset"; //CLASS_TYPE_XA_ASSET
+		}
+		if( elementValue == 1001 ) {
+			return "Resource"; //CLASS_TYPE_XA_RESOURCE
+		}
+		if( elementValue == 1002 ) {
+			return "XA Group"; //CLASS_TYPE_XA_GROUP
+		}
+		if( elementValue == 1003 ) {
+			return "XA User"; //CLASS_TYPE_XA_USER
+		}
+		if( elementValue == 1004 ) {
+			return "XA Group of Users"; //CLASS_TYPE_XA_GROUP_USER
+		}
+		if( elementValue == 1005 ) {
+			return "XA Group of groups"; //CLASS_TYPE_XA_GROUP_GROUP
+		}
+		if( elementValue == 1006 ) {
+			return "XA permissions for resource"; //CLASS_TYPE_XA_PERM_MAP
+		}
+		if( elementValue == 1007 ) {
+			return "XA audits for resource"; //CLASS_TYPE_XA_AUDIT_MAP
+		}
+		if( elementValue == 1008 ) {
+			return "XA credential store"; //CLASS_TYPE_XA_CRED_STORE
+		}
+		if( elementValue == 1009 ) {
+			return "XA Policy Export Audit"; //CLASS_TYPE_XA_POLICY_EXPORT_AUDIT
+		}
+		if( elementValue == 1010 ) {
+			return "Transaction log"; //CLASS_TYPE_TRX_LOG
+		}
+		if( elementValue == 1011 ) {
+			return "Access Audit"; //CLASS_TYPE_XA_ACCESS_AUDIT
+		}
+		if( elementValue == 1012 ) {
+			return "Transaction log attribute"; //CLASS_TYPE_XA_TRANSACTION_LOG_ATTRIBUTE
+		}
+		return null;
+	}
+
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/7defc061/security-admin/src/main/java/com/xasecure/common/XAConfigUtil.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/com/xasecure/common/XAConfigUtil.java b/security-admin/src/main/java/com/xasecure/common/XAConfigUtil.java
new file mode 100644
index 0000000..22802b8
--- /dev/null
+++ b/security-admin/src/main/java/com/xasecure/common/XAConfigUtil.java
@@ -0,0 +1,73 @@
+package com.xasecure.common;
+
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+import com.xasecure.common.PropertiesUtil;
+
+/**
+ * 
+ * 
+ */
+@Component
+public class XAConfigUtil {
+	static Logger logger = Logger.getLogger(XAConfigUtil.class);
+
+	String webappRootURL;
+	int defaultMaxRows = 250;
+	String[] roles;
+	boolean accessFilterEnabled = true;
+	boolean isModerationEnabled = false;
+	boolean isUserPrefEnabled = false;
+
+	public XAConfigUtil() {
+		webappRootURL = PropertiesUtil
+				.getProperty("xa.webapp.url.root");
+		if (webappRootURL == null || webappRootURL.trim().length() == 0) {
+			logger.error("webapp URL is not set. Please xa.webapp.url.root property");
+		}
+
+		defaultMaxRows = PropertiesUtil.getIntProperty(
+				"xa.db.maxrows.default", defaultMaxRows);
+
+		roles = PropertiesUtil
+				.getPropertyStringList("xa.users.roles.list");
+
+		accessFilterEnabled = PropertiesUtil.getBooleanProperty(
+				"xa.db.access.filter.enable", true);
+
+		isModerationEnabled = PropertiesUtil.getBooleanProperty(
+				"xa.moderation.enabled", isModerationEnabled);
+		isUserPrefEnabled = PropertiesUtil.getBooleanProperty(
+				"xa.userpref.enabled", isUserPrefEnabled);
+	}	
+
+	/**
+	 * @return the defaultMaxRows
+	 */
+	public int getDefaultMaxRows() {
+		return defaultMaxRows;
+	}
+
+	/**
+	 * @return the roles
+	 */
+	public String[] getRoles() {
+		return roles;
+	}
+
+	/**
+	 * @return the accessFilterEnabled
+	 */
+	public boolean isAccessFilterEnabled() {
+		return accessFilterEnabled;
+	}
+
+	/**
+	 * @return the webAppRootURL
+	 */
+	public String getWebAppRootURL() {
+		return webappRootURL;
+	}
+
+}


Mime
View raw message