device resource api

amina year ago

hi
while im updating device i trace code,but the put method in deviceresource class(api) does not invoke .so i dont understand how it works?

Anton Tananaeva year ago

You're clearly missing something. The code should be invoked.

amina year ago

when i click save buttom , it goes to constructor of DeviceResource class, then it goes to put method in BaseObjectResource Class, after that it get back to constructor of DeviceResource class and finally it goes to get method of DeviceResourcs class. but put method in DeviceResourcs class does not invoke in this loop.

Anton Tananaeva year ago

DeviceResource does not override the PUT method, so it is correct that the implementation in BaseObjectResource is called. Sounds like everything is working as expected.

amina year ago

so what is the role of put method in DeviceResource class? isnt it api of update device?

Anton Tananaeva year ago

You mean updateAccumulators? It's to update accumulators.

amina year ago

yes exactly.

amina year ago

what is accumulators.?

Anton Tananaeva year ago

Accumulators are things that accumulate values. Currently we have distance and engine hours accumulators.

Ashok Chandraa year ago

I am also confused with DeviceResource.java there is no POST method, first I think PUT method is doing work as POST. When I removed the all PUT codes from file.I recompile and replace all files. after that add device function are working. How this possible.

Where is the code for adding device where is POST method for add device.

Amira year ago

Exactly the api address is api/devices but the invoked method in parent class

Amira year ago

The api implement in baseresource class.