-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(fdc3) - AddContextListener fix if the channel has not been set
- Loading branch information
Showing
28 changed files
with
1,071 additions
and
87 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
...ktopAgent/src/MorganStanley.ComposeUI.DesktopAgent/Contracts/AddContextListenerRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Morgan Stanley makes this available to you under the Apache License, | ||
* Version 2.0 (the "License"). You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* See the NOTICE file distributed with this work for additional information | ||
* regarding copyright ownership. Unless required by applicable law or agreed | ||
* to in writing, software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
* or implied. See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
*/ | ||
|
||
using Finos.Fdc3; | ||
|
||
namespace MorganStanley.ComposeUI.Fdc3.DesktopAgent.Contracts; | ||
|
||
internal sealed class AddContextListenerRequest | ||
{ | ||
/// <summary> | ||
/// Instance id of the app that sent the request. | ||
/// </summary> | ||
public string Fdc3InstanceId { get; set; } | ||
|
||
/// <summary> | ||
/// Type of the context that the listener should listen on. | ||
/// </summary> | ||
public string? ContextType { get; set; } | ||
|
||
/// <summary> | ||
/// The id of the channel, that the current listener is listening on. | ||
/// </summary> | ||
public string ChannelId { get; set; } | ||
|
||
/// <summary> | ||
/// The type of the channel that the current listener listens on. | ||
/// </summary> | ||
public ChannelType ChannelType { get; set; } | ||
} |
36 changes: 36 additions & 0 deletions
36
...topAgent/src/MorganStanley.ComposeUI.DesktopAgent/Contracts/AddContextListenerResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Morgan Stanley makes this available to you under the Apache License, | ||
* Version 2.0 (the "License"). You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* See the NOTICE file distributed with this work for additional information | ||
* regarding copyright ownership. Unless required by applicable law or agreed | ||
* to in writing, software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
* or implied. See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
*/ | ||
|
||
namespace MorganStanley.ComposeUI.Fdc3.DesktopAgent.Contracts; | ||
|
||
internal sealed class AddContextListenerResponse | ||
{ | ||
/// <summary> | ||
/// The generated id of the context listener | ||
/// </summary> | ||
public string? Id { get; set; } | ||
|
||
/// <summary> | ||
/// Indicates that exception was thrown during the execution. | ||
/// </summary> | ||
public string? Error { get; set; } | ||
|
||
/// <summary> | ||
/// Indicates if the execution was successful. | ||
/// </summary> | ||
public bool Success { get; set; } | ||
|
||
public static AddContextListenerResponse Failure(string error) => new() { Error = error, Success = false }; | ||
public static AddContextListenerResponse Added(string id) => new() { Id = id, Success = true }; | ||
} |
34 changes: 34 additions & 0 deletions
34
...pAgent/src/MorganStanley.ComposeUI.DesktopAgent/Contracts/RemoveContextListenerRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Morgan Stanley makes this available to you under the Apache License, | ||
* Version 2.0 (the "License"). You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* See the NOTICE file distributed with this work for additional information | ||
* regarding copyright ownership. Unless required by applicable law or agreed | ||
* to in writing, software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
* or implied. See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
*/ | ||
|
||
|
||
namespace MorganStanley.ComposeUI.Fdc3.DesktopAgent.Contracts; | ||
|
||
internal sealed class RemoveContextListenerRequest | ||
{ | ||
/// <summary> | ||
/// Id of the instance that sent the request. | ||
/// </summary> | ||
public string Fdc3InstanceId { get; set; } | ||
|
||
/// <summary> | ||
/// Id of the context listener. | ||
/// </summary> | ||
public string ListenerId { get; set; } | ||
|
||
/// <summary> | ||
/// Indicates the type of the context for the subscription. | ||
/// </summary> | ||
public string? ContextType { get; set; } | ||
} |
31 changes: 31 additions & 0 deletions
31
...Agent/src/MorganStanley.ComposeUI.DesktopAgent/Contracts/RemoveContextListenerResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Morgan Stanley makes this available to you under the Apache License, | ||
* Version 2.0 (the "License"). You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* See the NOTICE file distributed with this work for additional information | ||
* regarding copyright ownership. Unless required by applicable law or agreed | ||
* to in writing, software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
* or implied. See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
*/ | ||
|
||
namespace MorganStanley.ComposeUI.Fdc3.DesktopAgent.Contracts; | ||
|
||
internal sealed class RemoveContextListenerResponse | ||
{ | ||
/// <summary> | ||
/// Indicates that error was thrown during the execution of the request. | ||
/// </summary> | ||
public string? Error { get; set; } | ||
|
||
/// <summary> | ||
/// Indicates the state of the request. | ||
/// </summary> | ||
public bool Success { get; set; } | ||
|
||
public static RemoveContextListenerResponse Failure(string error) => new() {Error = error, Success = false}; | ||
public static RemoveContextListenerResponse Executed() => new() { Success = true}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...Agent/src/MorganStanley.ComposeUI.DesktopAgent/Infrastructure/Internal/ContextListener.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Morgan Stanley makes this available to you under the Apache License, | ||
* Version 2.0 (the "License"). You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* See the NOTICE file distributed with this work for additional information | ||
* regarding copyright ownership. Unless required by applicable law or agreed | ||
* to in writing, software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
* or implied. See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
*/ | ||
|
||
using Finos.Fdc3; | ||
|
||
namespace MorganStanley.ComposeUI.Fdc3.DesktopAgent.Infrastructure.Internal; | ||
|
||
internal class ContextListener | ||
{ | ||
private readonly string? _contextType; | ||
private readonly Guid _instanceId; | ||
private string? _channelId; | ||
private ChannelType? _channelType; | ||
|
||
public Guid Id => _instanceId; | ||
public string? ContextType => _contextType; | ||
|
||
public ContextListener(string? contextType, string channelId, ChannelType channelType) | ||
{ | ||
_contextType = contextType; | ||
_channelId = channelId; | ||
_channelType = channelType; | ||
_instanceId = Guid.NewGuid(); | ||
} | ||
} |
Oops, something went wrong.