Changeset 434


Ignore:
Timestamp:
01/12/11 23:25:41 (2 years ago)
Author:
philsmart
Message:
 
Location:
raptor-mua/trunk/src/main/java/uk/ac/cardiff/raptormua
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • raptor-mua/trunk/src/main/java/uk/ac/cardiff/raptormua/engine/statistics/AuthenticationStatistic.java

    r432 r434  
    254254        String tableName = ReflectionHelper.findEntrySubclassForMethod(groupByField); 
    255255        log.debug("Select {}, tableName {}",groupByField,tableName); 
    256         List results = getEntryHandler().query("select "+groupByField+",count(*) from "+tableName+" group by ("+groupByField+")"); 
     256        List results = getEntryHandler().query("select "+groupByField+",count(*) from "+tableName+" where (eventTime between '" + start + "' and '" + end + "') group by ("+groupByField+")"); 
    257257 
    258258        ArrayList<Group> groups = new ArrayList(); 
     
    306306        String tableName = ReflectionHelper.findEntrySubclassForMethod(groupByField); 
    307307        log.debug("Select {}, tableName {}",groupByField,tableName); 
    308         List results = getEntryHandler().query("select "+groupByField+" from "+tableName+" group by ("+groupByField+")"); 
     308        List results = getEntryHandler().query("select "+groupByField+" from "+tableName+" where (eventTime between '" + start + "' and '" + end + "') group by ("+groupByField+")"); 
    309309 
    310310        ArrayList<Group> groups = new ArrayList(); 
  • raptor-mua/trunk/src/main/java/uk/ac/cardiff/raptormua/service/MUAProcess.java

    r415 r434  
    3232public interface MUAProcess { 
    3333 
    34  
     34        /** 
     35         *  
     36         */ 
    3537        public void poll(); 
    3638 
     
    5961         */ 
    6062        public void addAuthentications(UAEntryPush pushed); 
     63 
     64        /** 
     65         *  
     66         * @param statisticalUnitInformation 
     67         * @return 
     68         */ 
     69        public AggregatorGraphModel updateAndInvokeStatisticalUnit(StatisticalUnitInformation statisticalUnitInformation); 
    6170} 
  • raptor-mua/trunk/src/main/java/uk/ac/cardiff/raptormua/service/impl/MUAProcessImpl.java

    r415 r434  
    3939 */ 
    4040public class MUAProcessImpl implements MUAProcess { 
     41         
     42        /* class logger */ 
    4143    static Logger log = LoggerFactory.getLogger(MUAProcessImpl.class); 
    4244 
     
    178180    } 
    179181 
     182        @Override 
     183        public AggregatorGraphModel updateAndInvokeStatisticalUnit(StatisticalUnitInformation statisticalUnitInformation) { 
     184                if (lockR.tryLock()) { 
     185                    try { 
     186                        log.info("Webservice call to update and perform statistic {}",statisticalUnitInformation.getStatisticParameters().getUnitName()); 
     187                        engine.updateStatisticalUnit(statisticalUnitInformation); 
     188                                return engine.performStatistic(statisticalUnitInformation.getStatisticParameters().getUnitName()); 
     189                    } catch (Exception e) { 
     190                                // TODO either throw as service output, or deal with here 
     191                                log.error(e.getMessage()); 
     192                                e.printStackTrace(); 
     193                    } finally { 
     194                        lockR.unlock(); 
     195                    } 
     196                } 
     197                return null; 
     198                 
     199        } 
     200 
    180201} 
  • raptor-mua/trunk/src/main/java/uk/ac/cardiff/raptormua/wsinterface/impl/MultiUnitAggregatorImpl.java

    r415 r434  
    109109        } 
    110110 
     111        @Override 
     112        public AggregatorGraphModel updateAndInvokeStatisticalUnit(StatisticalUnitInformation statisticalUnitInformation) { 
     113                return processService.updateAndInvokeStatisticalUnit(statisticalUnitInformation); 
     114        } 
     115 
    111116} 
Note: See TracChangeset for help on using the changeset viewer.