Search in sources :

Example 1 with AbstractJaxbConfigDao

use of org.opennms.core.xml.AbstractJaxbConfigDao in project opennms by OpenNMS.

the class DataCollectionConfigResource method getDataCollectionConfiguration.

@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_ATOM_XML })
public Response getDataCollectionConfiguration() throws ConfigurationResourceException {
    LOG.debug("getDatacollectionConfigurationForLocation()");
    @SuppressWarnings("unchecked") final AbstractJaxbConfigDao<DatacollectionConfig, DatacollectionConfig> dao = (AbstractJaxbConfigDao<DatacollectionConfig, DatacollectionConfig>) m_dataCollectionConfigDao;
    final DatacollectionConfig dcc = dao.getContainer().getObject();
    if (dcc == null) {
        return Response.status(Status.NOT_FOUND).build();
    }
    return Response.ok(dcc.toDataCollectionConfig()).build();
}
Also used : DatacollectionConfig(org.opennms.netmgt.config.datacollection.DatacollectionConfig) AbstractJaxbConfigDao(org.opennms.core.xml.AbstractJaxbConfigDao) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Aggregations

GET (javax.ws.rs.GET)1 Produces (javax.ws.rs.Produces)1 AbstractJaxbConfigDao (org.opennms.core.xml.AbstractJaxbConfigDao)1 DatacollectionConfig (org.opennms.netmgt.config.datacollection.DatacollectionConfig)1