Package systole.synchronization.remote.entities

Examples of systole.synchronization.remote.entities.SignalFrequencyRemote


        try {
            this.logger.logDebug("getting frequency remote by local frequency");
            Session currentSession = FacadeDB.getInstance().getCurrentSession();
            Criteria criteria = currentSession.createCriteria(
                    SignalFrequencyRemote.class).add(Restrictions.eq("frequency", frequency)).setMaxResults(1);
            SignalFrequencyRemote frequencyRemote = (SignalFrequencyRemote) criteria.uniqueResult();
            this.logger.logDebug("get successfully");
            return frequencyRemote;
        } catch (HibernateException e) {
            this.logger.logError("error on get remote frequency by frequency, msg: " + e.getMessage());
            throw new ExceptionDAO("No se pudieron obtener los períodos de muestreo", e.fillInStackTrace());
View Full Code Here


        try {
            this.logger.logDebug("getting last remote signal frequency sync");
            Session currentSession = FacadeDB.getInstance().getCurrentSession();
            Criteria criteria = currentSession.createCriteria(
                    SignalFrequencyRemote.class).addOrder(Order.desc("remoteId")).setMaxResults(1);
            SignalFrequencyRemote frequencyRemote = (SignalFrequencyRemote) criteria.uniqueResult();
            this.logger.logDebug("get successfully");
            return (frequencyRemote != null ? frequencyRemote.getRemoteId() : -1);
        } catch (HibernateException e) {
            this.logger.logError("error on get last remote signal frequency synchronized, msg: " + e.getMessage());
            throw new ExceptionDAO("No se pudieron obtener los períodos de muestreo", e.fillInStackTrace());
        }
    }
View Full Code Here

        try {
            this.logger.logDebug("getting signal frequency by remote id");
            Session currentSession = FacadeDB.getInstance().getCurrentSession();
            Criteria criteria = currentSession.createCriteria(
                    SignalFrequencyRemote.class).add(Restrictions.eq("remoteId", remoteId)).setMaxResults(1);
            SignalFrequencyRemote signalFrequencyRemote = (SignalFrequencyRemote) criteria.uniqueResult();
            this.logger.logDebug("get successfully");
            return (signalFrequencyRemote != null ? signalFrequencyRemote.getFrequency() : null);
        } catch (HibernateException e) {
            this.logger.logError("error on get signal frequency by remote id, msg: " + e.getMessage());
            throw new ExceptionDAO("No se pudieron obtener los períodos de muestreo", e.fillInStackTrace());
        }
    }
View Full Code Here

                SignalFrequency frequency = signalFrequenciesToUpload.next();
                SignalFrequencyWs signalFrequencyWs = this.toRemoteEntity.generateRemoteSignalFrequency(frequency);
                if (signalFrequencyWs != null) {
                    int remoteId = this.systoleSync.uploadSignalFrequency(signalFrequencyWs);
                    if (remoteId > 0) {
                        SignalFrequencyRemote signalFrequencyRemote = new SignalFrequencyRemote(frequency);
                        signalFrequencyRemote.setRemoteId(remoteId);
                        FacadeDB.getInstance().startTransaction();
                        FacadeDB.getInstance().getSignalFrequencySyncBroker().saveSignalFrequencyRemote(signalFrequencyRemote);
                        FacadeDB.getInstance().commitTransaction();
                    }
                }
View Full Code Here

        if (analysis.getMedic() != null) {
            MedicRemote medicRemote = FacadeDB.getInstance().getMedicSyncBroker().getMedicRemoteByMedic(analysis.getMedic());
            analysisWs.setMedicId(medicRemote.getRemoteId());
        }

        SignalFrequencyRemote frequencyRemote = FacadeDB.getInstance().getSignalFrequencySyncBroker().getFrequencyRemoteBySignalFrequency(analysis.getSignalFrequency());

        if (frequencyRemote == null) {
            return null;
        }

        analysisWs.setSignalFrequencyId(frequencyRemote.getRemoteId());

        ClinicalInfoRemote clinicalInfoRemote = FacadeDB.getInstance().getClinicalInfoSyncBroker().getClinicalInfoRemoteByClinicalInfo(analysis.getClinicalInformation());

        if (clinicalInfoRemote == null) {
            return null;
View Full Code Here

        if (frequency == null) {
            frequency = new SignalFrequency();
            frequency.setFrequency(new BigDecimal(signalFrequencyWs.getFrequency()));
            frequency.setDescription(signalFrequencyWs.getName());
            FacadeDB.getInstance().getSignalFrequencyBroker().insert(frequency);
            SignalFrequencyRemote frequencyRemote = new SignalFrequencyRemote(frequency);
            frequencyRemote.setRemoteId(signalFrequencyWs.getId());
            FacadeDB.getInstance().getSignalFrequencySyncBroker().saveSignalFrequencyRemote(frequencyRemote);
        } else {
            if (FacadeDB.getInstance().getSignalFrequencySyncBroker().getFrequencyRemoteBySignalFrequency(frequency) == null) {
                SignalFrequencyRemote frequencyRemote = new SignalFrequencyRemote(frequency);
                frequencyRemote.setRemoteId(signalFrequencyWs.getId());
                FacadeDB.getInstance().getSignalFrequencySyncBroker().saveSignalFrequencyRemote(frequencyRemote);
            }
        }
        FacadeDB.getInstance().commitTransaction();
    }
View Full Code Here

TOP

Related Classes of systole.synchronization.remote.entities.SignalFrequencyRemote

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.