use of org.opennms.features.reporting.model.basicreport.BasicReportDefinition in project opennms by OpenNMS.
the class DefaultRemoteRepositoryTest method getOnlineReports.
@Test
public void getOnlineReports() {
List<BasicReportDefinition> reports = m_defaultRemoteRepository.getOnlineReports();
logger.debug("getOnlineReports");
for (BasicReportDefinition report : reports) {
logger.debug(report.toString());
}
}
use of org.opennms.features.reporting.model.basicreport.BasicReportDefinition in project opennms by OpenNMS.
the class DefaultDatabaseReportListServiceTest method setupDao.
@Before
public void setupDao() throws Exception {
m_globalReportRepository = EasyMock.createNiceMock(GlobalReportRepository.class);
EasyMock.expect(m_globalReportRepository.getAllOnlineReports()).andReturn(new ArrayList<BasicReportDefinition>());
EasyMock.expect(m_globalReportRepository.getAllOnlineReports()).andReturn(new ArrayList<BasicReportDefinition>());
EasyMock.replay(m_globalReportRepository);
m_defaultDatabaseReportListService = new DefaultDatabaseReportListService();
m_defaultDatabaseReportListService.setGlobalReportRepository(m_globalReportRepository);
}
use of org.opennms.features.reporting.model.basicreport.BasicReportDefinition 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;
}
use of org.opennms.features.reporting.model.basicreport.BasicReportDefinition 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;
}
use of org.opennms.features.reporting.model.basicreport.BasicReportDefinition in project opennms by OpenNMS.
the class LegacyLocalReportRepository method getOnlineReports.
/**
* {@inheritDoc}
*/
@Override
public List<BasicReportDefinition> getOnlineReports() {
List<BasicReportDefinition> resultList = new ArrayList<>();
for (BasicReportDefinition report : m_localReportsDao.getOnlineReports()) {
BasicReportDefinition resultReport = new LegacyLocalReportDefinition();
try {
BeanUtils.copyProperties(resultReport, report);
resultReport.setId(REPOSITORY_ID + "_" + report.getId());
// Community reports are allowed by default, no permission restriction
resultReport.setAllowAccess(true);
} catch (IllegalAccessException e) {
logger.error("IllegalAccessException during BeanUtils.copyProperties for BasicReportDefinion '{}'", e.getMessage());
e.printStackTrace();
} catch (InvocationTargetException e) {
logger.error("InvocationTargetException during BeanUtils.copyProperties for BasicReportDefinion '{}'", e.getMessage());
e.printStackTrace();
}
resultList.add(resultReport);
}
return resultList;
}
Aggregations