Package ch.tatool.data

Examples of ch.tatool.data.ModuleSession


            dataService.saveModule(module);
            return exporterError.getErrorMessage();
          }
            // update the export information
            module.getModuleProperties().put(exporterKey + "." + DataExportService.PROPERTY_LAST_EXPORT_TIMESTAMP, String.valueOf(System.currentTimeMillis()));
            ModuleSession session = dataService.getLastSession(module);
            if (session != null) {
                // should always be the case
                module.getModuleProperties().put(exporterKey + "." + DataExportService.PROPERTY_LAST_EXPORTED_SESSION, String.valueOf(session.getIndex()));
            }
            dataService.saveModule(module);
        } catch (RuntimeException ioe) {
          logger.error(ioe.getMessage(), ioe);
        }
View Full Code Here


        if (!exportConfigured(module, exporterKey)) {
            return false;
        }
       
        // nothing to export if there are no sessions
        ModuleSession session = dataService.getLastSession(module);
        if (session == null) {
            return false;
        }

        // check last exported session id with what's stored in the module
        String lastExportSessionId = module.getModuleProperties().get(exporterKey + "." + DataExportService.PROPERTY_LAST_EXPORTED_SESSION);

        if (lastExportSessionId != null && lastExportSessionId.equals(String.valueOf(session.getIndex()))) {
            return false;
        }
       
        return true;
    }
View Full Code Here

            dataService.saveModule(module);
            return exporterError.getErrorMessage();
          }
            // update the export information
            module.getModuleProperties().put(exporterKey + "." + DataExportService.PROPERTY_LAST_EXPORT_TIMESTAMP, String.valueOf(System.currentTimeMillis()));
            ModuleSession session = dataService.getLastSession(module);
            if (session != null) {
                // should always be the case
                module.getModuleProperties().put(exporterKey + "." + DataExportService.PROPERTY_LAST_EXPORTED_SESSION, String.valueOf(session.getIndex()));
            }
            dataService.saveModule(module);
        } catch (RuntimeException ioe) {
          logger.error(ioe.getMessage(), ioe);
        }
View Full Code Here

     * Creates a new module session.
     * The module start date is set immediately
     */
    public ModuleSession createSession(Module module) {
        final ModuleImpl moduleImpl = (ModuleImpl) module;
        ModuleSession moduleSession = (ModuleSession) moduleImpl.getTransactionTemplate().execute(
            new TransactionCallback() {
                public Object doInTransaction(TransactionStatus status) {
                  ModuleSession moduleSession = new ModuleSessionImpl();
                    moduleSession.setStartTime(new Date());
                    moduleImpl.getSessionDAO().saveSession(moduleImpl, moduleSession);
                    return moduleSession;
                }
            }
        );
View Full Code Here

   * Creates a new module session. The module start date is set immediately
   */
  @SuppressWarnings("unchecked")
  public ModuleSession createSession(Module module) {
    final ModuleImpl moduleImpl = (ModuleImpl) module;
    ModuleSession moduleSession = (ModuleSession) moduleImpl
        .getTransactionTemplate().execute(new TransactionCallback() {
          public Object doInTransaction(TransactionStatus status) {
            ModuleSession moduleSession = new ModuleSessionImpl();
            moduleSession.setStartTime(new Date());
            moduleSession.setCompleted(0);
            moduleImpl.getSessionDAO().saveSession(moduleImpl, moduleSession);
            return moduleSession;
          }
        });
    return moduleSession;
View Full Code Here

        if (!exportConfigured(module, exporterKey)) {
            return false;
        }
       
        // nothing to export if there are no sessions
        ModuleSession session = dataService.getLastSession(module);
        if (session == null) {
            return false;
        }

        // check last exported session id with what's stored in the module
        String lastExportSessionId = module.getModuleProperties().get(exporterKey + "." + DataExportService.PROPERTY_LAST_EXPORTED_SESSION);

        if (lastExportSessionId != null && lastExportSessionId.equals(String.valueOf(session.getIndex()))) {
            return false;
        }
       
        return true;
    }
View Full Code Here

TOP

Related Classes of ch.tatool.data.ModuleSession

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.