/** * @param accountStub AccountStub * @return DataStorageStub * @throws Exception */ protected static DataStorageStub getDataStorageStub(AccountStub accountStub) throws Exception { java.util.List dataStorageList = (List) ConfigManager.getDefault().getCfgData("StorageService", null); if (dataStorageList == null) return null; DataStorageStub dss = null; String dataStorageID = accountStub.getDataStorageId(); for (int i = 0; i < dataStorageList.size(); i++) { dss = (DataStorageStub) dataStorageList.get(i); if (dataStorageID.equals(dss.getDataStorageId())) return dss; } return null; }
/** * @param loginStub LoginStub * @return AccountStub * @throws Exception */ protected static AccountStub getAccountStub(JParamObject loginStub) throws Exception { java.util.List accountSetList = (List) ConfigManager.getDefault().getCfgData("AccountSet", null); if (accountSetList == null || accountSetList.size() == 0) return null; AccountStub accountStub = null; for (int i = 0; i < accountSetList.size(); i++) { accountStub = (AccountStub) accountSetList.get(i); if (accountStub.getDataStorageId().equals(loginStub.GetValueByEnvName("DataBaseName", null)) && accountStub.getAccountId().equals(loginStub.GetValueByEnvName("DBNO", null))) { return accountStub; } } return null; }
/** * @param ParamObject Object * @param DataObject Object * @param CustomObject Object * @param AddeitiveObject Object * @return Object */ public Object InitObject( Object ParamObject, Object DataObject, Object CustomObject, Object AddeitiveObject) { // ��ȡ��ݿ����б� java.util.List dblist = PackageStub.getContentVector("databases"); if (dblist == null) { return null; } StubObject SO = null; for (int i = 0; i < dblist.size(); i++) { SO = (StubObject) dblist.get(i); if (SO == null) { continue; } JDataSourceStub DSS = new JDataSourceStub(); DSS.DataBaseType = SO.getString("id", null); // EAI.Registry.GetElementValue(DBElement,"DataBaseType"); DSS.classname = SO.getString("class", null); // .Registry.GetElementValue(DBElement,"classname"); DSS.dbclass = SO.getString("dbclass", null); // EAI.Registry.GetElementValue(DBElement,"dbclass"); DBList.add(DSS); } return null; }