Class PolicyConfigLoader
- java.lang.Object
-
- io.apiman.gateway.engine.vertx.polling.PolicyConfigLoader
-
public class PolicyConfigLoader extends Object
Load apiman policy configuration as JSON from a remote file and unmarshalls them into lists of Clients and APIs. Supports file and HTTP/S, with OAuth2 and BASIC for the latter.- Author:
- Marc Savy <marc@rhymewithgravy.com>
-
-
Constructor Summary
Constructors Constructor Description PolicyConfigLoader(io.vertx.core.Vertx vertx, URI policyConfigUri, Map<String,String> config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidload()Excepute the fetcher and load the resources.PolicyConfigLoadersetApiResultHandler(io.vertx.core.Handler<List<Api>> apiResultHandler)Set the API result handler, invoked when APIs have been unmarshalled successfully.PolicyConfigLoadersetClientResultHandler(io.vertx.core.Handler<List<Client>> clientResultHandler)Set the client result handler, invoked when Clients have been unmarshalled successfully.PolicyConfigLoadersetExceptionHandler(io.vertx.core.Handler<Throwable> exceptionHandler)Set the exception handler, invoked if an exception occurs.
-
-
-
Method Detail
-
setClientResultHandler
public PolicyConfigLoader setClientResultHandler(io.vertx.core.Handler<List<Client>> clientResultHandler)
Set the client result handler, invoked when Clients have been unmarshalled successfully.- Parameters:
clientResultHandler- the handler- Returns:
- fluent
-
setApiResultHandler
public PolicyConfigLoader setApiResultHandler(io.vertx.core.Handler<List<Api>> apiResultHandler)
Set the API result handler, invoked when APIs have been unmarshalled successfully.- Parameters:
apiResultHandler- the API result handler- Returns:
- fluent
-
setExceptionHandler
public PolicyConfigLoader setExceptionHandler(io.vertx.core.Handler<Throwable> exceptionHandler)
Set the exception handler, invoked if an exception occurs.- Parameters:
exceptionHandler- the exception handler- Returns:
- fluent
-
load
public void load()
Excepute the fetcher and load the resources.
-
-