67 lines
1.9 KiB
C#
67 lines
1.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using Amazon.DynamoDBv2;
|
|
|
|
|
|
using ServerCore; using ServerBase;
|
|
|
|
|
|
namespace ServerBase;
|
|
|
|
//=============================================================================================
|
|
// DynamoDb ItemRequest 기반 Query Context
|
|
//
|
|
// - kangms
|
|
//=============================================================================================
|
|
|
|
public partial class DynamoDbItemRequestQueryContext : IQueryContext
|
|
{
|
|
private readonly AmazonDynamoDBRequest m_db_request;
|
|
private QueryType m_query_type;
|
|
|
|
// TransactionCanceledException 관련 설정
|
|
private DynamoDbQueryExceptionNotifier.ExceptionHandler? m_exception_handler_nullable;
|
|
|
|
|
|
public DynamoDbItemRequestQueryContext( AmazonDynamoDBRequest dbRequest, QueryType queryType )
|
|
{
|
|
m_db_request = dbRequest;
|
|
m_query_type = queryType;
|
|
}
|
|
|
|
public DynamoDbItemRequestQueryContext( AmazonDynamoDBRequest dbRequest, QueryType queryType
|
|
, DynamoDbQueryExceptionNotifier.ExceptionHandler? exceptionHandler )
|
|
{
|
|
m_db_request = dbRequest;
|
|
m_query_type = queryType;
|
|
m_exception_handler_nullable = exceptionHandler;
|
|
}
|
|
|
|
public bool isValid()
|
|
{
|
|
if (null == m_db_request)
|
|
{
|
|
Log.getLogger().error($"DynamoDbDocument is null !!! - {toBasicString()}");
|
|
return false;
|
|
}
|
|
|
|
if (QueryType.None == m_query_type)
|
|
{
|
|
Log.getLogger().error($"DynamoDbDocument QueryType invalid !!! - {toBasicString()}");
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public string toBasicString()
|
|
{
|
|
return $"{this.getTypeName()}, {m_query_type}, {m_db_request?.toBasicString()}";
|
|
}
|
|
}
|