public class StatusRestService extends RestService
The service responds on /status route (can be changed) with a JSON object:
{
}
### Configuration parameters ###
### References ###
HttpEndpoint reference
### Example ###
StatusService service = new StatusService();
service.configure(ConfigParams.fromTuples(
"connection.protocol", "http",
"connection.host", "localhost",
"connection.port", 8080
));
service.open("123");
System.out.println("The Status service is accessible at http://+:8080/status");
RestService_baseRoute, _counters, _dependencyResolver, _endpoint, _logger, _server, _url| Constructor and Description |
|---|
StatusRestService()
Creates a new instance of this service.
|
| Modifier and Type | Method and Description |
|---|---|
void |
configure(org.pipservices.commons.config.ConfigParams config)
Configures component by passing configuration parameters.
|
void |
register()
Registers all service routes in HTTP endpoint.
|
void |
setReferences(org.pipservices.commons.refer.IReferences references)
Sets references to dependent components.
|
close, getBodyAsJson, getBodyAsString, getQueryParameter, instrument, isOpen, open, registerResource, registerRoute, sendCreatedResult, sendDeleted, sendEmptyResult, sendError, sendResult, unsetReferencespublic StatusRestService()
public void configure(org.pipservices.commons.config.ConfigParams config)
throws org.pipservices.commons.errors.ConfigException
configure in interface org.pipservices.commons.config.IConfigurableconfigure in class RestServiceconfig - configuration parameters to be set.org.pipservices.commons.errors.ConfigException - when configuration is wrong.public void setReferences(org.pipservices.commons.refer.IReferences references)
throws org.pipservices.commons.refer.ReferenceException,
org.pipservices.commons.errors.ConfigException
setReferences in interface org.pipservices.commons.refer.IReferenceablesetReferences in class RestServicereferences - references to locate the component dependencies.org.pipservices.commons.refer.ReferenceException - when no found references.org.pipservices.commons.errors.ConfigException - when configuration is wrong.public void register()
Copyright © 2018. All rights reserved.