Search in sources :

Example 1 with ReportRepository

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

the class DefaultGlobalReportRepository method getAllReports.

/**
 * {@inheritDoc}
 */
@Override
public List<BasicReportDefinition> getAllReports() {
    List<BasicReportDefinition> results = new ArrayList<>();
    for (ReportRepository repository : m_repositoryList) {
        results.addAll(repository.getReports());
    }
    logger.debug("getAllReports 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 2 with ReportRepository

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

the class DefaultGlobalReportRepository method getReports.

/**
 * {@inheritDoc}
 */
@Override
public List<BasicReportDefinition> getReports(String repositoryId) {
    List<BasicReportDefinition> results = new ArrayList<>();
    ReportRepository repository = this.getRepositoryById(repositoryId);
    if (repository != null) {
        results.addAll(repository.getReports());
    }
    logger.debug("getReports 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 3 with ReportRepository

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

the class DefaultGlobalReportRepository method getDisplayName.

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

Example 4 with ReportRepository

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

the class DefaultGlobalReportRepository method getReportService.

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

Example 5 with ReportRepository

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

the class DefaultGlobalReportRepository method getTemplateStream.

/**
 * {@inheritDoc}
 */
@Override
public InputStream getTemplateStream(String reportId) {
    InputStream templateStream = null;
    ReportRepository repository = this.getRepositoryForReport(reportId);
    if (repository != null) {
        templateStream = repository.getTemplateStream(reportId);
    }
    logger.debug("getTemplateStream was called for: '{}' result: '{}'", reportId, templateStream);
    return templateStream;
}
Also used : InputStream(java.io.InputStream) 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