Skip to content

Commit 127cfbc

Browse files
authored
Merge pull request #24 from smdn/releases/Smdn.Net.MuninNode-2.3.0-1747548946
Release main/Smdn.Net.MuninNode-2.3.0
2 parents 805f911 + 5540ffd commit 127cfbc

File tree

2 files changed

+289
-9
lines changed

2 files changed

+289
-9
lines changed

doc/api-list/Smdn.Net.MuninNode/Smdn.Net.MuninNode-net8.0.apilist.cs

Lines changed: 145 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
// Smdn.Net.MuninNode.dll (Smdn.Net.MuninNode-2.2.0)
1+
// Smdn.Net.MuninNode.dll (Smdn.Net.MuninNode-2.3.0)
22
// Name: Smdn.Net.MuninNode
3-
// AssemblyVersion: 2.2.0.0
4-
// InformationalVersion: 2.2.0+04e5ff38096e4d62b2c9bc5a716d8b2c5a6ad72d
3+
// AssemblyVersion: 2.3.0.0
4+
// InformationalVersion: 2.3.0+805f911ac4e163898a8e18be3121fd9baf3a44f5
55
// TargetFramework: .NETCoreApp,Version=v8.0
66
// Configuration: Release
77
// Referenced assemblies:
88
// Microsoft.Extensions.DependencyInjection.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
99
// Microsoft.Extensions.Logging.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
1010
// Microsoft.Extensions.Options, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
11-
// Smdn.Fundamental.Exception, Version=3.0.0.0, Culture=neutral
1211
// System.Collections, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
12+
// System.Collections.Concurrent, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
1313
// System.ComponentModel, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
1414
// System.IO.Pipelines, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
1515
// System.Linq, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
@@ -28,12 +28,14 @@
2828
using System.Net;
2929
using System.Net.Sockets;
3030
using System.Text;
31+
using System.Text.RegularExpressions;
3132
using System.Threading;
3233
using System.Threading.Tasks;
3334
using Microsoft.Extensions.DependencyInjection;
3435
using Microsoft.Extensions.Logging;
3536
using Smdn.Net.MuninNode;
3637
using Smdn.Net.MuninNode.DependencyInjection;
38+
using Smdn.Net.MuninNode.Protocol;
3739
using Smdn.Net.MuninNode.Transport;
3840
using Smdn.Net.MuninPlugin;
3941

