@Path(value="/config") public class ConfigResource extends AbstractResource
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT |
configManager, jobManager, server
Constructor and Description |
---|
ConfigResource() |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
createConfig(NutchConfig newConfig)
Create new configuration.
|
void |
deleteConfig(String configId)
Removes the configuration from the list of known configurations.
|
Map<String,String> |
getConfig(String configId)
Get configuration properties
|
Set<String> |
getConfigs()
Returns a list of all configurations created.
|
String |
getProperty(String configId,
String propertyId)
Get property
|
javax.ws.rs.core.Response |
updateProperty(String confId,
String propertyKey,
String value)
Adds/Updates a particular property value in the configuration
|
throwBadRequestException
public static final String DEFAULT
@GET @Path(value="/") public Set<String> getConfigs()
@GET @Path(value="/{configId}") public Map<String,String> getConfig(@PathParam(value="configId") String configId)
configId
- The configuration ID to fetch@GET @Path(value="/{configId}/{propertyId}") @Produces(value="text/plain") public String getProperty(@PathParam(value="configId") String configId, @PathParam(value="propertyId") String propertyId)
configId
- The ID of the configurationpropertyId
- The name(key) of the property@DELETE @Path(value="/{configId}") public void deleteConfig(@PathParam(value="configId") String configId)
configId
- The ID of the configuration to delete@POST @Path(value="/create") @Consumes(value="application/json") @Produces(value="text/plain") public javax.ws.rs.core.Response createConfig(NutchConfig newConfig)
newConfig
- @PUT @Path(value="/{configId}/{propertyId}") @Consumes(value="text/plain") public javax.ws.rs.core.Response updateProperty(@PathParam(value="configId") String confId, @PathParam(value="propertyId") String propertyKey, String value)
confId
- Configuration ID whose property needs to be updated. Make sure that the given
confId exists to prevent errors.propertyKey
- Name of the propertyvalue
- Value as a simple textCopyright © 2021 The Apache Software Foundation