Package org.jboss.dashboard.provider

Examples of org.jboss.dashboard.provider.DataProvider


    }

    public List<DataProvider> getSelectedDataProviders() throws Exception {
        List<DataProvider> results = new ArrayList<DataProvider>();
        for (KPI kpi: getSelectedKPIs()) {
            DataProvider dp = kpi.getDataProvider();
            if (!results.contains(dp)) results.add(dp);
        }
        final Locale l = LocaleManager.currentLocale();
        Collections.sort(results, new Comparator() {
            public int compare(Object o1, Object o2) {
                DataProvider s1 = (DataProvider) o1;
                DataProvider s2 = (DataProvider) o2;
                return s1.getDescription(l).compareTo(s2.getDescription(l));
            }
        });
        return results;
    }
View Full Code Here


    /**
     * @throws DataSetException In case any it doesn't meet the thresholds set.
     */
    public void validate() throws Exception {
        DataSet dataSet = dataSetRef.get();
        DataProvider dataProvider = dataSet.getDataProvider();
        if (dataProvider == null) return;

        MemoryProfiler memoryProfiler = MemoryProfiler.lookup().freeMemory();
        long memoryUsed = memoryProfiler.getMemoryUsedInBytes() - startMemory;
        long elapsedTime = System.currentTimeMillis() - startTime;
        long sizeInBytes = dataSet.sizeOf();
        long maxSize = dataProvider.getDataLoader().getMaxDataSetSizeInBytes();
        long maxTime = dataProvider.getDataLoader().getMaxDataSetLoadTimeInMillis();
        long maxMemUsed = dataProvider.getDataLoader().getMaxMemoryUsedInDataLoad();

        if (maxMemUsed > 0 && memoryUsed > maxMemUsed) {
            String total = MemoryProfiler.formatSize(maxMemUsed);
            throw new DataSetException("Data set load memory usage has been exceeded = " + total);
        }
View Full Code Here

    /**
     * @throws DataSetException In case any it doesn't meet the thresholds set.
     */
    public void validate() throws Exception {
        DataSet dataSet = dataSetRef.get();
        DataProvider dataProvider = dataSet.getDataProvider();
        if (dataProvider == null) return;

        long elapsedTime = System.currentTimeMillis() - startTime;
        long maxTime = dataProvider.getDataLoader().getMaxDataSetSortTimeInMillis();

        if (maxTime > 0 && elapsedTime > maxTime) {
            String time = Chronometer.formatElapsedTime(maxTime);
            throw new DataSetException("Data set sort time has been exceeded = " + time);
        }
View Full Code Here

    /**
     * @throws DataSetException In case any it doesn't meet the thresholds set.
     */
    public void validate() throws Exception {
        DataSet dataSet = dataSetRef.get();
        DataProvider dataProvider = dataSet.getDataProvider();
        if (dataProvider == null) return;

        long elapsedTime = System.currentTimeMillis() - startTime;
        long maxTime = dataProvider.getDataLoader().getMaxDataSetFilterTimeInMillis();

        if (maxTime > 0 && elapsedTime > maxTime) {
            String time = Chronometer.formatElapsedTime(maxTime);
            throw new DataSetException("Data set filter time has been exceeded = " + time);
        }
View Full Code Here

    /**
     * @throws DataSetException In case any it doesn't meet the thresholds set.
     */
    public void validate() throws Exception {
        DataSet dataSet = dataSetRef.get();
        DataProvider dataProvider = dataSet.getDataProvider();
        if (dataProvider == null) return;

        long elapsedTime = System.currentTimeMillis() - startTime;
        long maxTime = dataProvider.getDataLoader().getMaxDataSetGroupTimeInMillis();

        if (maxTime > 0 && elapsedTime > maxTime) {
            String time = Chronometer.formatElapsedTime(maxTime);
            throw new DataSetException("Data set group-by time has been exceeded = " + time);
        }
View Full Code Here

            if (staticProps != null) results.addAll(Arrays.asList(staticProps));

            // Dynamic properties.
            Iterator it = getDashboard().getDataProviders().iterator();
            while (it.hasNext()) {
                DataProvider dataProvider = (DataProvider) it.next();
                DataProperty[] properties = dataProvider.getDataSet().getProperties();
                for (int i = 0; i < properties.length; i++) {
                    DataProperty property = properties[i];
                    results.add(new DashboardFilterProperty(property, this));
                }
            }
View Full Code Here

    }

    public DataProvider getDataProviderByCode(String code) {
        if (code == null) return null;
        for (Object o : getDataProviders()) {
            DataProvider p = (DataProvider) o;
            if (code.equals(p.getCode())) return p;
        }
        return null;
    }
View Full Code Here

        }
    }

    protected void filter() throws Exception {
        for (Object o : getDataProviders()) {
            DataProvider provider = (DataProvider) o;
            provider.filterDataSet(dashboardFilter);
        }
    }
View Full Code Here

    }

    public DataProperty getDataProperty() {
        if (isStaticProperty()) return null;
        try {
            DataProvider provider = filter.getDashboard().getDataProviderByCode(dataProviderCode);
            if (provider != null) return provider.getDataSet().getPropertyById(propertyId);
            return null;
        } catch (Exception e) {
            log.error("Cannot get property " + propertyId + " from data provider with code " + dataProviderCode);
            return null;
        }
View Full Code Here

            if (staticProps != null) results.addAll(Arrays.asList(staticProps));

            // Dynamic properties.
            Iterator it = getDashboard().getDataProviders().iterator();
            while (it.hasNext()) {
                DataProvider dataProvider = (DataProvider) it.next();
                DataProperty[] allProperties = dataProvider.getDataSet().getProperties();
                for (int i = 0; i < allProperties.length; i++) {
                    DataProperty property = allProperties[i];
                    DashboardFilterProperty prop = getDashboardFilterPropertyForCurrentFilter(dataProvider.getCode(), property.getPropertyId());
                    if (prop == null) prop = new DashboardFilterProperty(dataProvider.getCode(), property.getPropertyId(), getFilter() ,null, false);
                    results.add(prop);
                }
            }
        } catch (Exception e) {
            log.error("Cannot get data provider results.", e);
View Full Code Here

TOP

Related Classes of org.jboss.dashboard.provider.DataProvider

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.