public class Concierge extends io.dropwizard.Application<ApiGatewayConfiguration>
Concierge will help you to create an API gateway easily.
The idea is pretty simple. We defined a resource identifier pattern which you can learn in the documentation of the
ResourceIdentifier. As you will learn, there are three kinds of resources:
elementsgroupsextensionsresolvers.
There are GroupResolver to resolve elements, and
ExtensionResolver to resolve extensions for elements.
These resolvers will be dynamically created by the configuration specified in start(URL).
As this implementation is based on Dropwizard, you can
learn more about the configuration file format in their
user manual.
The additional properties for the configuration file are defined in ApiGatewayConfiguration. Basically
these properties are list of class names for the resolver implementations you want to use.
You'll find an example implementation on GitHub.| Constructor and Description |
|---|
Concierge() |
| Modifier and Type | Method and Description |
|---|---|
void |
run(ApiGatewayConfiguration configuration,
io.dropwizard.setup.Environment environment) |
static Concierge |
start(java.net.URL configurationFile)
Starts the concierge web server with the specified configuration.
|
void |
stop()
Stops this concierge web server instance.
|
public void run(ApiGatewayConfiguration configuration, io.dropwizard.setup.Environment environment) throws java.lang.Exception
run in class io.dropwizard.Application<ApiGatewayConfiguration>java.lang.Exceptionpublic static Concierge start(java.net.URL configurationFile) throws java.lang.Exception
configurationFile - the configuration file URLjava.lang.Exception - thrown on any exceptionpublic void stop()
throws java.lang.Exception
java.lang.IllegalStateException - if the server wasn't startedjava.lang.Exception