Receive Notifications (NETCONF)
==================================

NETCONFc notification receiver supports RFC 5277. It is capable of receiving 
all standard and user-defined NETCONF notifications.

First click the ``Notification`` button to bring up NETCONFc's new session creation dialog.

.. image:: images/notification_button.*  

Enter the server's host name or IP address, SSH user name and password etc. to
connect to the server. See more information at :ref:`New session parameters<new_connection_parameter>`.


If the connection is successful, the ``Notifications from ...`` window will be brought up.

.. image:: images/notifications_from.*  


Click the ``Start`` toolbar button. You will see ``Notification subscription`` dialog.

.. image:: images/subscription.*  


You can simply accept all default, click the ``create-subscription`` button to start receiving 
notifications from the connected server. The following screen-shot shows  some notifications have been received.

.. image:: images/view_notification.*  


If you want, you can select a specific event stream to subscribe (see details :ref:`event_stream`.). 
You can retrieve the archived notifications on the server by configuring a start-time and/or stop-time 
(see details :ref:`event_replay`). You can also supply an XML subtree filter string (see details :ref:`event_subtree`) 
or XPath filter expression (see details :ref:`event_xpath`) to have the server filter the notifications
it sends.

You can connect to multiple servers to receive notifications.

.. _event_stream:

Event streams
--------------

   On the ``subscription dialog``, click the button ``Get Stream Names``. If there are any stream names
   available for subscription, you can choose one from the ``Event streams`` dropdown list box.


.. _event_replay:

Notification replay
---------------------
   Whether to trigger the notification replay feature is indicated by if the ``start time`` parameter is specified.
   
   If start time is not present,
   this is not a replay subscription. If stop time is not present, the
   notifications will continue until the subscription is terminated.  stopTime must be
   used with startTime.
   
   Replay is the ability to create an event subscription that will
   resend recently generated notifications.
   
   A replay of notifications is specified by including the optional
   <startTime> parameter to the subscription command, which indicates
   the start time of the replay.  The end time is specified using the
   optional <stopTime> parameter.  If not present, notifications will
   continue to be sent until the subscription is terminated.

   A notification stream that supports replay is not expected to have an
   unlimited supply of saved notifications available to accommodate any
   replay request.  

   Whether or not a stream supports replay can be determined by looking at 
   the value of the <replaySupport> object in event stream details available 
   in 'RPC Request and Reply' window. It also provides the 
   <replayLogCreationTime> element to indicate
   the earliest available logged notification.
   
   
.. _event_subtree:   

Subtree filer
--------------
    An optional parameter that indicates which subset of all possible events are of interest.  
    The format of this parameter is the same as that of the filter parameter in the NETCONF  
    protocol operations.  If not present, all events not precluded by other parameters will be sent. For example
    
    ::       

        <event xmlns=\"http://example.com/event/1.0\"> 
             <eventClass>state</eventClass>
        </event>
        
.. _event_xpath:

XPath filter
-------------
    An optional parameter that indicates  which subset of all possible events
    is of interest.  The format of this parameter is the same as that of the
    filter parameter in the NETCONF  protocol operations.  If not
    present, all events not precluded by other parameters will be sent.

    For example if you enter the following xpath select expression

    ::
      /ex:event[ex:eventClass='fault' and
               (ex:severity='minor' or ex:severity='major'
                or ex:severity='critical')]

                   
                   
    Then you should set namespace and prefix as following  

    ::
        ex=>http://example.com/event/1.0   
   
    Each prefix name mapping must be on a separate line.