@@ -92,11 +94,13 @@ public MuninNodeOptions UseLoopbackAddress(int port) {}
9294
public abstract class NodeBase :
9395
IAsyncDisposable,
9496
IDisposable,
95-
IMuninNode
97+
IMuninNode,
98+
IMuninNodeProfile
9699
{
97100
[Obsolete("Use a constructor overload that takes IMuninNodeListenerFactory as an argument.")]
98101
protected NodeBase(IAccessRule? accessRule, ILogger? logger) {}
99102
protected NodeBase(IMuninNodeListenerFactory listenerFactory, IAccessRule? accessRule, ILogger? logger) {}
103+
protected NodeBase(IMuninProtocolHandlerFactory protocolHandlerFactory, IMuninNodeListenerFactory listenerFactory, IAccessRule? accessRule, ILogger? logger) {}
100104

101105
public virtual Encoding Encoding { get; }
102106
public EndPoint EndPoint { get; }
@@ -107,6 +111,7 @@ protected NodeBase(IMuninNodeListenerFactory listenerFactory, IAccessRule? acces
107111
protected ILogger? Logger { get; }
108112
public virtual Version NodeVersion { get; }
109113
public abstract IPluginProvider PluginProvider { get; }
114+
string IMuninNodeProfile.Version { get; }
110115

111116
public async ValueTask AcceptAsync(bool throwIfCancellationRequested, CancellationToken cancellationToken) {}
112117
public async ValueTask AcceptSingleSessionAsync(CancellationToken cancellationToken = default) {}
@@ -117,6 +122,7 @@ public void Dispose() {}
117122
public async ValueTask DisposeAsync() {}
118123
protected virtual async ValueTask DisposeAsyncCore() {}
119124
protected virtual EndPoint GetLocalEndPointToBind() {}
125+
protected virtual IMuninNodeProfile GetNodeProfile() {}
120126
public Task RunAsync(CancellationToken cancellationToken) {}
121127
[Obsolete("This method will be deprecated in the future.Use IMuninNodeListenerFactory and StartAsync instead.Make sure to override CreateServerSocket if you need to use this method.")]
122128
public void Start() {}
@@ -161,6 +167,50 @@ public static IServiceCollection AddMunin(this IServiceCollection services, Acti
161167
}
162168
}
163169

170+
namespace Smdn.Net.MuninNode.Protocol {
171+
public interface IMuninNodeProfile {
172+
Encoding Encoding { get; }
173+
string HostName { get; }
174+
IPluginProvider PluginProvider { get; }
175+
string Version { get; }
176+
}
177+
178+
public interface IMuninProtocolHandler {
179+
ValueTask HandleCommandAsync(IMuninNodeClient client, ReadOnlySequence<byte> commandLine, CancellationToken cancellationToken);
180+
ValueTask HandleTransactionEndAsync(IMuninNodeClient client, CancellationToken cancellationToken);
181+
ValueTask HandleTransactionStartAsync(IMuninNodeClient client, CancellationToken cancellationToken);
182+
}
183+
184+
public interface IMuninProtocolHandlerFactory {
185+
ValueTask<IMuninProtocolHandler> CreateAsync(IMuninNodeProfile profile, CancellationToken cancellationToken);
186+
}
187+
188+
public class MuninProtocolHandler : IMuninProtocolHandler {
189+
public MuninProtocolHandler(IMuninNodeProfile profile) {}
190+
191+
protected bool IsDirtyConfigEnabled { get; }
192+
193+
protected virtual ValueTask HandleCapCommandAsync(IMuninNodeClient client, ReadOnlySequence<byte> arguments, CancellationToken cancellationToken) {}
194+
public ValueTask HandleCommandAsync(IMuninNodeClient client, ReadOnlySequence<byte> commandLine, CancellationToken cancellationToken = default) {}
195+
protected virtual ValueTask HandleCommandAsyncCore(IMuninNodeClient client, ReadOnlySequence<byte> commandLine, CancellationToken cancellationToken) {}
196+
protected virtual ValueTask HandleConfigCommandAsync(IMuninNodeClient client, ReadOnlySequence<byte> arguments, CancellationToken cancellationToken) {}
197+
protected virtual async ValueTask HandleFetchCommandAsync(IMuninNodeClient client, ReadOnlySequence<byte> arguments, CancellationToken cancellationToken) {}
198+
protected virtual ValueTask HandleListCommandAsync(IMuninNodeClient client, ReadOnlySequence<byte> arguments, CancellationToken cancellationToken) {}
199+
protected virtual ValueTask HandleNodesCommandAsync(IMuninNodeClient client, CancellationToken cancellationToken) {}
200+
protected virtual ValueTask HandleQuitCommandAsync(IMuninNodeClient client, CancellationToken cancellationToken) {}
201+
public ValueTask HandleTransactionEndAsync(IMuninNodeClient client, CancellationToken cancellationToken = default) {}
202+
protected virtual ValueTask HandleTransactionEndAsyncCore(IMuninNodeClient client, CancellationToken cancellationToken) {}
203+
public ValueTask HandleTransactionStartAsync(IMuninNodeClient client, CancellationToken cancellationToken = default) {}
204+
protected virtual ValueTask HandleTransactionStartAsyncCore(IMuninNodeClient client, CancellationToken cancellationToken) {}
205+
protected virtual ValueTask HandleVersionCommandAsync(IMuninNodeClient client, CancellationToken cancellationToken) {}
206+
protected async ValueTask SendResponseAsync(IMuninNodeClient client, IEnumerable<string> responseLines, CancellationToken cancellationToken) {}
207+
}
208+
209+
public static class MuninProtocolHandlerFactory {
210+
public static IMuninProtocolHandlerFactory Default { get; }
211+
}
212+
}
213+
164214
namespace Smdn.Net.MuninNode.Transport {
165215
public interface IMuninNodeClient :
166216
IAsyncDisposable,
@@ -242,6 +292,52 @@ public enum PluginFieldGraphStyle : int {
242292
Stack = 2,
243293
}
244294

295+
public enum WellKnownCategory : int {
296+
AntiVirus = 2,
297+
ApplicationServer = 3,
298+
AuthenticationServer = 4,
299+
Backup = 5,
300+
Cloud = 7,
301+
ContentManagementSystem = 8,
302+
Cpu = 9,
303+
DatabaseServer = 10,
304+
DevelopmentTool = 11,
305+
Disk = 12,
306+
Dns = 13,
307+
FileSystem = 16,
308+
FileTransfer = 14,
309+
Forum = 15,
310+
GameServer = 18,
311+
HighThroughputComputing = 19,
312+
LoadBalancer = 20,
313+
Mail = 21,
314+
MailingList = 22,
315+
Memory = 23,
316+
MessagingServer = 6,
317+
Munin = 24,
318+
Network = 25,
319+
NetworkFiltering = 17,
320+
OneSec = 1,
321+
Other = 0,
322+
Printing = 26,
323+
Process = 27,
324+
Radio = 28,
325+
Search = 30,
326+
Security = 31,
327+
Sensor = 32,
328+
SpamFilter = 33,
329+
StorageAreaNetwork = 29,
330+
Streaming = 34,
331+
System = 35,
332+
TimeSynchronization = 36,
333+
Video = 37,
334+
Virtualization = 38,
335+
VoIP = 39,
336+
WebServer = 40,
337+
Wiki = 41,
338+
Wireless = 42,
339+
}
340+
245341
public sealed class AggregatePluginProvider :
246342
ReadOnlyCollection<IPluginProvider>,
247343
INodeSessionCallback,
@@ -283,10 +379,20 @@ public static IPluginField CreateField(string label, PluginFieldGraphStyle graph
283379
public static IPluginField CreateField(string label, PluginFieldGraphStyle graphStyle, PluginFieldNormalValueRange normalRangeForWarning, PluginFieldNormalValueRange normalRangeForCritical, Func<double?> fetchValue) {}
284380
public static IPluginField CreateField(string name, string label, PluginFieldGraphStyle graphStyle, PluginFieldNormalValueRange normalRangeForWarning, PluginFieldNormalValueRange normalRangeForCritical, Func<double?> fetchValue) {}
285381
public static IPluginField CreateField(string name, string label, PluginFieldGraphStyle graphStyle, PluginFieldNormalValueRange normalRangeForWarning, PluginFieldNormalValueRange normalRangeForCritical, string? negativeFieldName, Func<double?> fetchValue) {}
382+
public static IPlugin CreatePlugin(string name, IPluginGraphAttributes graphAttributes, IReadOnlyCollection<IPluginField> fields) {}
383+
public static IPlugin CreatePlugin(string name, IPluginGraphAttributes graphAttributes, IReadOnlyCollection<PluginFieldBase> fields) {}
384+
public static IPlugin CreatePlugin(string name, IPluginGraphAttributes graphAttributes, PluginFieldBase field) {}
385+
[Obsolete("Use overloads that accept IPluginGraphAttributes instead.")]
286386
public static IPlugin CreatePlugin(string name, PluginGraphAttributes graphAttributes, IReadOnlyCollection<IPluginField> fields) {}
387+
[Obsolete("Use overloads that accept IPluginGraphAttributes instead.")]
287388
public static IPlugin CreatePlugin(string name, PluginGraphAttributes graphAttributes, IReadOnlyCollection<PluginFieldBase> fields) {}
389+
[Obsolete("Use overloads that accept IPluginGraphAttributes instead.")]
288390
public static IPlugin CreatePlugin(string name, PluginGraphAttributes graphAttributes, PluginFieldBase field) {}
391+
public static IPlugin CreatePlugin(string name, string fieldLabel, Func<double?> fetchFieldValue, IPluginGraphAttributes graphAttributes) {}
392+
[Obsolete("Use overloads that accept IPluginGraphAttributes instead.")]
289393
public static IPlugin CreatePlugin(string name, string fieldLabel, Func<double?> fetchFieldValue, PluginGraphAttributes graphAttributes) {}
394+
public static IPlugin CreatePlugin(string name, string fieldLabel, PluginFieldGraphStyle fieldGraphStyle, Func<double?> fetchFieldValue, IPluginGraphAttributes graphAttributes) {}
395+
[Obsolete("Use overloads that accept IPluginGraphAttributes instead.")]
290396
public static IPlugin CreatePlugin(string name, string fieldLabel, PluginFieldGraphStyle fieldGraphStyle, Func<double?> fetchFieldValue, PluginGraphAttributes graphAttributes) {}
291397
}
292398

@@ -324,6 +430,40 @@ public PluginGraphAttributes(string title, string category, string verticalLabel
324430
public IEnumerable<string> EnumerateAttributes() {}
325431
}
326432

433+
public class PluginGraphAttributesBuilder {
434+
public static Regex RegexCategory { get; }
435+
public static Regex RegexTitle { get; }
436+
437+
public PluginGraphAttributesBuilder(string title) {}
438+
public PluginGraphAttributesBuilder(string title, PluginGraphAttributesBuilder baseBuilder) {}
439+
440+
public PluginGraphAttributesBuilder AddGraphArgument(string argument) {}
441+
public IPluginGraphAttributes Build() {}
442+
public PluginGraphAttributesBuilder ClearGraphArguments() {}
443+
public PluginGraphAttributesBuilder DisableUnitScaling() {}
444+
public PluginGraphAttributesBuilder EnableUnitScaling() {}
445+
public PluginGraphAttributesBuilder HideGraph() {}
446+
public PluginGraphAttributesBuilder ShowGraph() {}
447+
public PluginGraphAttributesBuilder WithCategory(WellKnownCategory category) {}
448+
public PluginGraphAttributesBuilder WithCategory(string category) {}
449+
public PluginGraphAttributesBuilder WithCategoryOther() {}
450+
public PluginGraphAttributesBuilder WithFieldOrder(IEnumerable<string> order) {}
451+
public PluginGraphAttributesBuilder WithFormatString(string printf) {}
452+
public PluginGraphAttributesBuilder WithGraphBinaryBase() {}
453+
public PluginGraphAttributesBuilder WithGraphDecimalBase() {}
454+
public PluginGraphAttributesBuilder WithGraphLimit(double lowerLimitValue, double upperLimitValue) {}
455+
public PluginGraphAttributesBuilder WithGraphLogarithmic() {}
456+
public PluginGraphAttributesBuilder WithGraphLowerLimit(double @value) {}
457+
public PluginGraphAttributesBuilder WithGraphRigid() {}
458+
public PluginGraphAttributesBuilder WithGraphUpperLimit(double @value) {}
459+
public PluginGraphAttributesBuilder WithHeight(int height) {}
460+
public PluginGraphAttributesBuilder WithSize(int width, int height) {}
461+
public PluginGraphAttributesBuilder WithTotal(string labelForTotal) {}
462+
public PluginGraphAttributesBuilder WithUpdateRate(TimeSpan updateRate) {}
463+
public PluginGraphAttributesBuilder WithVerticalLabel(string verticalLabel) {}
464+
public PluginGraphAttributesBuilder WithWidth(int width) {}
465+
}
466+
327467
public readonly struct PluginFieldAttributes {
328468
public PluginFieldAttributes(string label, PluginFieldGraphStyle graphStyle = PluginFieldGraphStyle.Default) {}
329469
public PluginFieldAttributes(string label, PluginFieldGraphStyle graphStyle = PluginFieldGraphStyle.Default, PluginFieldNormalValueRange normalRangeForWarning = default, PluginFieldNormalValueRange normalRangeForCritical = default) {}

0 commit comments

Comments
 (0)