/**
* 校验用户、密码、TenantID正确性
*
* @param userID
* @param Password
* @param TenantID
* @return Boolean
*/
public static Boolean checkPassword(String userID, String Password,
String TenantID) {
log.info("check Password begin...");
String sql = FileManager.getESBProperty("CHECK_PASSWORD_SQL");
ArrayList<String> param = new ArrayList<String>();
param.add(userID);
param.add(Password);
param.add(TenantID);
ArrayList<HashMap<String, String>> rtnList = DBAccess.execQuerySQL(sql,
param);
log.info("check Password successed");
return rtnList.size() > 0;
}
/**
* 校验用户/TenantID能否访问当前功能
*
* @param userID
* @param operation
* @return Boolean
*/
public static Boolean checkAccess(String userID, String operation) {
log.info("check Access begin...");
String sql = FileManager.getESBProperty("CHECK_ACCESS_SQL");
ArrayList<String> param = new ArrayList<String>();
param.add(userID);
param.add(operation);
ArrayList<HashMap<String, String>> rtnList = DBAccess.execQuerySQL(sql,
param);
log.info("check Access successed");
return rtnList.size() > 0;
}
public static void main(String[] args) throws Exception {
// 测试代码注释掉
long a = System.currentTimeMillis();
// System.out.println(getEsbSeq());
// System.out.println(getProcessSeq());
StringBuffer buf = new StringBuffer();
String line;
java.io.File file = new java.io.File("D:\\text.xml");
java.io.InputStream in = new java.io.FileInputStream(file);
java.io.BufferedReader reader = new java.io.BufferedReader(
new java.io.InputStreamReader(in));
while ((line = reader.readLine()) != null) {
buf.append(line).append("\n");
}
reader.close();
in.close();
writeEsb(buf.toString());
System.out.println(System.currentTimeMillis() - a);
}
}