Class ConfigResource

    • Constructor Detail

      • ConfigResource

        public ConfigResource()
    • Method Detail

      • getConfigs

        @GET
        @Path("/")
        public Set<String> getConfigs()
        Returns a list of all configurations created.
        Returns:
        List of configurations
      • getConfig

        @GET
        @Path("/{configId}")
        public Map<String,​String> getConfig​(@PathParam("configId")
                                                  String configId)
        Get configuration properties
        Parameters:
        configId - The configuration ID to fetch
        Returns:
        HashMap of the properties set within the given configId
      • getProperty

        @GET
        @Path("/{configId}/{propertyId}")
        @Produces("text/plain")
        public String getProperty​(@PathParam("configId")
                                  String configId,
                                  @PathParam("propertyId")
                                  String propertyId)
        Get property
        Parameters:
        configId - The ID of the configuration
        propertyId - The name(key) of the property
        Returns:
        value of the specified property in the provided configId.
      • deleteConfig

        @DELETE
        @Path("/{configId}")
        public void deleteConfig​(@PathParam("configId")
                                 String configId)
        Removes the configuration from the list of known configurations.
        Parameters:
        configId - The ID of the configuration to delete
      • createConfig

        @POST
        @Path("/create")
        @Consumes("application/json")
        @Produces("text/plain")
        public javax.ws.rs.core.Response createConfig​(NutchConfig newConfig)
        Create new configuration.
        Parameters:
        newConfig - a new populated NutchConfig
        Returns:
        The name of the new configuration created
      • updateProperty

        @PUT
        @Path("/{configId}/{propertyId}")
        @Consumes("text/plain")
        public javax.ws.rs.core.Response updateProperty​(@PathParam("configId")
                                                        String confId,
                                                        @PathParam("propertyId")
                                                        String propertyKey,
                                                        String value)
        Adds/Updates a particular property value in the configuration
        Parameters:
        confId - Configuration ID whose property needs to be updated. Make sure that the given confId exists to prevent errors.
        propertyKey - Name of the property
        value - Value as a simple text
        Returns:
        Success code