eclipse / org.eclipse.sensinact.gateway

Eclipse Public License 2.0
6 stars 12 forks source link

Implement model deletion in the Model Manager #406

Closed timothyjward closed 1 month ago

timothyjward commented 1 month ago

The model manager API provides a deletion method, but this was not implemented. This commit implements deletion logic, which delegates to the Model Nexus. The Model Nexus:

  1. Finds the Model
  2. If found it deletes any and all providers using the model, then it deletes the model from its owning EPackage
  3. If the EPackage is now empty of models then the EPackage is removed from the Model Nexus

The ModelImpl has also been updated to check the the model is still registered before allowing any action. This prevents deleted models from being used after they are deleted.