Пример #1
0
 /**
  * @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;
 }
Пример #2
0
 /**
  * @param accountStub AccountStub
  * @return JDataSourceStub
  * @throws Exception
  */
 protected static JDataSourceStub getDataSourceStub(DataStorageStub dataStorageStub)
     throws Exception {
   String dbType = dataStorageStub.getDBType();
   JDataSourceStub DSS;
   for (int i = 0; i < DBList.size(); i++) {
     DSS = (JDataSourceStub) DBList.get(i);
     if (DSS.DataBaseType.toLowerCase().equals(dbType.toLowerCase())) return DSS;
   }
   return null;
 }