Ejemplo n.º 1
0
        public Either <RfcErrorInfo, int> GetFunctionParameterCount(IFunctionDescriptionHandle descriptionHandle)
        {
            Logger.IfSome(l => l.LogTrace("reading function parameter count by function description handle", descriptionHandle));
            var rc = NativeApi.GetFunctionParameterCount(descriptionHandle as FunctionDescriptionHandle, out var result, out var errorInfo);

            return(ResultOrError(result, rc, errorInfo));
        }
Ejemplo n.º 2
0
        public Either <RfcErrorInfo, IStructureHandle> AppendTableRow(ITableHandle tableHandle)
        {
            Logger.IfSome(l => l.LogTrace("append table row by table handle", tableHandle));
            IStructureHandle handle = NativeApi.AppendTableRow(tableHandle as TableHandle, out var errorInfo);

            return(ResultOrError(handle, errorInfo));
        }
Ejemplo n.º 3
0
        public Either <RfcErrorInfo, string> GetFunctionName(IFunctionDescriptionHandle descriptionHandle)
        {
            Logger.IfSome(l => l.LogTrace("reading function name by description handle", descriptionHandle));
            var rc = NativeApi.GetFunctionName(descriptionHandle as FunctionDescriptionHandle, out var result, out var errorInfo);

            return(ResultOrError(result, rc, errorInfo));
        }
Ejemplo n.º 4
0
        public Either <RfcErrorInfo, int> GetTableRowCount(ITableHandle tableHandle)
        {
            Logger.IfSome(l => l.LogTrace("reading table row count by table handle", tableHandle));
            var rc = NativeApi.GetTableRowCount(tableHandle as TableHandle, out var result, out var errorInfo);

            return(ResultOrError(result, rc, errorInfo));
        }
Ejemplo n.º 5
0
 public Either <RfcErrorInfo, Unit> AllowStartOfPrograms(IConnectionHandle connectionHandle,
                                                         StartProgramDelegate callback)
 {
     Logger.IfSome(l => l.LogTrace("Setting allow start of programs callback"));
     NativeApi.AllowStartOfPrograms(connectionHandle as ConnectionHandle, callback, out var errorInfo);
     return(ResultOrError(Unit.Default, errorInfo.Code, errorInfo));
 }
Ejemplo n.º 6
0
        public Either <RfcErrorInfo, ITableHandle> CloneTable(ITableHandle tableHandle)
        {
            Logger.IfSome(l => l.LogTrace("cloning table by tableHandle", tableHandle));
            ITableHandle handle = NativeApi.CloneTable(tableHandle as TableHandle, out var errorInfo);

            return(ResultOrError(handle, errorInfo));
        }
Ejemplo n.º 7
0
        public Either <RfcErrorInfo, ITableHandle> GetTable(IDataContainerHandle dataContainer, string name)
        {
            Logger.IfSome(l => l.LogTrace("creating table by data container handle and name", new { dataContainer, name }));
            var rc = NativeApi.GetTable(dataContainer as Native.IDataContainerHandle, name, out var result, out var errorInfo);

            return(ResultOrError((ITableHandle)result, rc, errorInfo));
        }
Ejemplo n.º 8
0
        public Either <RfcErrorInfo, IStructureHandle> GetCurrentTableRow(ITableHandle tableHandle)
        {
            Logger.IfSome(l => l.LogTrace("reading current table row by table handle", tableHandle));
            IStructureHandle handle = NativeApi.GetCurrentTableRow(tableHandle as TableHandle, out var errorInfo);

            return(ResultOrError(handle, errorInfo));
        }
Ejemplo n.º 9
0
        public Either <RfcErrorInfo, Unit> MoveToFirstTableRow(ITableHandle tableHandle)
        {
            Logger.IfSome(l => l.LogTrace("move to first table row by table handle", tableHandle));
            var rc = NativeApi.MoveToFirstTableRow(tableHandle as TableHandle, out var errorInfo);

            return(ResultOrError(Unit.Default, rc, errorInfo));
        }
Ejemplo n.º 10
0
        public Either <RfcErrorInfo, int> GetTypeFieldCount(ITypeDescriptionHandle descriptionHandle)
        {
            Logger.IfSome(l => l.LogTrace("reading field count by type description handle", descriptionHandle));
            var rc = NativeApi.GetTypeFieldCount(descriptionHandle as TypeDescriptionHandle, out var result, out var errorInfo);

            return(ResultOrError(result, rc, errorInfo));
        }
Ejemplo n.º 11
0
        public Either <RfcErrorInfo, IFunctionDescriptionHandle> GetFunctionDescription(IFunctionHandle functionHandle)
        {
            Logger.IfSome(l => l.LogTrace("reading function description by function handle", functionHandle));
            IFunctionDescriptionHandle handle = NativeApi.GetFunctionDescription(functionHandle as FunctionHandle, out var errorInfo);

            return(ResultOrError(handle, errorInfo));
        }
Ejemplo n.º 12
0
        public Either <RfcErrorInfo, ITypeDescriptionHandle> GetTypeDescription(IDataContainerHandle dataContainer)
        {
            Logger.IfSome(l => l.LogTrace("reading type description by container handle", dataContainer));
            ITypeDescriptionHandle handle = NativeApi.GetTypeDescription(dataContainer as Native.IDataContainerHandle, out var errorInfo);

            return(ResultOrError(handle, errorInfo));
        }
Ejemplo n.º 13
0
        public Either <RfcErrorInfo, byte[]> GetBytes(IDataContainerHandle containerHandle, string name)
        {
            Logger.IfSome(l => l.LogTrace("getting byte value by name", new { containerHandle, name }));
            var rc = NativeApi.GetBytes(containerHandle as Native.IDataContainerHandle, name, out var result, out var errorInfo);

            return(ResultOrError(result, rc, errorInfo));
        }
Ejemplo n.º 14
0
        public Either <RfcErrorInfo, Unit> SetBytes(IDataContainerHandle containerHandle, string name, byte[] buffer, long bufferLength)
        {
            Logger.IfSome(l => l.LogTrace("setting byte value by name", new { containerHandle, name }));
            var rc = NativeApi.SetBytes(containerHandle as Native.IDataContainerHandle, name, buffer, (uint)bufferLength, out var errorInfo);

            return(ResultOrError(Unit.Default, rc, errorInfo));
        }
Ejemplo n.º 15
0
        public Either <RfcErrorInfo, Unit> SetLong(IDataContainerHandle containerHandle, string name, long value)
        {
            Logger.IfSome(l => l.LogTrace("setting long value by name", new { containerHandle, name, value }));
            var rc = NativeApi.SetLong(containerHandle as Native.IDataContainerHandle, name, value, out var errorInfo);

            return(ResultOrError(Unit.Default, rc, errorInfo));
        }
Ejemplo n.º 16
0
        public Either <RfcErrorInfo, string> GetDateString(IDataContainerHandle containerHandle, string name)
        {
            Logger.IfSome(l => l.LogTrace("reading date string value by name", new { containerHandle, name }));
            var rc = NativeApi.GetDateString(containerHandle as Native.IDataContainerHandle, name, out var result, out var errorInfo);

            return(ResultOrError(result, rc, errorInfo));
        }
Ejemplo n.º 17
0
        public Either <RfcErrorInfo, Unit> Invoke(IConnectionHandle connectionHandle, IFunctionHandle functionHandle)
        {
            Logger.IfSome(l => l.LogTrace("Invoking function", new { connectionHandle, functionHandle }));
            var rc = NativeApi.Invoke(connectionHandle as ConnectionHandle, functionHandle as FunctionHandle, out var errorInfo);

            return(ResultOrError(Unit.Default, rc, errorInfo));
        }
Ejemplo n.º 18
0
        public Either <RfcErrorInfo, RfcParameterInfo> GetFunctionParameterDescription(
            IFunctionDescriptionHandle descriptionHandle, string name)
        {
            Logger.IfSome(l => l.LogTrace("reading function parameter description by function description handle and name", new { descriptionHandle, name }));
            var rc = NativeApi.GetFunctionParameterDescription(descriptionHandle as FunctionDescriptionHandle, name, out var result, out var errorInfo);

            return(ResultOrError(result, rc, errorInfo));
        }
Ejemplo n.º 19
0
        public Either <RfcErrorInfo, RfcFieldInfo> GetTypeFieldDescription(ITypeDescriptionHandle descriptionHandle,
                                                                           string name)
        {
            Logger.IfSome(l => l.LogTrace("reading field description by type description handle and name", new { descriptionHandle, name }));
            var rc = NativeApi.GetTypeFieldDescription(descriptionHandle as TypeDescriptionHandle, name, out var result, out var errorInfo);

            return(ResultOrError(result, rc, errorInfo));
        }
Ejemplo n.º 20
0
        public Either <RfcErrorInfo, IConnectionHandle> OpenConnection(IDictionary <string, string> connectionParams)
        {
            var loggedParams = new Dictionary <string, string>(connectionParams);

            // ReSharper disable StringLiteralTypo
            if (loggedParams.ContainsKey("passwd"))
            {
                loggedParams["passwd"] = "XXXX";
            }
            // ReSharper restore StringLiteralTypo

            Logger.IfSome(l => l.LogTrace("Opening connection", loggedParams));
            IConnectionHandle handle = NativeApi.OpenConnection(connectionParams, out var errorInfo);

            return(ResultOrError(handle, errorInfo, true));
        }