MobileAuthorizeStart(this IMobileClient IMobileClient,
                             EVSE_Id EVSEId,
                             EVCO_Id EVCOId,
                             String HashedPIN,
                             PINCrypto Function,
                             String Salt,
                             PartnerProduct_Id?PartnerProductId = null,
                             Boolean?GetNewSession = null,

                             DateTime?Timestamp = null,
                             CancellationToken?CancellationToken = null,
                             EventTracking_Id EventTrackingId    = null,
                             TimeSpan?RequestTimeout             = null)


        => IMobileClient.MobileAuthorizeStart(new MobileAuthorizeStartRequest(EVSEId,
                                                                              new QRCodeIdentification(EVCOId,
                                                                                                       HashedPIN,
                                                                                                       Function,
                                                                                                       Salt),
                                                                              PartnerProductId,
                                                                              GetNewSession,

                                                                              Timestamp,
                                                                              CancellationToken,
                                                                              EventTrackingId,
                                                                              RequestTimeout ?? IMobileClient.RequestTimeout));
Пример #2
0
            /// <summary>
            /// Create a new OICP Mobile client logger using the default logging delegates.
            /// </summary>
            /// <param name="MobileClient">A OICP Mobile client.</param>
            /// <param name="Context">A context of this API.</param>
            /// <param name="LogfileCreator">A delegate to create a log file from the given context and log file name.</param>
            public MobileClientLogger(IMobileClient MobileClient,
                                      String Context = DefaultContext,
                                      LogfileCreatorDelegate LogfileCreator = null)

                : this(MobileClient,
                       Context.IsNotNullOrEmpty() ? Context : DefaultContext,
                       null,
                       null,
                       null,
                       null,

                       LogfileCreator : LogfileCreator)

            {
            }
        MobileRemoteStop(this IMobileClient IMobileClient,
                         Session_Id SessionId,

                         DateTime?Timestamp = null,
                         CancellationToken?CancellationToken = null,
                         EventTracking_Id EventTrackingId    = null,
                         TimeSpan?RequestTimeout             = null)


        => IMobileClient.MobileRemoteStop(new MobileRemoteStopRequest(SessionId,

                                                                      Timestamp,
                                                                      CancellationToken,
                                                                      EventTrackingId,
                                                                      RequestTimeout ?? IMobileClient.RequestTimeout));
        MobileAuthorizeStart(this IMobileClient IMobileClient,
                             EVSE_Id EVSEId,
                             QRCodeIdentification QRCodeIdentification,
                             PartnerProduct_Id?PartnerProductId = null,
                             Boolean?GetNewSession = null,

                             DateTime?Timestamp = null,
                             CancellationToken?CancellationToken = null,
                             EventTracking_Id EventTrackingId    = null,
                             TimeSpan?RequestTimeout             = null)


        => IMobileClient.MobileAuthorizeStart(new MobileAuthorizeStartRequest(EVSEId,
                                                                              QRCodeIdentification,
                                                                              PartnerProductId,
                                                                              GetNewSession,

                                                                              Timestamp,
                                                                              CancellationToken,
                                                                              EventTrackingId,
                                                                              RequestTimeout ?? IMobileClient.RequestTimeout));
