Class EmailNorthbounderConfigurationResource

  • All Implemented Interfaces:
    org.springframework.beans.factory.InitializingBean

    @Component
    public class EmailNorthbounderConfigurationResource
    extends OnmsRestService
    implements org.springframework.beans.factory.InitializingBean
    The Class EmailNorthbounderConfigurationResource.
    Author:
    Alejandro Galue
    • Constructor Detail

      • EmailNorthbounderConfigurationResource

        public EmailNorthbounderConfigurationResource()
    • Method Detail

      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws Exception
        Specified by:
        afterPropertiesSet in interface org.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​(EmailNorthbounderConfig 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
      • getEmailDestinations

        @GET
        @Path("destinations")
        @Produces({"application/xml","application/json","application/atom+xml"})
        public javax.ws.rs.core.Response getEmailDestinations()
        Gets all the email destinations.
        Returns:
        the email destinations
      • getEmailDestination

        @GET
        @Path("destinations/{destinationName}")
        @Produces({"application/xml","application/json","application/atom+xml"})
        public EmailDestination getEmailDestination​(@PathParam("destinationName")
                                                    String destinationName)
        Gets an email destination.
        Parameters:
        destinationName - the destination name
        Returns:
        the email destination
      • setEmailDestination

        @POST
        @Path("destinations")
        @Consumes({"application/xml","application/json","application/atom+xml"})
        public javax.ws.rs.core.Response setEmailDestination​(EmailDestination destination)
        Sets an email destination.

        If there is a destination with the same name, the existing one will be overridden.

        Parameters:
        destination - the destination
        Returns:
        the response
      • updateEmailDestination

        @PUT
        @Consumes("application/x-www-form-urlencoded")
        @Path("destinations/{destinationName}")
        public javax.ws.rs.core.Response updateEmailDestination​(@PathParam("destinationName")
                                                                String destinationName,
                                                                MultivaluedMapImpl params)
        Updates a specific email destination.
        Parameters:
        destinationName - the destination name
        params - the parameters map
        Returns:
        the response
      • removeEmailDestination

        @DELETE
        @Path("destinations/{destinationName}")
        @Produces({"application/xml","application/json","application/atom+xml"})
        public javax.ws.rs.core.Response removeEmailDestination​(@PathParam("destinationName")
                                                                String destinationName)
        Removes a specific email destination.
        Parameters:
        destinationName - the destination name
        Returns:
        the response