@Path(value="/config") public class ConfigResource extends AbstractResource
Modifier and Type | Field and Description |
---|---|
static java.lang.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(java.lang.String configId)
Removes the configuration from the list of known configurations.
|
java.util.Map<java.lang.String,java.lang.String> |
getConfig(java.lang.String configId)
Get configuration properties
|
java.util.Set<java.lang.String> |
getConfigs()
Returns a list of all configurations created.
|
java.lang.String |
getProperty(java.lang.String configId,
java.lang.String propertyId)
Get property
|
javax.ws.rs.core.Response |
updateProperty(java.lang.String confId,
java.lang.String propertyKey,
java.lang.String value)
Adds/Updates a particular property value in the configuration
|
throwBadRequestException
public static final java.lang.String DEFAULT
@GET @Path(value="/") public java.util.Set<java.lang.String> getConfigs()
@GET @Path(value="/{configId}") public java.util.Map<java.lang.String,java.lang.String> getConfig(@PathParam(value="configId") java.lang.String configId)
configId
- The configuration ID to fetch@GET @Path(value="/{configId}/{propertyId}") @Produces(value="text/plain") public java.lang.String getProperty(@PathParam(value="configId") java.lang.String configId, @PathParam(value="propertyId") java.lang.String propertyId)
configId
- The ID of the configurationpropertyId
- The name(key) of the property@DELETE @Path(value="/{configId}") public void deleteConfig(@PathParam(value="configId") java.lang.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") java.lang.String confId, @PathParam(value="propertyId") java.lang.String propertyKey, java.lang.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 © 2018 The Apache Software Foundation