コード例 #1
0
 public GetChunkOperation(Alachisoft.NosDB.Common.Protobuf.Command command) : base(command.ToBuilder())
 {
     _getChunkCommand = command.GetChunkCommand.ToBuilder();
     _lastChunkId     = _getChunkCommand.LastChunkId;
     _readerUID       = _getChunkCommand.ReaderUID;
     base.Message     = this;
 }
コード例 #2
0
 public DropSessionCommand(Alachisoft.NosDB.Common.Protobuf.Command command)
     : base(command.ToBuilder())
 {
     _dropSessionCommand = command.DropSessionCommand.ToBuilder();
     _sessionId          = _dropSessionCommand.SessionId;
     base.Message        = this;
 }
コード例 #3
0
        public CreateSessionOperation(Alachisoft.NosDB.Common.Protobuf.Command command) : base(command.ToBuilder())
        {
            _createSessionCommand = command.CreateSessionCommand.ToBuilder();
            _clientId             = _createSessionCommand.ClientId;

            //convert encrypted byte array to string
            _userName = Encoding.UTF8.GetString(_createSessionCommand.Credential.UserName.ToByteArray());
            _password = Encoding.UTF8.GetString(_createSessionCommand.Credential.Password.ToByteArray());

            base.Message = this;
        }
コード例 #4
0
        public GetDocumentsOperation(Alachisoft.NosDB.Common.Protobuf.Command command) : base(command.ToBuilder())
        {
            _getDocumentsCommand = command.GetDocumentsCommand.ToBuilder();
            _documentId          = new List <IJSONDocument>();

            foreach (string document in _getDocumentsCommand.DocumentIdsList)
            {
                DocumentIds.Add(JSONDocument.Parse(document));
            }

            base.Message = this;
        }
コード例 #5
0
        public AuthenticationOperation(Alachisoft.NosDB.Common.Protobuf.Command command)
            : base(command.ToBuilder())
        {
            ClientToken = new AuthToken();
            _authenticationCommandBuilder = command.AuthenticationCommand.ToBuilder();
            _connectionString             = _authenticationCommandBuilder.ConnectionString;
            _processID = _authenticationCommandBuilder.ProcessID;

            Protobuf.AuthenticationToken.Builder authenticationTokenBuilder = _authenticationCommandBuilder.AuthenticationToken.ToBuilder();;

            ClientToken.Status = (Security.SSPI.SecurityStatus)authenticationTokenBuilder.Status;
            ClientToken.Token  = authenticationTokenBuilder.Token.ToByteArray();

            base.Message       = this;
            base.OperationType = DatabaseOperationType.Authenticate;
        }
コード例 #6
0
        public WriteQueryOperation(Alachisoft.NosDB.Common.Protobuf.Command command) : base(command.ToBuilder())
        {
            _writeQueryCommand = command.WriteQueryCommand.ToBuilder();
            _query             = new Query();

            _query.QueryText = _writeQueryCommand.Query.Query;

            //foreach (Alachisoft.NosDB.Common.Protobuf.Parameter param in _writeQueryCommand.Query.ParametersList)
            //{
            //    switch ((ParameterType)param.JsonDataType)
            //    {
            //        case ParameterType.NULL:
            //            _query.Parameters.Add(new Parameter(param.Attribute, null));
            //            break;
            //        case ParameterType.BOOLEAN:
            //            _query.Parameters.Add(new Parameter(param.Attribute, bool.Parse(param.Value)));
            //            break;
            //        case ParameterType.DATETIME:
            //            _query.Parameters.Add(new Parameter(param.Attribute, DateTime.Parse(param.Value)));
            //            break;
            //        case ParameterType.STRING:
            //            _query.Parameters.Add(new Parameter(param.Attribute, param.Value));
            //            break;
            //        case ParameterType.LONG:
            //            _query.Parameters.Add(new Parameter(param.Attribute, long.Parse(param.Value)));
            //            break;
            //        case ParameterType.DOUBLE:
            //            _query.Parameters.Add(new Parameter(param.Attribute, double.Parse(param.Value)));
            //            break;
            //        case ParameterType.ARRAY:
            //            _query.Parameters.Add(new Parameter(param.Attribute, JsonConvert.DeserializeObject<JArray>(param.Value)));
            //            break;
            //        default:
            //            _query.Parameters.Add(new Parameter(param.Attribute, JSONDocument.Parse(param.Value)));
            //            break;
            //    }
            //}
            _query.Parameters = QueryParameterConverter.GetParameterList(_writeQueryCommand.Query.ParametersList);

            base.Message = this;
        }
コード例 #7
0
 public CreateIndexOperation(Alachisoft.NosDB.Common.Protobuf.Command command) : base(command.ToBuilder())
 {
     //_createIndexCommand = command.CreateIndexOperation.ToBuilder();
     base.Message = this;
 }
コード例 #8
0
 public DropIndexOperation(Alachisoft.NosDB.Common.Protobuf.Command command)
     : base(command.ToBuilder())
 {
     base.Message = this;
 }
コード例 #9
0
 public DropCollectionOperation(Alachisoft.NosDB.Common.Protobuf.Command command)
     : base(command.ToBuilder())
 {
     _dropCollectionCommand = command.DropCollectionCommand.ToBuilder();
     base.Message           = this;
 }
コード例 #10
0
 public byte[] Serialize()
 {
     BuildInternal();
     Alachisoft.NosDB.Common.Protobuf.Command commandObj = _command.Build();
     return(commandObj.ToByteArray());
 }
コード例 #11
0
ファイル: ReadOperation.cs プロジェクト: waqashaneef/NosDB
 public ReadOperation(Alachisoft.NosDB.Common.Protobuf.Command command) : base(command.ToBuilder())
 {
 }
コード例 #12
0
 public DisposeReaderOperation(Alachisoft.NosDB.Common.Protobuf.Command command) : base(command.ToBuilder())
 {
     _disposeReaderCommand = command.DisposeReaderCommand.ToBuilder();
     _readerUID            = _disposeReaderCommand.ReaderUID;
     base.Message          = this;
 }