Ejemplo n.º 1
0
 /// <summary>
 /// Initializes ChannelSubscriptionTie with proxied object
 /// </summary>
 /// <param name="targetInstance">IChannelSubscription to be proxied</param>
 /// <exception cref="System.ArgumentNullException">targetInstance is null</exception>
 public ChannelSubscriptionTie(IChannelSubscription targetInstance)
 {
     if (targetInstance == null)
     {
         throw new ArgumentNullException("targetInstance");
     }
     target = targetInstance;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of SyslogUdpClient for running on a shared channel
        /// </summary>
        /// <param name="channelId">ID of channel to subscribe</param>
        /// <param name="subscription">Reference to Channel Subscriber</param>
        protected ClientBase(string channelId, IChannelSubscription subscription)
        {
            _exclusiveUsage   = false;
            ChannelId         = channelId;
            ChannelSubscriber = subscription;

            Init();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of SyslogUdpClient for running on an exclusive channel
        /// </summary>
        /// <param name="filter">Filter for exclusive channel</param>
        /// <param name="manager">Reference to Channel Manager</param>
        /// <param name="subscription">Reference to Channel Subscriber</param>
        /// <exception cref="LogbusException">Thrown when an error prevents to create a new channel</exception>
        protected ClientBase(FilterBase filter, IChannelManagement manager, IChannelSubscription subscription)
        {
            _exclusiveUsage = true;

            ChannelManager    = manager;
            ChannelSubscriber = subscription;
            _filter           = filter;

            string[]  chIdsString = manager.ListChannels();
            ArrayList channelIds  = new ArrayList(chIdsString ?? new string[0]);

            do
            {
                ChannelId = string.Format("{0}{1}", Thread.CurrentThread.GetHashCode(),
                                          Randomizer.RandomAlphanumericString(5));
            } while (channelIds.Contains(ChannelId));

            Init();
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of SyslogUdpClient for running on a shared channel
 /// </summary>
 /// <param name="channelId">ID of channel to subscribe</param>
 /// <param name="subscription">Reference to Channel Subscriber</param>
 public SyslogUdpClient(string channelId, IChannelSubscription subscription)
     : base(channelId, subscription)
 {
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of SyslogUdpClient for running on an exclusive channel
 /// </summary>
 /// <param name="filter">Filter for exclusive channel</param>
 /// <param name="manager">Reference to Channel Manager</param>
 /// <param name="subscription">Reference to Channel Subscriber</param>
 /// <exception cref="LogbusException">Thrown when an error prevents to create a new channel</exception>
 public SyslogUdpClient(FilterBase filter, IChannelManagement manager, IChannelSubscription subscription)
     : base(filter, manager, subscription)
 {
 }
Ejemplo n.º 6
0
 public static ILogClient CreateDefaultClient(string channelId, IChannelSubscription subscription)
 {
     return(CreateUnreliableClient(channelId, subscription));
 }
Ejemplo n.º 7
0
 public static ILogClient CreateDefaultClient(FilterBase filter, IChannelManagement manager,
                                              IChannelSubscription subscription)
 {
     return(CreateUnreliableClient(filter, manager, subscription));
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Creates a UDP log listener that connects to the given channel
 /// </summary>
 /// <param name="channelId">ID of already-created channel</param>
 /// <param name="subscription">Subscription endpoint</param>
 /// <returns></returns>
 public static ILogClient CreateReliableClient(string channelId, IChannelSubscription subscription)
 {
     return(new SyslogTlsClient(channelId, subscription));
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Creates a UDP log listener with the given filter
 /// </summary>
 /// <param name="manager">Management entpoint</param>
 /// <param name="subscription">Subscription endpoint</param>
 /// <param name="filter">Log filter to apply</param>
 /// <returns></returns>
 public static ILogClient CreateReliableClient(FilterBase filter, IChannelManagement manager,
                                               IChannelSubscription subscription)
 {
     return(new SyslogTlsClient(filter, manager, subscription));
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Initialize ChannelSubscriptionService with a target
 /// </summary>
 /// <param name="target">Target to proxy</param>
 public ChannelSubscriptionService(IChannelSubscription target)
 {
     TargetChannelSubscription = target;
 }