Exemple #1
0
 private static void setupExternalServices(DaoFactory factory, String gridId, File baseDir)
     throws Exception {
   baseDir = new File(new File(new File(baseDir, "grids"), gridId), "services");
   ServiceDao dao = factory.createServiceDao();
   for (File f : baseDir.listFiles(new RegexFileNameFilter("es_.*\\.json$"))) {
     ExternalService s =
         new LangridJSON(baseDir, FilenameUtil.getIdFromServiceFileName(f))
             .parse(new FileInputStream(f), ExternalService.class);
     for (ServiceAttribute a : s.getAttributes()) {
       a.setGridId(gridId);
       a.setServiceId(s.getServiceId());
     }
     for (ServiceEndpoint a : s.getServiceEndpoints()) {
       a.setGridId(gridId);
       a.setServiceId(s.getServiceId());
     }
     s.setGridId(gridId);
     dao.addService(s);
   }
 }
Exemple #2
0
 private static void clearAll(DaoFactory factory) throws Exception {
   factory.createServiceDao().clear();
   factory.createResourceDao().clear();
   factory.createUserDao().clear();
   factory.createGridDao().clear();
 }