T - Model typeE - Listener typepublic abstract class SubscribableCrudModel<T extends SubscribableCrudModel<T,E>,E extends ModelListener<T>> extends SubscribableModel<T,E>
| Modifier and Type | Field and Description |
|---|---|
private static org.slf4j.Logger |
logger
Logs actions performed by the class.
|
| Constructor and Description |
|---|
SubscribableCrudModel(String path,
ModelType type,
PathfinderServices services)
Constructs a subscribable CRUD model.
|
| Modifier and Type | Method and Description |
|---|---|
void |
connect()
Reads the model specified by the path from the server.
|
void |
create()
Creates the model at the path specified on the server.
|
protected abstract JsonObject |
createValueJson()
Returns the JSON needed to create the object on the Pathfinder server.
|
void |
delete()
Deletes the model specified by the path on the server.
|
protected void |
update(JsonObject value)
Updates the model specified by the path on the server.
|
getMessageHeader, routeSubscribe, routeUnsubscribe, subscribe, unsubscribegetChildPath, getModelType, getName, getParentCluster, getParentPath, getPath, getPathName, getServices, getThis, isConnected, isPathUnknown, notifyUpdate, route, sendMessage, setConnected, setPathName, toJson, updateFieldsaddListener, getListeners, removeListenerprivate static final org.slf4j.Logger logger
public SubscribableCrudModel(String path, ModelType type, PathfinderServices services)
path - of the model.type - of the model.services - a pathfinder services object.public void connect()
public void create()
public void delete()
protected void update(JsonObject value)
value - of the update request.protected abstract JsonObject createValueJson()