Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
16898d3
test(http-tests): pin multicast isolation across all client events
ottobolyos Jun 3, 2026
ee77635
fix(http): isolate every event multicast across the HTTP client
ottobolyos Jun 3, 2026
1fc10dd
test(http-tests): pin multicast isolation across non-generic events
ottobolyos Jun 3, 2026
e905efb
fix(http): extend event-multicast isolation to non-generic handlers
ottobolyos Jun 3, 2026
2350902
test(http-tests): pin multicast isolation across sub-client raise sites
ottobolyos Jun 3, 2026
d6417cc
fix(http): isolate multicast across every sub-client raise site
ottobolyos Jun 3, 2026
3bb8cdd
test(http-tests): close over the open generic RaiseEvent helper befor…
ottobolyos Jun 3, 2026
d735b1a
docs(http-tests): scrub BrE behaviour to AmE in test XML docs
ottobolyos Jun 3, 2026
981dd4c
test(common-tests): pin shared multicast isolation contract
ottobolyos Jun 3, 2026
c061044
feat(common): add shared multicast isolation helper for events
ottobolyos Jun 3, 2026
966212c
refactor(http): migrate HTTP clients to shared multicast helper
ottobolyos Jun 3, 2026
cdfd55e
test(http-tests): drive sub-client tests through shared helper
ottobolyos Jun 3, 2026
64e39f1
test(common-tests): pin multicast isolation on MQTT client events
ottobolyos Jun 3, 2026
cd46a80
test(shdr-tests): pin multicast isolation on SHDR adapter and client …
ottobolyos Jun 3, 2026
30fb578
test(common-tests): pin multicast isolation on agent and broker events
ottobolyos Jun 3, 2026
bd96d5b
test(http-tests): pin multicast isolation on HTTP server events
ottobolyos Jun 3, 2026
4385fa7
style(shdr-tests,common-tests,http-tests): fix nullable annotations i…
ottobolyos Jun 3, 2026
63c4749
fix(mqtt): migrate MQTT client events to shared multicast helper
ottobolyos Jun 3, 2026
eac46ff
fix(shdr): migrate SHDR adapter and client events to shared multicast…
ottobolyos Jun 3, 2026
1aa184d
fix(common): migrate agent and broker EventHandler events to shared m…
ottobolyos Jun 3, 2026
ece9b7a
fix(http): migrate HTTP server events to shared multicast helper
ottobolyos Jun 3, 2026
785eea8
feat(common): add generic delegate overload to MulticastIsolation
ottobolyos Jun 3, 2026
d5782b8
test(common-tests): pin generic-delegate overload of MulticastIsolation
ottobolyos Jun 3, 2026
be2bb92
test(common-tests): pin multicast isolation on DeviceFinder and PingQ…
ottobolyos Jun 3, 2026
cf6cc13
test(common-tests): pin multicast isolation on agent and broker custo…
ottobolyos Jun 3, 2026
ae09d95
fix(device-finder): apply multicast isolation to custom-delegate events
ottobolyos Jun 3, 2026
02c8b52
fix(common): apply multicast isolation to MTConnectAgent custom-deleg…
ottobolyos Jun 3, 2026
57ab68e
fix(common): apply multicast isolation to MTConnectAgentBroker custom…
ottobolyos Jun 3, 2026
2eaf5d7
docs(common-tests): disambiguate Raise cref between overloads
ottobolyos Jun 3, 2026
6a32532
test(http-tests): repush availability until SampleReceived fires
ottobolyos Jun 4, 2026
7b4369e
refactor(common): expose MulticastIsolation.Raise as extension methods
ottobolyos Jun 6, 2026
20e61fc
refactor(http-clients): adopt extension-method Raise syntax
ottobolyos Jun 6, 2026
7250895
refactor(http-servers): adopt extension-method Raise syntax
ottobolyos Jun 6, 2026
9778845
refactor(mqtt): adopt extension-method Raise syntax
ottobolyos Jun 6, 2026
0b0477e
refactor(shdr): adopt extension-method Raise syntax
ottobolyos Jun 6, 2026
25b10d8
refactor(agents): adopt extension-method Raise syntax
ottobolyos Jun 6, 2026
5801ec1
test(multicast-isolation): adopt extension-method Raise syntax
ottobolyos Jun 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 19 additions & 27 deletions libraries/MTConnect.NET-Common/Agents/MTConnectAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ private Device NormalizeDevice(IDevice device)
var validationResults = new ValidationResult(false, $"Invalid Component : \"{genericComponent.Type}\" Not Found");
if (_configuration.InputValidationLevel > InputValidationLevel.Ignore)
{
if (InvalidComponentAdded != null) InvalidComponentAdded.Invoke(obj.Uuid, genericComponent, validationResults);
MulticastIsolation.Raise(InvalidComponentAdded, h => h(obj.Uuid, genericComponent, validationResults));

// Remove Component from Device
if (_configuration.InputValidationLevel == InputValidationLevel.Remove) obj.RemoveComponent(genericComponent.Id);
Expand All @@ -1334,7 +1334,7 @@ private Device NormalizeDevice(IDevice device)
var validationResults = new ValidationResult(false, $"Invalid Composition : \"{genericComposition.Type}\" Not Found");
if (_configuration.InputValidationLevel > InputValidationLevel.Ignore)
{
if (InvalidCompositionAdded != null) InvalidCompositionAdded.Invoke(obj.Uuid, genericComposition, validationResults);
MulticastIsolation.Raise(InvalidCompositionAdded, h => h(obj.Uuid, genericComposition, validationResults));

// Remove Compsition from Device
if (_configuration.InputValidationLevel == InputValidationLevel.Remove) obj.RemoveComposition(genericComposition.Id);
Expand All @@ -1354,7 +1354,7 @@ private Device NormalizeDevice(IDevice device)
var validationResults = new ValidationResult(false, $"Invalid DataItem : \"{genericDataItem.Type}\" Not Found");
if (_configuration.InputValidationLevel > InputValidationLevel.Ignore)
{
if (InvalidDataItemAdded != null) InvalidDataItemAdded.Invoke(obj.Uuid, genericDataItem, validationResults);
MulticastIsolation.Raise(InvalidDataItemAdded, h => h(obj.Uuid, genericDataItem, validationResults));

// Remove DataItem from Device
if (_configuration.InputValidationLevel == InputValidationLevel.Remove) obj.RemoveDataItem(genericDataItem.Id);
Expand Down Expand Up @@ -1522,7 +1522,7 @@ private bool AddDeviceAddedObservation(IDevice device, long timestamp = 0)
new ObservationValue(ValueKeys.Result, device.Uuid)
});

ObservationAdded?.Invoke(this, observation);
ObservationAdded.Raise(this, observation, null);

return true;
}
Expand Down Expand Up @@ -1553,7 +1553,7 @@ private bool AddDeviceChangedObservation(IDevice device, long timestamp = 0)
new ObservationValue(ValueKeys.Result, device.Uuid)
});

