public class PropertyHandler extends Object
// Create a new instance
PropertyHandler pHandler = new PropertyHandler(props);
// Register refreshables
pHandler.addRefreshable(refreshable)
// Add a property
pHandler.addProperty("/car/v1/id","carId", "car.id")
// Update the property 'car.id'
PUT /car/v1/id
{
"carId" : "mynewValue"
}
| Constructor and Description |
|---|
PropertyHandler(String serverUri,
Map<String,Object> props)
Creates a new instance of the PropertyHandler with the
given property store as a parameter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addProperty(String url,
String value,
String propertyName)
Assigns the property name to an id value of a given url.
|
void |
addRefreshable(Refreshable refreshable)
Adds a new Refreshable.
|
boolean |
handle(io.vertx.core.http.HttpServerRequest request)
Checks if the request must be handeld by the PropertyHandler.
|
public void addRefreshable(Refreshable refreshable)
refreshable - - an instance of Refreshablepublic void addProperty(String url, String value, String propertyName)
addProperty("/vehicle/v1/id", "identityId", "identity.id")
addProperty("/vehicle/v1/id", "vehicleId", "vehicle.id")
url - value - propertyName - public boolean handle(io.vertx.core.http.HttpServerRequest request)
true otherwise it will be false.request - - the original requestCopyright © 2016–2020. All rights reserved.