Package org.opennms.web.rest.v1.config
Class SnmpTrapNorthbounderConfigurationResource
- java.lang.Object
-
- org.opennms.web.rest.v1.OnmsRestService
-
- org.opennms.web.rest.v1.config.SnmpTrapNorthbounderConfigurationResource
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
@Component public class SnmpTrapNorthbounderConfigurationResource extends OnmsRestService implements org.springframework.beans.factory.InitializingBean
The Class SnmpTrapNorthbounderConfigurationResource.- Author:
- Alejandro Galue
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SnmpTrapNorthbounderConfigurationResource.ImportMappings
The Class ImportMappings.static class
SnmpTrapNorthbounderConfigurationResource.SnmpTrapSinkList
The Class SnmpTrapSinkList.-
Nested classes/interfaces inherited from class org.opennms.web.rest.v1.OnmsRestService
OnmsRestService.ComparisonOperation
-
-
Field Summary
-
Fields inherited from class org.opennms.web.rest.v1.OnmsRestService
DEFAULT_LIMIT
-
-
Constructor Summary
Constructors Constructor Description SnmpTrapNorthbounderConfigurationResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
javax.ws.rs.core.Response
getConfiguration()
Gets the configuration.javax.ws.rs.core.Response
getImportMappings(String trapSinkName)
Gets the import mappings.SnmpTrapSink
getSnmpTrapSink(String trapSinkName)
Gets the SNMP trap sink.javax.ws.rs.core.Response
getSnmpTrapSinks()
Gets all the SNMP trap sinks.javax.ws.rs.core.Response
getStatus()
Gets the status.javax.ws.rs.core.Response
getStatus(Boolean enabled)
Gets the status.javax.ws.rs.core.Response
removeImportMapping(String trapSinkName, String mappingName)
Removes the import mapping.javax.ws.rs.core.Response
removeSnmpTrapSink(String trapSinkName)
Removes a specific SNMP trap sink.javax.ws.rs.core.Response
setConfiguration(SnmpTrapNorthbounderConfig config)
Sets the configuration.javax.ws.rs.core.Response
setImportMapping(String trapSinkName, SnmpTrapMappingGroup mappingGroup)
Sets an import mapping.javax.ws.rs.core.Response
setSnmpTrapSink(SnmpTrapSink snmpTrapSink)
Sets a SNMP trap sink.javax.ws.rs.core.Response
updateImportMapping(String trapSinkName, String mappingName, MultivaluedMapImpl params)
Update import mapping.javax.ws.rs.core.Response
updateSnmpTrapSink(String trapSinkName, MultivaluedMapImpl params)
Update a specific SNMP trap sink.-
Methods inherited from class org.opennms.web.rest.v1.OnmsRestService
applyQueryFilters, applyQueryFilters, getBadRequestResponse, getBeanWrapperForClass, getException, getException, getNumericValue, getRedirectUri, readLock, readUnlock, removeParameter, removeParameter, setProperties, writeLock, writeUnlock
-
-
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
getConfiguration
@GET @Produces({"application/xml","application/json","application/atom+xml"}) public javax.ws.rs.core.Response getConfiguration()
Gets the configuration.- Returns:
- the configuration
-
setConfiguration
@POST public javax.ws.rs.core.Response setConfiguration(SnmpTrapNorthbounderConfig config)
Sets the configuration.- Parameters:
config
- the full configuration object- Returns:
- the response
-
getStatus
@GET @Path("status") @Produces("text/plain") public javax.ws.rs.core.Response getStatus()
Gets the status.- Returns:
- the status
-
getStatus
@PUT @Path("status") @Produces("text/plain") public javax.ws.rs.core.Response getStatus(@QueryParam("enabled") Boolean enabled) throws javax.ws.rs.WebApplicationException
Gets the status.- Parameters:
enabled
- the enabled- Returns:
- the status
- Throws:
javax.ws.rs.WebApplicationException
- the web application exception
-
getSnmpTrapSinks
@GET @Path("trapsinks") @Produces({"application/xml","application/json","application/atom+xml"}) public javax.ws.rs.core.Response getSnmpTrapSinks()
Gets all the SNMP trap sinks.- Returns:
- the SNMP trap sinks
-
getSnmpTrapSink
@GET @Path("trapsinks/{trapsinkName}") @Produces({"application/xml","application/json","application/atom+xml"}) public SnmpTrapSink getSnmpTrapSink(@PathParam("trapsinkName") String trapSinkName)
Gets the SNMP trap sink.- Parameters:
trapSinkName
- the trap sink name- Returns:
- the SNMP trap sink
-
getImportMappings
@GET @Path("trapsinks/{trapsinkName}/import-mappings") @Produces({"application/xml","application/json","application/atom+xml"}) public javax.ws.rs.core.Response getImportMappings(@PathParam("trapsinkName") String trapSinkName)
Gets the import mappings.- Parameters:
trapSinkName
- the trap sink name- Returns:
- the import mappings
-
setSnmpTrapSink
@POST @Path("trapsinks") @Consumes({"application/xml","application/json","application/atom+xml"}) public javax.ws.rs.core.Response setSnmpTrapSink(SnmpTrapSink snmpTrapSink)
Sets a SNMP trap sink.If there is a trap sunk with the same name, the existing one will be overridden.
- Parameters:
snmpTrapSink
- the SNMP trap sink- Returns:
- the response
-
setImportMapping
@POST @Path("trapsinks/{trapsinkName}/import-mappings") @Consumes({"application/xml","application/json","application/atom+xml"}) public javax.ws.rs.core.Response setImportMapping(@PathParam("trapsinkName") String trapSinkName, SnmpTrapMappingGroup mappingGroup)
Sets an import mapping.- Parameters:
trapSinkName
- the trap sink namemappingGroup
- the mapping group- Returns:
- the response
-
updateSnmpTrapSink
@PUT @Consumes("application/x-www-form-urlencoded") @Path("trapsinks/{trapsinkName}") public javax.ws.rs.core.Response updateSnmpTrapSink(@PathParam("trapsinkName") String trapSinkName, MultivaluedMapImpl params)
Update a specific SNMP trap sink.- Parameters:
trapSinkName
- the trap sink nameparams
- the parameters map- Returns:
- the response
-
updateImportMapping
@PUT @Consumes("application/x-www-form-urlencoded") @Path("trapsinks/{trapsinkName}/import-mappings/{mappingName}") public javax.ws.rs.core.Response updateImportMapping(@PathParam("trapsinkName") String trapSinkName, @PathParam("mappingName") String mappingName, MultivaluedMapImpl params)
Update import mapping.- Parameters:
trapSinkName
- the trap sink namemappingName
- the mapping nameparams
- the parameters map- Returns:
- the response
-
removeImportMapping
@DELETE @Path("trapsinks/{trapsinkName}/import-mappings/{mappingName}") @Produces({"application/xml","application/json","application/atom+xml"}) public javax.ws.rs.core.Response removeImportMapping(@PathParam("trapsinkName") String trapSinkName, @PathParam("mappingName") String mappingName)
Removes the import mapping.- Parameters:
trapSinkName
- the trap sink namemappingName
- the mapping name- Returns:
- the response
-
removeSnmpTrapSink
@DELETE @Path("trapsinks/{trapsinkName}") @Produces({"application/xml","application/json","application/atom+xml"}) public javax.ws.rs.core.Response removeSnmpTrapSink(@PathParam("trapsinkName") String trapSinkName)
Removes a specific SNMP trap sink.- Parameters:
trapSinkName
- the trap sink name- Returns:
- the response
-
-