Search in sources :

Example 1 with SimpleJasperReportDefinition

use of org.opennms.features.reporting.model.jasperreport.SimpleJasperReportDefinition in project opennms by OpenNMS.

the class DefaultRemoteRepository method mapSDOListToBasicReportList.

private List<BasicReportDefinition> mapSDOListToBasicReportList(List<RemoteReportSDO> remoteReportSDOList) {
    List<BasicReportDefinition> resultList = new ArrayList<>();
    for (RemoteReportSDO report : remoteReportSDOList) {
        SimpleJasperReportDefinition result = new SimpleJasperReportDefinition();
        try {
            BeanUtils.copyProperties(result, report);
            result.setId(m_remoteRepositoryDefintion.getRepositoryId() + "_" + result.getId());
        } catch (IllegalAccessException e) {
            logger.debug("SDO to BasicReport mapping IllegalAssessException while copyProperties from '{}' to '{}' with exception.", report, result);
            logger.error("SDO to BasicReport mapping IllegalAssessException while copyProperties '{}' RepositoryURI: '{}'", e, m_remoteRepositoryDefintion.getURI());
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            logger.debug("SDO to BasicReport mapping InvocationTargetException while copyProperties from '{}' to '{}' with exception.", report, result);
            logger.error("SDO to BasicReport mapping InvocationTargetException while copyProperties '{}' RepositoryURI: '{}'", e, m_remoteRepositoryDefintion.getURI());
            e.printStackTrace();
        }
        logger.debug("SDO to BasicReport mapping got: '{}'", report.toString());
        resultList.add(result);
    }
    logger.debug("SDO to BasicReport mapping returns resultList: '{}'", resultList.toString());
    return resultList;
}
Also used : RemoteReportSDO(org.opennms.features.reporting.sdo.RemoteReportSDO) ArrayList(java.util.ArrayList) SimpleJasperReportDefinition(org.opennms.features.reporting.model.jasperreport.SimpleJasperReportDefinition) BasicReportDefinition(org.opennms.features.reporting.model.basicreport.BasicReportDefinition) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Aggregations

InvocationTargetException (java.lang.reflect.InvocationTargetException)1 ArrayList (java.util.ArrayList)1 BasicReportDefinition (org.opennms.features.reporting.model.basicreport.BasicReportDefinition)1 SimpleJasperReportDefinition (org.opennms.features.reporting.model.jasperreport.SimpleJasperReportDefinition)1 RemoteReportSDO (org.opennms.features.reporting.sdo.RemoteReportSDO)1