Пример #5
0
            /// <summary>
            /// Create a new OICP Mobile client logger using the given logging delegates.
            /// </summary>
            /// <param name="MobileClient">A OICP Mobile client.</param>
            /// <param name="Context">A context of this API.</param>
            ///
            /// <param name="LogHTTPRequest_toConsole">A delegate to log incoming HTTP requests to console.</param>
            /// <param name="LogHTTPResponse_toConsole">A delegate to log HTTP requests/responses to console.</param>
            /// <param name="LogHTTPRequest_toDisc">A delegate to log incoming HTTP requests to disc.</param>
            /// <param name="LogHTTPResponse_toDisc">A delegate to log HTTP requests/responses to disc.</param>
            ///
            /// <param name="LogHTTPRequest_toNetwork">A delegate to log incoming HTTP requests to a network target.</param>
            /// <param name="LogHTTPResponse_toNetwork">A delegate to log HTTP requests/responses to a network target.</param>
            /// <param name="LogHTTPRequest_toHTTPSSE">A delegate to log incoming HTTP requests to a HTTP client sent events source.</param>
            /// <param name="LogHTTPResponse_toHTTPSSE">A delegate to log HTTP requests/responses to a HTTP client sent events source.</param>
            ///
            /// <param name="LogHTTPError_toConsole">A delegate to log HTTP errors to console.</param>
            /// <param name="LogHTTPError_toDisc">A delegate to log HTTP errors to disc.</param>
            /// <param name="LogHTTPError_toNetwork">A delegate to log HTTP errors to a network target.</param>
            /// <param name="LogHTTPError_toHTTPSSE">A delegate to log HTTP errors to a HTTP client sent events source.</param>
            ///
            /// <param name="LogfileCreator">A delegate to create a log file from the given context and log file name.</param>
            public MobileClientLogger(IMobileClient MobileClient,
                                      String Context,

                                      HTTPRequestLoggerDelegate LogHTTPRequest_toConsole,
                                      HTTPResponseLoggerDelegate LogHTTPResponse_toConsole,
                                      HTTPRequestLoggerDelegate LogHTTPRequest_toDisc,
                                      HTTPResponseLoggerDelegate LogHTTPResponse_toDisc,

                                      HTTPRequestLoggerDelegate LogHTTPRequest_toNetwork   = null,
                                      HTTPResponseLoggerDelegate LogHTTPResponse_toNetwork = null,
                                      HTTPRequestLoggerDelegate LogHTTPRequest_toHTTPSSE   = null,
                                      HTTPResponseLoggerDelegate LogHTTPResponse_toHTTPSSE = null,

                                      HTTPResponseLoggerDelegate LogHTTPError_toConsole = null,
                                      HTTPResponseLoggerDelegate LogHTTPError_toDisc    = null,
                                      HTTPResponseLoggerDelegate LogHTTPError_toNetwork = null,
                                      HTTPResponseLoggerDelegate LogHTTPError_toHTTPSSE = null,

                                      LogfileCreatorDelegate LogfileCreator = null)

                : base(MobileClient,
                       Context.IsNotNullOrEmpty() ? Context : DefaultContext,

                       LogHTTPRequest_toConsole,
                       LogHTTPResponse_toConsole,
                       LogHTTPRequest_toDisc,
                       LogHTTPResponse_toDisc,

                       LogHTTPRequest_toNetwork,
                       LogHTTPResponse_toNetwork,
                       LogHTTPRequest_toHTTPSSE,
                       LogHTTPResponse_toHTTPSSE,

                       LogHTTPError_toConsole,
                       LogHTTPError_toDisc,
                       LogHTTPError_toNetwork,
                       LogHTTPError_toHTTPSSE,

                       LogfileCreator)

            {
                #region Initial checks

                this.MobileClient = MobileClient ?? throw new ArgumentNullException(nameof(MobileClient), "The given mobile client must not be null!");

                #endregion

                #region Register EVSE data/status push log events

                RegisterEvent("MobileAuthorizeStart",
                              handler => MobileClient.OnMobileAuthorizeStartSOAPRequest += handler,
                              handler => MobileClient.OnMobileAuthorizeStartSOAPRequest -= handler,
                              "Mobile", "Authorize", "AuthorizeStart", "Request", "All").
                RegisterDefaultConsoleLogTarget(this).
                RegisterDefaultDiscLogTarget(this);

                RegisterEvent("MobileAuthorizeStarted",
                              handler => MobileClient.OnMobileAuthorizeStartSOAPResponse += handler,
                              handler => MobileClient.OnMobileAuthorizeStartSOAPResponse -= handler,
                              "Mobile", "Authorize", "AuthorizeStart", "Response", "All").
                RegisterDefaultConsoleLogTarget(this).
                RegisterDefaultDiscLogTarget(this);


                RegisterEvent("MobileRemoteStart",
                              handler => MobileClient.OnMobileRemoteStartSOAPRequest += handler,
                              handler => MobileClient.OnMobileRemoteStartSOAPRequest -= handler,
                              "Mobile", "Remote", "RemoteStart", "Request", "All").
                RegisterDefaultConsoleLogTarget(this).
                RegisterDefaultDiscLogTarget(this);

                RegisterEvent("MobileRemoteStarted",
                              handler => MobileClient.OnMobileRemoteStartSOAPResponse += handler,
                              handler => MobileClient.OnMobileRemoteStartSOAPResponse -= handler,
                              "Mobile", "Remote", "RemoteStart", "Response", "All").
                RegisterDefaultConsoleLogTarget(this).
                RegisterDefaultDiscLogTarget(this);


                RegisterEvent("MobileRemoteStop",
                              handler => MobileClient.OnMobileRemoteStopSOAPRequest += handler,
                              handler => MobileClient.OnMobileRemoteStopSOAPRequest -= handler,
                              "Mobile", "Remote", "RemoteStop", "Request", "All").
                RegisterDefaultConsoleLogTarget(this).
                RegisterDefaultDiscLogTarget(this);

                RegisterEvent("MobileRemoteStopped",
                              handler => MobileClient.OnMobileRemoteStopSOAPResponse += handler,
                              handler => MobileClient.OnMobileRemoteStopSOAPResponse -= handler,
                              "Mobile", "Remote", "RemoteStop", "Response", "All").
                RegisterDefaultConsoleLogTarget(this).
                RegisterDefaultDiscLogTarget(this);

                #endregion
            }
Пример #6
0
 public AuthHandler(IMobileClient platformClient)
 {
     this.platformClient = platformClient;
 }