Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [leshan-dev] Retrieve Updated content monitored by Observinf a resource on client.

On further investigation I found that ObservationRegistryListener is implemented in EventServlet. Looks like the place to record updates.

 

From: Mariana Nieves <talkjoey@xxxxxxxxx>
To: "leshan-dev@xxxxxxxxxxx" <leshan-dev@xxxxxxxxxxx>
Sent: Thursday, October 22, 2015 3:08 PM
Subject: Retrieve Updated content monitored by Observinf a resource on client.

Hi

Currently I am working on proof of concept using Leshan to recieve log messages from devices on regular basis. We found that Observe request is the best way to go for this approach.
So temporarily, since we don't have a custom object yet(Wakama client not ready yet), on the server side when the client registers, I observe resource 15 on Device in LeshanClientExample.
Here is the Observe code in LeshanServer.java:
  this.clientRegistry.addListener(new ClientRegistryListener() {
   ....
   @Override
         public void registered(final Client client) {
   // TODO observe the client when it is registered.
   observeResource(client);
          }
          ....
 private void observeResource(final Client client){
        ObserveRequest request = new ObserveRequest("/3/0/15");
        LwM2mResponse cResponse = this.send(client, request);
    }
Next I want to capture the change everytime there is a change in the resource and record in a database. I see that in ObjectResource I get content that was updated (in handleGET()). Is that the correct place to retrieve updates from ?
I am trying to find out where in the codebase is the correct place to retrieve updated content ?
Your help will be highly appreciated.

Thanks
J.
         



Back to the top