Handling keepalive events in Java onePK

Document created by cdnadmin on Jan 25, 2014
Version 1Show Document
  • View in full screen mode
This document was generated from CDN thread

Created by: Jacoby Thwaites on 24-12-2013 06:03:44 AM
I am seeing this (correct) message appear on stderr:
1"2014880 [pool-1-thread-1] ERROR com.cisco.onep.core.event.KeepaliveMonitor - no keepalive event from network element!"
when my onePK app detects an NDE disappears.

Where should I be listening for this event (I was thinking maybe the NetworkElement application listener) so I can handle it appropriately?

Subject: RE: Handling keepalive events in Java onePK
Replied by: Einar Nilsen-Nygaard on 24-12-2013 07:01:32 AM
[font='lucida sans unicode', 'lucida grande', sans-serif]Jacoby,

Take a look in the package com.cisco.onep.element. You need to implement a ConnectionListener, which will receive ConnectionEvents. Install the listener using NetworkElement.setConnectionListener. Yeah, I know, different name pattern from all the other listeners, which are all "addXXXListener". Further, there is no remove -- you need to set it to null instead. This means there may only be one connection listener in you application.