-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added IO for global library functions (#284)
new Trait HasSAPRfcLibrary<RT> with RfcLibraryIO
- Loading branch information
Showing
12 changed files
with
188 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using JetBrains.Annotations; | ||
using LanguageExt; | ||
|
||
namespace Dbosoft.YaNco.Traits; | ||
|
||
[PublicAPI] | ||
// ReSharper disable once InconsistentNaming | ||
public interface HasSAPRfcLibrary<RT> : IHasEnvRuntimeSettings | ||
where RT : struct | ||
{ | ||
Eff<RT, SAPRfcLibraryIO> RfcLibraryEff { get; } | ||
|
||
} |
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,17 @@ | ||
using LanguageExt; | ||
|
||
namespace Dbosoft.YaNco.Traits; | ||
|
||
// ReSharper disable once InconsistentNaming | ||
public interface SAPRfcLibraryIO | ||
{ | ||
Either<RfcError, System.Version> GetVersion(); | ||
Either<RfcError, Unit> SetTraceDirectory(string traceDirectory); | ||
Either<RfcError, Unit> SetMaximumTraceFiles(int traceFiles); | ||
Either<RfcError, Unit> SetCpicTraceLevel(int traceLevel); | ||
|
||
Either<RfcError, Unit> LoadCryptoLibrary(string libraryPath); | ||
Either<RfcError, Unit> SetIniDirectory(string iniDirectory); | ||
Either<RfcError, Unit> ReloadRfcIni(); | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using System; | ||
using Dbosoft.YaNco.Internal; | ||
using Dbosoft.YaNco.Traits; | ||
using LanguageExt; | ||
|
||
namespace Dbosoft.YaNco.Live; | ||
|
||
public readonly struct LiveSAPRfcLibraryIO : SAPRfcLibraryIO | ||
{ | ||
private readonly Option<ILogger> _logger; | ||
|
||
public LiveSAPRfcLibraryIO(Option<ILogger> logger) | ||
{ | ||
_logger = logger; | ||
} | ||
|
||
public Either<RfcError, Version> GetVersion() | ||
{ | ||
return Prelude.Try(Api.GetVersion).ToEither(f => RfcError.New(f)); | ||
|
||
} | ||
|
||
public Either<RfcError, Unit> SetTraceDirectory(string traceDirectory) | ||
{ | ||
var rc = Api.SetTraceDirectory(traceDirectory, out var errorInfo); | ||
return IOResult.ResultOrError(_logger, Unit.Default, rc, errorInfo); | ||
} | ||
|
||
public Either<RfcError, Unit> SetMaximumTraceFiles(int traceFiles) | ||
{ | ||
var rc = Api.SetMaximumTraceFiles(traceFiles, out var errorInfo); | ||
return IOResult.ResultOrError(_logger, Unit.Default, rc, errorInfo); | ||
} | ||
|
||
public Either<RfcError, Unit> SetCpicTraceLevel(int traceLevel) | ||
{ | ||
var rc = Api.SetCpicTraceLevel(traceLevel, out var errorInfo); | ||
return IOResult.ResultOrError(_logger, Unit.Default, rc, errorInfo); | ||
} | ||
|
||
public Either<RfcError, Unit> LoadCryptoLibrary(string libraryPath) | ||
{ | ||
var rc = Api.LoadCryptoLibrary(libraryPath, out var errorInfo); | ||
return IOResult.ResultOrError(_logger, Unit.Default, rc, errorInfo); | ||
} | ||
|
||
public Either<RfcError, Unit> SetIniDirectory(string iniDirectory) | ||
{ | ||
var rc = Api.SetIniDirectory(iniDirectory, out var errorInfo); | ||
return IOResult.ResultOrError(_logger, Unit.Default, rc, errorInfo); | ||
} | ||
|
||
public Either<RfcError, Unit> ReloadRfcIni() | ||
{ | ||
var rc = Api.ReloadIniFile(out var errorInfo); | ||
return IOResult.ResultOrError(_logger, Unit.Default, rc, errorInfo); | ||
} | ||
|
||
} |
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
8b8aba2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, We're using your library for listening the IDOC gateway. We implemented for two system, when the program is starting to run, it connects two system.
But when we send IDOCs from ERP to our solution, there is an error (sometimes) as
System.ArgumentException: 'The key already existed in the dictionary.'
on CachingConverterResolver.cs`using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
namespace Digitanol.YaNco.TypeMapping
{
public class CachingConverterResolver : IRfcConverterResolver
{
private readonly IRfcConverterResolver _decoratedResolver;
}`
Do you have any solution about this problem? How can we solve this issue, please let us know.
Thanks a lot!
8b8aba2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please create a issue or a discussion instead of a comment to a single commit. These are very difficult to find for anyone.