public class DelegateHandler extends Object implements org.swisspush.gateleen.core.refresh.Refreshable, org.swisspush.gateleen.core.logging.LoggableResource
definition within the specified
delegate.PUT /gateleen/server/delegate/v1/delegates/user-zip-copy/definition
{
"methods": [ "PUT", "DELETE" ],
"pattern": "([^/]*)/(.*)",
"requests": [
{
"headers" : [],
"uri": "/gateleen/server/copy",
"method": "POST",
"payload": {
"source": "/gateleen/$1?expand=100&zip=true",
"destination": "/gateleen/zips/users/$1.zip"
}
}
]
}
To trigger an execution, it suffice to perform a PUT request on the virtual collection execution within
the specified delegate.PUT /gateleen/server/delegate/v1/delegates/user-zip-copy/execution/<...>| Constructor and Description |
|---|
DelegateHandler(io.vertx.core.Vertx vertx,
io.vertx.core.http.HttpClient selfClient,
org.swisspush.gateleen.core.storage.ResourceStorage delegateStorage,
org.swisspush.gateleen.monitoring.MonitoringHandler monitoringHandler,
String delegatesUri,
Map<String,Object> properties,
io.vertx.core.Handler<Void> doneHandler)
Creates a new instance of the DelegateHandler.
|
| Modifier and Type | Method and Description |
|---|---|
void |
enableResourceLogging(boolean resourceLoggingEnabled) |
protected String |
getDelegateName(String uri)
Tries to extract the name of the delegate out
of the incoming uri.
|
boolean |
handle(io.vertx.core.http.HttpServerRequest request)
Checks if the DelegateHandler is responsible for this request.
|
void |
init()
This method initializes the Handler.
|
void |
refresh() |
public DelegateHandler(io.vertx.core.Vertx vertx,
io.vertx.core.http.HttpClient selfClient,
org.swisspush.gateleen.core.storage.ResourceStorage delegateStorage,
org.swisspush.gateleen.monitoring.MonitoringHandler monitoringHandler,
String delegatesUri,
Map<String,Object> properties,
io.vertx.core.Handler<Void> doneHandler)
vertx - vertxselfClient - selfClientdelegateStorage - delegateStorage - only used for storing delegatesmonitoringHandler - monitoringHandlerdelegatesUri - delegate rootproperties - propertiesdoneHandler - doneHandlerpublic void init()
protected String getDelegateName(String uri)
uri - original request uripublic boolean handle(io.vertx.core.http.HttpServerRequest request)
request - original requestpublic void refresh()
refresh in interface org.swisspush.gateleen.core.refresh.Refreshablepublic void enableResourceLogging(boolean resourceLoggingEnabled)
enableResourceLogging in interface org.swisspush.gateleen.core.logging.LoggableResourceCopyright © 2016–2018. All rights reserved.