class HrrRbNetconf::Server::NotificationStreams
Public Class Methods
new()
click to toggle source
# File lib/hrr_rb_netconf/server/notification_streams.rb, line 9 def initialize @streams = Hash.new @streams['NETCONF'] = NotificationStream.new(Proc.new { true }, false) end
Public Instance Methods
event_match_stream?(event_xml, stream)
click to toggle source
# File lib/hrr_rb_netconf/server/notification_streams.rb, line 34 def event_match_stream? event_xml, stream @streams[stream].match? event_xml end
has_stream?(stream)
click to toggle source
# File lib/hrr_rb_netconf/server/notification_streams.rb, line 14 def has_stream? stream @streams.has_key? stream end
matched_streams(event_xml)
click to toggle source
# File lib/hrr_rb_netconf/server/notification_streams.rb, line 30 def matched_streams event_xml @streams.select{ |k, v| v.match? event_xml }.keys end
stream_support_replay?(stream)
click to toggle source
# File lib/hrr_rb_netconf/server/notification_streams.rb, line 18 def stream_support_replay? stream @streams[stream].support_replay? end
update(stream, blk, replay_support)
click to toggle source
# File lib/hrr_rb_netconf/server/notification_streams.rb, line 22 def update stream, blk, replay_support if blk.nil? && (! @streams.has_key?( stream )) raise ArgumentError, "Requires block for new stream: #{stream}" end blk ||= @streams[stream].blk @streams[stream] = NotificationStream.new(blk, replay_support) end