Author Topic: Config server events  (Read 213 times)

Offline genesyslearner

  • Newbie
  • *
  • Posts: 34
  • Karma: 0
Config server events
« on: September 28, 2018, 03:25:58 PM »
Hi Experts,

I am trying to subscribe to config server events using Platform SDK (JAVA) so that we could be notified for any changes made to the config server.
I am sure that we need to user register and subscribe method of ConfService but i am struggling to use the register method for client registration.

Below is the code i could write but it is throwing me an error at the first line itself:-
                confService.register((Subscriber<ConfEvent>));
      NotificationQuery nq = new NotificationQuery();
      nq.setTenantDbid(1);
      confService.subscribe(nq);

Anys suggestions/pointers will be of great help.

Offline genesyslearner

  • Newbie
  • *
  • Posts: 34
  • Karma: 0
Re: Config server events
« Reply #1 on: October 02, 2018, 03:28:47 PM »
Hi Experts,

I was able to sort this issue. As Subscriber<ConfEvent> is an interface, i had to override the in-built methods:-

Please find below the code :-

Subscriber<ConfEvent> ce = new Subscriber<ConfEvent>() {

         @Override
         public void handle(ConfEvent ce) {
            // TODO Auto-generated method stub
            System.out.println("Subscribe person object event handler evenet type ::::: " +ce.getEventType());
            System.out.println("Subscribe person object event handler object type::::: " +ce.getObjectType());
         }

         @Override
         public Predicate<ConfEvent> getFilter() {
            // TODO Auto-generated method stub
            return null;
         }
      };
      service.register(ce);
      NotificationQuery nq = new NotificationQuery();
      nq.setTenantDbid(1);
      Subscription ss = service.subscribe(nq);

Offline genesyslearner

  • Newbie
  • *
  • Posts: 34
  • Karma: 0
Re: Config server events
« Reply #2 on: January 08, 2019, 06:27:24 PM »
Hi Experts,

I had to restart this post as i need some advanced info related to this similar post.

As of now i am getting Conf Events about :-

1.EventObjectCreated
2.EventObjectUpdated
3.EventObjectDelted

But as per the new requirement i need info on who has changed the object .i.e. username.
I couldn't get any info either from confevents or form Eventhandling methods of confserver.

Please could you suggest any solution.