コード例 #1
0
 public RequestToDataProvider(Guid id, Guid requestId, DataProviderIdentifier dataProvider, DateTime date, ConnectionTypeIdentifier connection)
 {
     Id = id;
     RequestId = requestId;
     DataProvider = dataProvider;
     Date = date;
     Connection = connection;
    // Payload = payload;
 }
コード例 #2
0
 public ResponseFromDataProvider(Guid id, Guid requestId, DataProviderIdentifier dataProvider, DateTime date, ConnectionTypeIdentifier connection, PayloadIdentifier payload)
 {
     Id = id;
     RequestId = requestId;
     DataProvider = dataProvider;
     Date = date;
     Connection = connection;
     Payload = payload;
 }
コード例 #3
0
 public SendRequestToDataProviderCommand(Guid id, Guid requestId, DataProviderIdentifier dataProvider,
     DateTime date, ConnectionTypeIdentifier connection, PayloadIdentifier payload)
 {
     Id = id;
     Date = date;
     RequestId = requestId;
     Connection = connection;
     DataProvider = dataProvider;
     Payload = payload;
 }
コード例 #4
0
 public void DataProviderRequest(DataProviderIdentifier dataProvider,
     ConnectionTypeIdentifier connection, object payload,
     DataProviderStopWatch stopWatch)
 {
     new SendRequestToDataProviderCommand(Guid.NewGuid(), _requestId,
         dataProvider,
         DateTime.UtcNow, connection,
         new PayloadIdentifier(new MetadataContainer().ObjectToJson(), payload.ObjectToJson(),
             CommandDescriptions.StartExecutionDescription((DataProviderCommandSource) dataProvider.Id)))
         .SendToBus(_publisher, _log);
     stopWatch.Start();
 }
コード例 #5
0
 public Request RaiseSecurityFlag(Guid id, DataProviderCommandSource dataProvider,
     DateTime date, CommandType commandType, string metaData, string payload, string message, DataProviderNoRecordState billNoRecords)
 {
     DataProvider = new DataProviderIdentifier(dataProvider, DataProviderAction.Response,
         DataProviderResponseState.Successful, billNoRecords);
     Date = date;
     Connection = new ConnectionTypeIdentifier();
     Payload = new PayloadIdentifier(metaData, payload, message);
     CommandType = commandType;
     State = new StateIdentifier();
     RequestContext = new SearchRequestIndentifier();
     return this;
 }
 public DataProviderTransactionIdentifier(Guid id, Guid streamId, DateTime date, RequestIdentifier parentRequest,
     DataProviderIdentifier dataProvider, ConnectionTypeIdentifier connectionType, ActionIdentifier action,
     StateIdentifier state, NoRecordBillableIdentifier billNoRecords)
 {
     Id = id;
     StreamId = streamId;
     Date = date;
     ParentRequest = parentRequest;
     DataProvider = dataProvider;
     ConnectionType = connectionType;
     Action = action;
     State = state;
     BillNoRecords = billNoRecords;
 }
コード例 #7
0
        public void DataProviderResponse(DataProviderIdentifier dataProvider,
            ConnectionTypeIdentifier connection, object payload,
            DataProviderStopWatch stopWatch)
        {
            stopWatch.Stop();

            new GetResponseFromDataProviderCommmand(Guid.NewGuid(), _requestId,
                dataProvider,
                DateTime.UtcNow, connection,
                new PayloadIdentifier(new PerformanceMetadata(stopWatch.ToObject()).ObjectToJson(),
                    payload.ObjectToJson(),
                    CommandDescriptions.EndExecutionDescription((DataProviderCommandSource) dataProvider.Id)))
                .SendToBus(_publisher, _log);
        }
コード例 #8
0
 public Request CreateTransaction(Guid packageId, long packageVersion, DateTime date, Guid userId,
     Guid contractId,
     string system, long contractVersion, DataProviderResponseState state, string accountNumber, double packageCostPrice, double packageRecommendedPrice, DataProviderNoRecordState billNoRecords)
 {
     DataProvider = new DataProviderIdentifier(DataProviderCommandSource.EntryPoint, DataProviderAction.Response, state, billNoRecords);
     Date = date;
     Connection = new ConnectionTypeIdentifier();
     Payload = new PayloadIdentifier();
     CommandType = CommandType.Accounting;
     State = new StateIdentifier((int) state, state.ToString());
     RequestContext = new SearchRequestIndentifier();
     Package = new PackageIdentifier(packageId, new VersionIdentifier(packageVersion), packageCostPrice, packageRecommendedPrice);
     return this;
 }
コード例 #9
0
 public Request ResponseReceivedFromDataProvider(DataProviderIdentifier dataProvider, DateTime date,
     ConnectionTypeIdentifier connection, PayloadIdentifier payload)
 {
     DataProvider = dataProvider;
     Date = date;
     Connection = connection;
     Payload = payload;
     CommandType = CommandType.EndExecution;
     State = new StateIdentifier();
     RequestContext = new SearchRequestIndentifier();
     return this;
 }
コード例 #10
0
 public Request EntryPointResponse(DateTime date, StateIdentifier state,
     PayloadIdentifier payload, SearchRequestIndentifier request, NoRecordBillableIdentifier billNoRecords)
 {
   
     DataProvider = new DataProviderIdentifier(DataProviderCommandSource.EntryPoint, DataProviderAction.Response,
         (DataProviderResponseState)state.Id, (DataProviderNoRecordState)billNoRecords.Id);
     Date = date;
     Connection = new ConnectionTypeIdentifier();
     Payload = payload;
     CommandType = CommandType.EndExecution;
     State = state;
     RequestContext = request;
     return this;
 }
コード例 #11
0
 private void SendResponseAsync(DataProviderIdentifier dataProvider, ConnectionTypeIdentifier connection, object payload, DataProviderStopWatch stopWatch)
 {
     try
     {
         Task.Run(() =>
         {
             try
             {
                 _commands.Workflow.DataProviderResponse(dataProvider, connection, payload, stopWatch);
             }
             catch (Exception ex)
             {
                 _log.ErrorFormat("An error occured sending a response to the bus because of {0}",ex, ex.Message);
             }
         });
     }
     catch (Exception ex)
     {
         _log.ErrorFormat("An error occured sending a response to the bus because of {0}",ex, ex.Message);
     }
 }