Search in sources :

Example 6 with ReportRepository

use of org.opennms.features.reporting.repository.ReportRepository in project opennms by OpenNMS.

the class DefaultDatabaseReportListService method getAll.

/**
 * <p>
 * getAll Reports from all Repositories
 * </p>
 *
 * @return a {@link java.util.List} object.
 */
@Deprecated
@Override
public List<DatabaseReportDescription> getAll() {
    List<DatabaseReportDescription> allReports = new ArrayList<>();
    for (ReportRepository globalRepository : m_globalReportRepository.getRepositoryList()) {
        for (BasicReportDefinition report : globalRepository.getReports()) {
            DatabaseReportDescription summary = new DatabaseReportDescription();
            summary.setRepositoryId(globalRepository.getRepositoryId());
            summary.setId(report.getId());
            summary.setDisplayName(report.getDisplayName());
            summary.setDescription(report.getDescription());
            summary.setIsOnline(report.getOnline());
            summary.setAllowAccess(report.getAllowAccess());
            allReports.add(summary);
        }
    }
    return allReports;
}
Also used : DatabaseReportDescription(org.opennms.web.svclayer.model.DatabaseReportDescription) ArrayList(java.util.ArrayList) GlobalReportRepository(org.opennms.features.reporting.repository.global.GlobalReportRepository) ReportRepository(org.opennms.features.reporting.repository.ReportRepository) BasicReportDefinition(org.opennms.features.reporting.model.basicreport.BasicReportDefinition)

Example 7 with ReportRepository

use of org.opennms.features.reporting.repository.ReportRepository in project opennms by OpenNMS.

the class DefaultGlobalReportRepository method getOnlineReports.

/**
 * {@inheritDoc}
 */
@Override
public List<BasicReportDefinition> getOnlineReports(String repositoryId) {
    List<BasicReportDefinition> results = new ArrayList<>();
    ReportRepository repository = this.getRepositoryById(repositoryId);
    if (repository != null) {
        results.addAll(repository.getOnlineReports());
    }
    logger.debug("getOnlineReports was called for: '{}' result: '{}'", repositoryId, results);
    return results;
}
Also used : ArrayList(java.util.ArrayList) ReportRepository(org.opennms.features.reporting.repository.ReportRepository) BasicReportDefinition(org.opennms.features.reporting.model.basicreport.BasicReportDefinition)

Example 8 with ReportRepository

use of org.opennms.features.reporting.repository.ReportRepository in project opennms by OpenNMS.

the class DefaultGlobalReportRepository method getEngine.

/**
 * {@inheritDoc}
 */
@Override
public String getEngine(String reportId) {
    String result = "";
    ReportRepository repository = this.getRepositoryForReport(reportId);
    if (repository != null) {
        result = repository.getEngine(reportId);
    }
    logger.debug("getEngine was called for: '{}' result: '{}'", reportId, result);
    return result;
}
Also used : ReportRepository(org.opennms.features.reporting.repository.ReportRepository)

Example 9 with ReportRepository

use of org.opennms.features.reporting.repository.ReportRepository in project opennms by OpenNMS.

the class DefaultGlobalReportRepository method getAllOnlineReports.

/**
 * {@inheritDoc}
 */
@Override
public List<BasicReportDefinition> getAllOnlineReports() {
    List<BasicReportDefinition> results = new ArrayList<>();
    for (ReportRepository repository : m_repositoryList) {
        results.addAll(repository.getOnlineReports());
    }
    logger.debug("getAllOnlineReports was called result: '{}'", results);
    return results;
}
Also used : ArrayList(java.util.ArrayList) ReportRepository(org.opennms.features.reporting.repository.ReportRepository) BasicReportDefinition(org.opennms.features.reporting.model.basicreport.BasicReportDefinition)

Example 10 with ReportRepository

use of org.opennms.features.reporting.repository.ReportRepository in project opennms by OpenNMS.

the class DefaultDatabaseReportListService method getActiveRepositories.

@Override
public List<ReportRepositoryDescription> getActiveRepositories() {
    List<ReportRepositoryDescription> result = new ArrayList<>();
    List<ReportRepository> reportRepositoryList = new ArrayList<>();
    reportRepositoryList = m_globalReportRepository.getRepositoryList();
    for (ReportRepository repository : reportRepositoryList) {
        ReportRepositoryDescription reportRepositoryDescription = new ReportRepositoryDescription();
        reportRepositoryDescription.setId(repository.getRepositoryId());
        reportRepositoryDescription.setDescription(repository.getRepositoryDescription());
        reportRepositoryDescription.setDisplayName(repository.getRepositoryName());
        reportRepositoryDescription.setManagementUrl(repository.getManagementUrl());
        result.add(reportRepositoryDescription);
    }
    return result;
}
Also used : ReportRepositoryDescription(org.opennms.web.svclayer.model.ReportRepositoryDescription) ArrayList(java.util.ArrayList) GlobalReportRepository(org.opennms.features.reporting.repository.global.GlobalReportRepository) ReportRepository(org.opennms.features.reporting.repository.ReportRepository)

Aggregations

ReportRepository (org.opennms.features.reporting.repository.ReportRepository)11 ArrayList (java.util.ArrayList)7 BasicReportDefinition (org.opennms.features.reporting.model.basicreport.BasicReportDefinition)6 GlobalReportRepository (org.opennms.features.reporting.repository.global.GlobalReportRepository)3 DatabaseReportDescription (org.opennms.web.svclayer.model.DatabaseReportDescription)2 InputStream (java.io.InputStream)1 ReportRepositoryDescription (org.opennms.web.svclayer.model.ReportRepositoryDescription)1