ObservationAdded?.Invoke(this, observation);
ObservationAdded.Raise(this, observation, null);

return true;
}
Expand Down Expand Up @@ -1583,7 +1583,7 @@ private bool AddDeviceRemovedObservation(IDevice device, long timestamp = 0)
new ObservationValue(ValueKeys.Result, device.Uuid)
});

ObservationAdded?.Invoke(this, observation);
ObservationAdded.Raise(this, observation, null);

return true;
}
Expand Down Expand Up @@ -1717,7 +1717,7 @@ public IDevice AddDevice(IDevice device, bool initializeDataItems = true)
_updateInformation = true;
}

DeviceAdded?.Invoke(this, obj);
DeviceAdded.Raise(this, obj, null);

return obj;
}
Expand Down Expand Up @@ -2124,7 +2124,7 @@ public bool AddObservation(string deviceKey, IObservationInput observationInput,
{
if (observationInput != null)
{
ObservationReceived?.Invoke(this, observationInput);
ObservationReceived.Raise(this, observationInput, null);

IObservationInput input = new ObservationInput();
input.DeviceKey = deviceKey;
Expand Down Expand Up @@ -2259,16 +2259,17 @@ public bool AddObservation(string deviceKey, IObservationInput observationInput,
else success = true; // Return true if no update needed
}

if (!validationResult.IsValid && InvalidObservationAdded != null)
if (!validationResult.IsValid)
{
InvalidObservationAdded.Invoke(deviceUuid, input.DataItemKey, validationResult);
MulticastIsolation.Raise(InvalidObservationAdded, h => h(deviceUuid, input.DataItemKey, validationResult));
}

return success;
}
else if (InvalidObservationAdded != null)
else
{
InvalidObservationAdded.Invoke(deviceUuid, input.DataItemKey, new ValidationResult(false, $"DataItemKey \"{input.DataItemKey}\" not Found in Device"));
var missingKeyResult = new ValidationResult(false, $"DataItemKey \"{input.DataItemKey}\" not Found in Device");
MulticastIsolation.Raise(InvalidObservationAdded, h => h(deviceUuid, input.DataItemKey, missingKeyResult));
}
}

Expand Down Expand Up @@ -2333,28 +2334,19 @@ protected virtual ulong OnAddObservation(string deviceUuid, IDataItem dataItem,
/// <inheritdoc />
public void OnObservationAdded(IObservation observation)
{
if (ObservationAdded != null)
{
ObservationAdded?.Invoke(this, observation);
}
ObservationAdded.Raise(this, observation, null);
}

/// <inheritdoc />
public void OnInvalidObservationAdded(string deviceUuid, string dataItemId, ValidationResult result)
{
if (InvalidObservationAdded != null)
{
InvalidObservationAdded?.Invoke(deviceUuid, dataItemId, result);
}
MulticastIsolation.Raise(InvalidObservationAdded, h => h(deviceUuid, dataItemId, result));
}

/// <inheritdoc />
public void OnInvalidDeviceAdded(IDevice device, ValidationResult result)
{
if (InvalidDeviceAdded != null)
{
InvalidDeviceAdded?.Invoke(device, result);
}
MulticastIsolation.Raise(InvalidDeviceAdded, h => h(device, result));
}

#endregion
Expand Down Expand Up @@ -2453,16 +2445,16 @@ public bool AddAsset(string deviceKey, IAsset asset, bool? ignoreTimestamp = nul

if (!validationResults.IsValid && _configuration.InputValidationLevel > InputValidationLevel.Ignore)
{
if (InvalidAssetAdded != null) InvalidAssetAdded.Invoke(asset, validationResults);
MulticastIsolation.Raise(InvalidAssetAdded, h => h(asset, validationResults));
}

AssetAdded?.Invoke(this, asset);
AssetAdded.Raise(this, asset, null);
return true;
}
}
else
{
if (InvalidAssetAdded != null) InvalidAssetAdded.Invoke(asset, validationResults);
MulticastIsolation.Raise(InvalidAssetAdded, h => h(asset, validationResults));
}
}
}
Expand Down
Loading
Loading