-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Callback on deletion in LwM2mInstanceEnabler #637
Comments
You are implementing a I'm afraid there is nothing like this for now, but this could be a good improvement. Waiting something like this was implementing (or contributing) you can create your own |
Maybe the easiest way could be implementing a setter in ObjectsInitializer.class with the ObjectEnabler for the object as a parameter. |
If you create your own Just add it to the collection manually : initializer.setClassForObject(DEVICE, MyDevice.class);
initializer.setInstancesForObject(LOCATION, locationInstance);
// .... ....
List<LwM2mObjectEnabler> enablers = initializer.create(SECURITY, SERVER, DEVICE, LOCATION);
// add your custom LwM2mObjectEnabler
enablers.add(new MyCustomObjectEnabler());
LeshanClientBuilder builder = new LeshanClientBuilder(endpoint);
builder.setObjects(enablers);
builder.build(); Just to know, is adding a onDelete() method on |
Yes, that would solve my problem |
I created a PR #641 to add |
#641 is now integrated in master so we can close this issue. |
Hi guys,
first, thank you for your effort :)
We are working in a use case using both client and server. We are trying to disable an external component in the device when an instance is deleted, but I wasn't able to find any kind of callback or class for that without importing and adapting leshan-client-core and leshan-client-cf. A solution is reached modifying ObjectEnabler.class create and delete methods.
Is there any other way to handle these events?
The text was updated successfully, but these errors were encountered: