Example #1
0
        /// <inheritdoc cref="AbstractCommand.Execute"/>
        public override ServerResponse Execute
        (
            ClientQuery query
        )
        {
            Sure.NotNull(query, nameof(query));

            ServerResponse result = base.Execute(query);

            if (!string.IsNullOrEmpty(FormatSpecification))
            {
                result.GetReturnCode();
            }

            int count = 1;

            if (VirtualRecord == null)
            {
                count = MfnList.Count;
            }
            FormatResult = GetFormatResult
                           (
                result,
                count
                           );

            return(result);
        }
        /// <inheritdoc cref="AbstractCommand.Execute" />
        public override ServerResponse Execute
        (
            ClientQuery query
        )
        {
            Sure.NotNull(query, nameof(query));

            string database = Record.ThrowIfNull("Record").Database
                              ?? Connection.Database;

            ServerResponse result = base.Execute(query);

            MaxMfn = result.GetReturnCode();

            MarcRecord record = Record.ThrowIfNull("Record");

            record.Database = database;
            record.HostName = Connection.Host;

            if (!DontParseResponse)
            {
                ProtocolText.ParseResponseForWriteRecord
                (
                    result,
                    record
                );
            }

            return(result);
        }
Example #3
0
        /// <summary>
        /// Execute the command.
        /// </summary>
        public override ServerResponse Execute
        (
            ClientQuery clientQuery
        )
        {
            Sure.NotNull(clientQuery, nameof(clientQuery));

            ServerResponse result = base.Execute(clientQuery);

            result.GetReturnCode();
            if (result.ReturnCode == 0)
            {
                int expected = result.RequireInt32();
                FoundCount = expected;
                List <FoundItem> foundList = FoundItem
                                             .ParseServerResponse(result, expected)
                                             .ThrowIfNull("Found");
                Found = foundList;

                _FetchRemaining(result, expected);

                if (!_subCommand &&
                    FirstRecord == 1 &&
                    NumberOfRecords == 0)
                {
                    Debug.Assert
                    (
                        foundList.Count == expected,
                        "Found.Count != expected in total"
                    );
                }
            }

            return(result);
        }
        /// <inheritdoc cref="AbstractCommand.Execute" />
        public override ServerResponse Execute
        (
            ClientQuery query
        )
        {
            Sure.NotNull(query, nameof(query));

            ServerResponse result = base.Execute(query);

            result.GetReturnCode();

            // ReSharper disable AssignNullToNotNullAttribute
            // ReSharper disable PossibleNullReferenceException
            // ReSharper disable ForCanBeConvertedToForeach
            for (int i = 0; i < References.Count; i++)
            {
                ProtocolText.ParseResponseForWriteRecords
                (
                    result,
                    References[i].Record
                );

                References[i].Mfn = References[i].Record.Mfn;
            }
            // ReSharper restore ForCanBeConvertedToForeach
            // ReSharper restore PossibleNullReferenceException
            // ReSharper restore AssignNullToNotNullAttribute

            return(result);
        }
        /// <inheritdoc cref="AbstractCommand.Execute" />
        public override ServerResponse Execute
        (
            ClientQuery query
        )
        {
            ServerResponse response = base.Execute(query);

            response.GetReturnCode();
            Result = IrbisProcessInfo.Parse(response);

            return(response);
        }
        /// <inheritdoc cref="AbstractCommand.Execute" />
        public override ServerResponse Execute
        (
            ClientQuery query
        )
        {
            ServerResponse response = base.Execute(query);

            response.GetReturnCode();
            Result = ServerStat.Parse(response);

            return(response);
        }
Example #7
0
        /// <inheritdoc cref="AbstractCommand.Execute" />
        public override ServerResponse Execute
        (
            ClientQuery query
        )
        {
            Sure.NotNull(query, nameof(query));

            ServerResponse result = base.Execute(query);

            result.GetReturnCode();

            return(result);
        }
Example #8
0
        /// <inheritdoc cref="AbstractCommand.Execute"/>
        public override ServerResponse Execute
        (
            ClientQuery clientQuery
        )
        {
            Sure.NotNull(clientQuery, nameof(clientQuery));

            ServerResponse result = base.Execute(clientQuery);

            result.GetReturnCode();

            Found = result.RemainingUtfStrings()
                    .ToArray();

            return(result);
        }
Example #9
0
        /// <inheritdoc cref="AbstractCommand.Execute"/>
        public override ServerResponse Execute
        (
            ClientQuery query
        )
        {
            ServerResponse result = base.Execute(query);

            // Check whether no records read
            if (result.GetReturnCode() != -201)
            {
                string[] lines = result
                                 .RemainingUtfStrings()
                                 .ToArray();

                RawRecord          = RawRecord.Parse(lines);
                RawRecord.Mfn      = Mfn;
                RawRecord.Database = Database ?? Connection.Database;
            }

            return(result);
        }
Example #10
0
        /// <inheritdoc cref="AbstractCommand.Execute" />
        public override ServerResponse Execute
        (
            ClientQuery query
        )
        {
            ServerResponse result = base.Execute(query);

            // Check whether no records read
            if (result.GetReturnCode() != -201)
            {
                MarcRecord record = new MarcRecord
                {
                    HostName = Connection.Host,
                    Database = Database
                };

                record = ProtocolText.ParseResponseForReadRecord
                         (
                    result,
                    record
                         );
                record.Verify(ThrowOnVerify);

                if (ThrowOnEmptyRecord)
                {
                    IrbisNetworkUtility.ThrowIfEmptyRecord
                    (
                        record,
                        result
                    );
                }

                Record = record;
            }

            return(result);
        }