Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [leshan-dev] use of Leshan API for notifications

Just to add on to previous question, few questions on message broker which will assist in developing north bound API's.

Does leshan publish  the messages to broker(redi) on change of events?
If so in what version it is available? what will be the list of URL the northbound needs to subscribe to get 
notifications(I assume notifications will be published to  separate url like client_new_ additions, client_update.. etc)

Any pointers on this regard will be helpful in creating the northbound API's

thanks




From: Ramakrishnan <ram_kriz@xxxxxxxxxxx>
To: "leshan-dev@xxxxxxxxxxx" <leshan-dev@xxxxxxxxxxx>
Sent: Tuesday, 10 January 2017 10:43 AM
Subject: use of Leshan API for notifications

Hi All,

I have created a sample listener on Java client side which talks to server side servlets to get the client details and the objects associated with it.

In my setup Eclipse LehanServerDemo is running @10.37.14.XX
My web application(talking to rest server) is running on 10.37.15.XX

In my rest server, I get the clients connected by running the below  code. Now how can my rest server notified when there is any new client connects to the server? or when the client updates the IPSO objects.
I dont want do any polling from the REST server or the application side to get the updates.

How can lesh server notify ?

Code:
URL url = "" URL("http://10.37.14.XX:8080/api/clients");
           URLConnection conn = url.openConnection();
           conn.setDoOutput(true);
           System.out.println("Connected");
           
                     BufferedReader in = 
               new BufferedReader( new InputStreamReader( conn.getInputStream() ) );
           
           String response;
           while ( (response = in.readLine()) != null ) {
               System.out.println( response );
           }
           in.close();



Back to the top