/// <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; }
/// <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(); }
/// <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(); }
/// <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) { }
/// <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) { }
public static ILogClient CreateDefaultClient(string channelId, IChannelSubscription subscription) { return(CreateUnreliableClient(channelId, subscription)); }
public static ILogClient CreateDefaultClient(FilterBase filter, IChannelManagement manager, IChannelSubscription subscription) { return(CreateUnreliableClient(filter, manager, subscription)); }
/// <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)); }
/// <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)); }
/// <summary> /// Initialize ChannelSubscriptionService with a target /// </summary> /// <param name="target">Target to proxy</param> public ChannelSubscriptionService(IChannelSubscription target) { TargetChannelSubscription = target; }