Exemplo n.º 1
0
 private void ValidateResult(AbstractResponse response)
 {
     if (response == null)
     {
         throw new DriverInternalError("Response can not be null");
     }
     if (!(response is ResultResponse))
     {
         throw new DriverInternalError("Excepted ResultResponse, obtained " + response.GetType().FullName);
     }
 }
Exemplo n.º 2
0
 private void EventHandler(Exception ex, AbstractResponse response)
 {
     if (!(response is EventResponse))
     {
         _logger.Error("Unexpected response type for event: " + response.GetType().Name);
         return;
     }
     if (CassandraEventResponse != null)
     {
         CassandraEventResponse(this, (response as EventResponse).CassandraEventArgs);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Validates that the result contains a RowSet and returns it.
        /// </summary>
        /// <exception cref="NullReferenceException" />
        /// <exception cref="DriverInternalError" />
        public static RowSet GetRowSet(AbstractResponse response)
        {
            if (response == null)
            {
                throw new NullReferenceException("Response can not be null");
            }
            if (!(response is ResultResponse))
            {
                throw new DriverInternalError("Expected rows, obtained " + response.GetType().FullName);
            }
            var result = (ResultResponse)response;

            if (!(result.Output is OutputRows))
            {
                throw new DriverInternalError("Expected rows output, obtained " + result.Output.GetType().FullName);
            }
            return(((OutputRows)result.Output).RowSet);
        }
 /// <summary>
 /// Validates that the result contains a RowSet and returns it.
 /// </summary>
 /// <exception cref="NullReferenceException" />
 /// <exception cref="DriverInternalError" />
 public static RowSet GetRowSet(AbstractResponse response)
 {
     if (response == null)
     {
         throw new NullReferenceException("Response can not be null");
     }
     if (!(response is ResultResponse))
     {
         throw new DriverInternalError("Expected rows, obtained " + response.GetType().FullName);
     }
     var result = (ResultResponse) response;
     if (!(result.Output is OutputRows))
     {
         throw new DriverInternalError("Expected rows output, obtained " + result.Output.GetType().FullName);
     }
     return ((OutputRows) result.Output).RowSet;
 }
Exemplo n.º 5
0
 private void EventHandler(Exception ex, AbstractResponse response)
 {
     if (!(response is EventResponse))
     {
         _logger.Error("Unexpected response type for event: " + response.GetType().Name);
         return;
     }
     if (this.CassandraEventResponse != null)
     {
         this.CassandraEventResponse(this, (response as EventResponse).CassandraEventArgs);
     }
 }