public class PropertyHandler
extends java.lang.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(java.lang.String serverUri,
java.util.Map<java.lang.String,java.lang.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(java.lang.String url,
java.lang.String value,
java.lang.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 PropertyHandler(java.lang.String serverUri,
java.util.Map<java.lang.String,java.lang.Object> props)
props - - the property mappublic void addRefreshable(Refreshable refreshable)
refreshable - - an instance of Refreshablepublic void addProperty(java.lang.String url,
java.lang.String value,
java.lang.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 request