PushEVSEStatus(this ICPOClient CPOClient, EVSEStatusRecord EVSEStatusRecord, Operator_Id OperatorId, String OperatorName, ActionTypes Action = ActionTypes.Update, DateTime? Timestamp = null, CancellationToken? CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan? RequestTimeout = null) => CPOClient.PushEVSEStatus( new PushEVSEStatusRequest( new OperatorEVSEStatus( new EVSEStatusRecord[] { EVSEStatusRecord }, OperatorId, OperatorName ), Action, Timestamp, CancellationToken, EventTrackingId, RequestTimeout ?? CPOClient.RequestTimeout));
SetEVSEBusyStatus(this ICPOClient CPOClient, Partner_Id PartnerId, Operator_Id OperatorId, EVSE_Id EVSEId, DateTime StatusEventDate, EVSEBusyStatusTypes BusyStatus, Transaction_Id?TransactionId = null, DateTime?BusyStatusUntil = null, String BusyStatusComment = null, HTTPRequest HTTPRequest = null, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null) => CPOClient.SetEVSEBusyStatus(new SetEVSEBusyStatusRequest(PartnerId, OperatorId, EVSEId, StatusEventDate, BusyStatus, TransactionId, BusyStatusUntil, BusyStatusComment, HTTPRequest, Timestamp, CancellationToken, EventTrackingId, RequestTimeout ?? CPOClient.RequestTimeout));
AuthorizeStart(this ICPOClient CPOClient, Operator_Id OperatorId, Identification Identification, EVSE_Id? EVSEId = null, PartnerProduct_Id? PartnerProductId = null, CPOPartnerSession_Id? CPOPartnerSessionId = null, JObject CustomData = null, DateTime? Timestamp = null, CancellationToken? CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan? RequestTimeout = null) => CPOClient.AuthorizeStart( new AuthorizeStartRequest( OperatorId, Identification, EVSEId, PartnerProductId, // PartnerProductId will not be shown in the Hubject portal! null, // SessionId will be ignored by Hubject! CPOPartnerSessionId, null, // EMPPartnerSessionId does not make much sense here! CustomData, Timestamp, CancellationToken, EventTrackingId, RequestTimeout ?? CPOClient.RequestTimeout));
GetServiceAuthorisation(this ICPOClient CPOClient, Partner_Id PartnerId, Operator_Id OperatorId, EVSE_Id EVSEId, User_Id UserId, Service_Id RequestedServiceId, Transaction_Id?TransactionId = null, PartnerServiceSession_Id?PartnerServiceSessionId = null, HTTPRequest HTTPRequest = null, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null) => CPOClient.GetServiceAuthorisation(new GetServiceAuthorisationRequest(PartnerId, OperatorId, EVSEId, UserId, RequestedServiceId, TransactionId, PartnerServiceSessionId, HTTPRequest, Timestamp, CancellationToken, EventTrackingId, RequestTimeout ?? CPOClient.RequestTimeout));
AuthorizeStop(this ICPOClient ICPOClient, Operator_Id OperatorId, Session_Id SessionId, UID UID, EVSE_Id?EVSEId = null, CPOPartnerSession_Id?CPOPartnerSessionId = null, EMPPartnerSession_Id?EMPPartnerSessionId = null, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null) => ICPOClient.AuthorizeStop(new AuthorizeStopRequest(OperatorId, SessionId, Identification.FromUID(UID), EVSEId, CPOPartnerSessionId, EMPPartnerSessionId, Timestamp, CancellationToken, EventTrackingId, RequestTimeout ?? ICPOClient.RequestTimeout));
PushEVSEData(this ICPOClient CPOClient, IEnumerable<EVSEDataRecord> EVSEDataRecords, Operator_Id OperatorId, String OperatorName, ActionTypes Action = ActionTypes.FullLoad, IncludeEVSEDataRecordsDelegate IncludeEVSEDataRecords = null, DateTime? Timestamp = null, CancellationToken? CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan? RequestTimeout = null) => CPOClient.PushEVSEData( new PushEVSEDataRequest( new OperatorEVSEData(IncludeEVSEDataRecords != null ? EVSEDataRecords.Where(evsedatarecord => IncludeEVSEDataRecords(evsedatarecord)) : EVSEDataRecords, OperatorId, OperatorName), Action, Timestamp, CancellationToken, EventTrackingId, RequestTimeout ?? CPOClient.RequestTimeout));
SendChargingNotificationsError(this ICPOClient CPOClient, Session_Id SessionId, Identification Identification, EVSE_Id EVSEId, ErrorClassTypes ErrorType, CPOPartnerSession_Id? CPOPartnerSessionId = null, EMPPartnerSession_Id? EMPPartnerSessionId = null, String ErrorAdditionalInfo = null, JObject CustomData = null, DateTime? Timestamp = null, CancellationToken? CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan? RequestTimeout = null) => CPOClient.SendChargingErrorNotification( new ChargingErrorNotificationRequest( SessionId, Identification, EVSEId, ErrorType, CPOPartnerSessionId, EMPPartnerSessionId, ErrorAdditionalInfo, CustomData, Timestamp, CancellationToken, EventTrackingId, RequestTimeout ?? CPOClient.RequestTimeout));
AuthorizeStop(this ICPOClient CPOClient, Operator_Id OperatorId, Session_Id SessionId, Identification Identification, EVSE_Id? EVSEId = null, CPOPartnerSession_Id? CPOPartnerSessionId = null, EMPPartnerSession_Id? EMPPartnerSessionId = null, JObject CustomData = null, DateTime? Timestamp = null, CancellationToken? CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan? RequestTimeout = null) => CPOClient.AuthorizeStop( new AuthorizeStopRequest( OperatorId, SessionId, Identification, EVSEId, CPOPartnerSessionId, EMPPartnerSessionId, CustomData, Timestamp, CancellationToken, EventTrackingId, RequestTimeout ?? CPOClient.RequestTimeout));
PushEVSEStatus(this ICPOClient ICPOClient, Operator_Id OperatorId, ActionTypes Action, params EVSEStatusRecord[] EVSEStatusRecords) => ICPOClient.PushEVSEStatus(new PushEVSEStatusRequest(new OperatorEVSEStatus(EVSEStatusRecords, OperatorId), Action: Action, RequestTimeout: ICPOClient.RequestTimeout));
SendChargingNotificationsEnd(this ICPOClient CPOClient, Session_Id SessionId, Identification Identification, EVSE_Id EVSEId, DateTime ChargingStart, DateTime ChargingEnd, CPOPartnerSession_Id? CPOPartnerSessionId = null, EMPPartnerSession_Id? EMPPartnerSessionId = null, DateTime? SessionStart = null, DateTime? SessionEnd = null, Decimal? ConsumedEnergy = null, Decimal? MeterValueStart = null, Decimal? MeterValueEnd = null, IEnumerable<Decimal> MeterValuesInBetween = null, Operator_Id? OperatorId = null, PartnerProduct_Id? PartnerProductId = null, DateTime? PenaltyTimeStart = null, JObject CustomData = null, DateTime? Timestamp = null, CancellationToken? CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan? RequestTimeout = null) => CPOClient.SendChargingEndNotification( new ChargingEndNotificationRequest( SessionId, Identification, EVSEId, ChargingStart, ChargingEnd, CPOPartnerSessionId, EMPPartnerSessionId, SessionStart, SessionEnd, ConsumedEnergy, MeterValueStart, MeterValueEnd, MeterValuesInBetween, OperatorId, PartnerProductId, PenaltyTimeStart, CustomData, Timestamp, CancellationToken, EventTrackingId, RequestTimeout ?? CPOClient.RequestTimeout));
PullAuthenticationData(this ICPOClient ICPOClient, Operator_Id OperatorId, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null) => ICPOClient.PullAuthenticationData(new PullAuthenticationDataRequest(OperatorId, Timestamp, CancellationToken, EventTrackingId, RequestTimeout ?? ICPOClient.RequestTimeout));
SendChargeDetailRecord(this ICPOClient ICPOClient, ChargeDetailRecord ChargeDetailRecord, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null) => ICPOClient.SendChargeDetailRecord(new SendChargeDetailRecordRequest(ChargeDetailRecord, Timestamp, CancellationToken, EventTrackingId, RequestTimeout ?? ICPOClient.RequestTimeout));
PushEVSEStatus(this ICPOClient CPOClient, Operator_Id OperatorId, String OperatorName, ActionTypes Action, params EVSEStatusRecord[] EVSEStatusRecords) => CPOClient.PushEVSEStatus( new PushEVSEStatusRequest( new OperatorEVSEStatus( EVSEStatusRecords, OperatorId, OperatorName ), Action, RequestTimeout: CPOClient.RequestTimeout));
PushEVSEStatus(this ICPOClient ICPOClient, OperatorEVSEStatus OperatorEVSEStatus, ActionTypes Action = ActionTypes.update, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null) => ICPOClient.PushEVSEStatus(new PushEVSEStatusRequest(OperatorEVSEStatus, Action, Timestamp, CancellationToken, EventTrackingId, RequestTimeout ?? ICPOClient.RequestTimeout));
PushEVSEData(this ICPOClient ICPOClient, OperatorEVSEData OperatorEVSEData, ActionTypes Action = ActionTypes.fullLoad, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null) => ICPOClient.PushEVSEData(new PushEVSEDataRequest(OperatorEVSEData, Action, Timestamp, CancellationToken, EventTrackingId, RequestTimeout ?? ICPOClient.RequestTimeout));
SendChargeDetailRecord(this ICPOClient CPOClient, ChargeDetailRecord ChargeDetailRecord, Operator_Id OperatorId, JObject CustomData = null, DateTime? Timestamp = null, CancellationToken? CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan? RequestTimeout = null) => CPOClient.SendChargeDetailRecord( new ChargeDetailRecordRequest( ChargeDetailRecord, OperatorId, CustomData, Timestamp, CancellationToken, EventTrackingId, RequestTimeout ?? CPOClient.RequestTimeout));
SendHeartbeat(this ICPOClient CPOClient, Partner_Id PartnerId, Operator_Id OperatorId, Transaction_Id?TransactionId = null, HTTPRequest HTTPRequest = null, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null) => CPOClient.SendHeartbeat(new HeartbeatRequest(PartnerId, OperatorId, TransactionId, HTTPRequest, Timestamp, CancellationToken, EventTrackingId, RequestTimeout ?? CPOClient.RequestTimeout));
PushEVSEData(this ICPOClient ICPOClient, EVSEDataRecord EVSEDataRecord, Operator_Id OperatorId, String OperatorName = null, ActionTypes Action = ActionTypes.insert, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null) => ICPOClient.PushEVSEData(new PushEVSEDataRequest(new OperatorEVSEData(new EVSEDataRecord[] { EVSEDataRecord }, OperatorId, OperatorName), Action, Timestamp, CancellationToken, EventTrackingId, RequestTimeout ?? ICPOClient.RequestTimeout));
SendChargingNotificationsStart(this ICPOClient CPOClient, Session_Id SessionId, Identification Identification, EVSE_Id EVSEId, DateTime ChargingStart, CPOPartnerSession_Id? CPOPartnerSessionId = null, EMPPartnerSession_Id? EMPPartnerSessionId = null, DateTime? SessionStart = null, Decimal? MeterValueStart = null, Operator_Id? OperatorId = null, PartnerProduct_Id? PartnerProductId = null, JObject CustomData = null, DateTime? Timestamp = null, CancellationToken? CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan? RequestTimeout = null) => CPOClient.SendChargingStartNotification( new ChargingStartNotificationRequest( SessionId, Identification, EVSEId, ChargingStart, CPOPartnerSessionId, EMPPartnerSessionId, SessionStart, MeterValueStart, OperatorId, PartnerProductId, CustomData, Timestamp, CancellationToken, EventTrackingId, RequestTimeout ?? CPOClient.RequestTimeout));
SetChargeDetailRecord(this ICPOClient CPOClient, Partner_Id PartnerId, Operator_Id OperatorId, ChargeDetailRecord ChargeDetailRecord, Transaction_Id?TransactionId = null, HTTPRequest HTTPRequest = null, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null) => CPOClient.SetChargeDetailRecord(new SetChargeDetailRecordRequest(PartnerId, OperatorId, ChargeDetailRecord, TransactionId, HTTPRequest, Timestamp, CancellationToken, EventTrackingId, RequestTimeout ?? CPOClient.RequestTimeout));
/// <summary> /// Create a new eMIP CPO client logger using the given logging delegates. /// </summary> /// <param name="CPOClient">An eMIP CPO client.</param> /// <param name="LoggingPath">The logging path.</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 Logger(ICPOClient CPOClient, String LoggingPath, 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(CPOClient, LoggingPath, 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.CPOClient = CPOClient ?? throw new ArgumentNullException(nameof(CPOClient), "The given CPO client must not be null!"); #endregion #region Register log events RegisterEvent("SendHeartbeatRequest", handler => CPOClient.OnSendHeartbeatSOAPRequest += handler, handler => CPOClient.OnSendHeartbeatSOAPRequest -= handler, "SendHeartbeat", "Heartbeat", "Request", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("SendHeartbeatResponse", handler => CPOClient.OnSendHeartbeatSOAPResponse += handler, handler => CPOClient.OnSendHeartbeatSOAPResponse -= handler, "SendHeartbeat", "Heartbeat", "Response", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("SetChargingPoolAvailabilityStatusRequest", handler => CPOClient.OnSetChargingPoolAvailabilityStatusSOAPRequest += handler, handler => CPOClient.OnSetChargingPoolAvailabilityStatusSOAPRequest -= handler, "SetChargingPoolAvailabilityStatus", "SetChargingPoolStatus", "ChargingPool", "AvailabilityStatus", "Status", "Request", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("SetChargingPoolAvailabilityStatusResponse", handler => CPOClient.OnSetChargingPoolAvailabilityStatusSOAPResponse += handler, handler => CPOClient.OnSetChargingPoolAvailabilityStatusSOAPResponse -= handler, "SetChargingPoolAvailabilityStatus", "SetChargingPoolStatus", "ChargingPool", "AvailabilityStatus", "Status", "Response", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("SetChargingStationAvailabilityStatusRequest", handler => CPOClient.OnSetChargingStationAvailabilityStatusSOAPRequest += handler, handler => CPOClient.OnSetChargingStationAvailabilityStatusSOAPRequest -= handler, "SetChargingStationAvailabilityStatus", "SetChargingStationStatus", "ChargingStation", "AvailabilityStatus", "Status", "Request", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("SetChargingStationAvailabilityStatusResponse", handler => CPOClient.OnSetChargingStationAvailabilityStatusSOAPResponse += handler, handler => CPOClient.OnSetChargingStationAvailabilityStatusSOAPResponse -= handler, "SetChargingStationAvailabilityStatus", "SetChargingStationStatus", "ChargingStation", "AvailabilityStatus", "Status", "Response", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("SetEVSEAvailabilityStatusRequest", handler => CPOClient.OnSetEVSEAvailabilityStatusSOAPRequest += handler, handler => CPOClient.OnSetEVSEAvailabilityStatusSOAPRequest -= handler, "SetEVSEAvailabilityStatus", "SetEVSEStatus", "EVSE", "AvailabilityStatus", "Status", "Request", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("SetEVSEAvailabilityStatusResponse", handler => CPOClient.OnSetEVSEAvailabilityStatusSOAPResponse += handler, handler => CPOClient.OnSetEVSEAvailabilityStatusSOAPResponse -= handler, "SetEVSEAvailabilityStatus", "SetEVSEStatus", "EVSE", "AvailabilityStatus", "Status", "Response", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("SetChargingConnectorAvailabilityStatusRequest", handler => CPOClient.OnSetChargingConnectorAvailabilityStatusSOAPRequest += handler, handler => CPOClient.OnSetChargingConnectorAvailabilityStatusSOAPRequest -= handler, "SetChargingConnectorAvailabilityStatus", "SetChargingConnectorStatus", "ChargingConnector", "AvailabilityStatus", "Status", "Request", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("SetChargingConnectorAvailabilityStatusResponse", handler => CPOClient.OnSetChargingConnectorAvailabilityStatusSOAPResponse += handler, handler => CPOClient.OnSetChargingConnectorAvailabilityStatusSOAPResponse -= handler, "SetChargingConnectorAvailabilityStatus", "SetChargingConnectorStatus", "ChargingConnector", "AvailabilityStatus", "Status", "Response", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("SetEVSEBusyStatusRequest", handler => CPOClient.OnSetEVSEBusyStatusSOAPRequest += handler, handler => CPOClient.OnSetEVSEBusyStatusSOAPRequest -= handler, "SetEVSEBusyStatus", "SetEVSEStatus", "EVSE", "BusyStatus", "Status", "Request", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("SetEVSEBusyStatusResponse", handler => CPOClient.OnSetEVSEBusyStatusSOAPResponse += handler, handler => CPOClient.OnSetEVSEBusyStatusSOAPResponse -= handler, "SetEVSEBusyStatus", "SetEVSEStatus", "EVSE", "BusyStatus", "Status", "Response", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("SetEVSESyntheticStatusRequest", handler => CPOClient.OnSetEVSESyntheticStatusSOAPRequest += handler, handler => CPOClient.OnSetEVSESyntheticStatusSOAPRequest -= handler, "SetEVSESyntheticStatus", "SetEVSEStatus", "EVSE", "SyntheticStatus", "Status", "Request", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("SetEVSESyntheticStatusResponse", handler => CPOClient.OnSetEVSESyntheticStatusSOAPResponse += handler, handler => CPOClient.OnSetEVSESyntheticStatusSOAPResponse -= handler, "SetEVSESyntheticStatus", "SetEVSEStatus", "EVSE", "SyntheticStatus", "Status", "Response", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("GetServiceAuthorisationRequest", handler => CPOClient.OnGetServiceAuthorisationSOAPRequest += handler, handler => CPOClient.OnGetServiceAuthorisationSOAPRequest -= handler, "GetServiceAuthorisation", "Authorisation", "Request", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("GetServiceAuthorisationResponse", handler => CPOClient.OnGetServiceAuthorisationSOAPResponse += handler, handler => CPOClient.OnGetServiceAuthorisationSOAPResponse -= handler, "GetServiceAuthorisation", "Authorisation", "Response", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("SetSessionEventReportRequest", handler => CPOClient.OnSetSessionEventReportSOAPRequest += handler, handler => CPOClient.OnSetSessionEventReportSOAPRequest -= handler, "SetSessionEventReport", "Authorisation", "Request", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("SetSessionEventReportResponse", handler => CPOClient.OnSetSessionEventReportSOAPResponse += handler, handler => CPOClient.OnSetSessionEventReportSOAPResponse -= handler, "SetSessionEventReport", "Authorisation", "Response", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("SetChargeDetailRecordRequest", handler => CPOClient.OnSetChargeDetailRecordSOAPRequest += handler, handler => CPOClient.OnSetChargeDetailRecordSOAPRequest -= handler, "SetChargeDetailRecord", "ChargeDetailRecord", "CDR", "Request", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("SetChargeDetailRecordResponse", handler => CPOClient.OnSetChargeDetailRecordSOAPResponse += handler, handler => CPOClient.OnSetChargeDetailRecordSOAPResponse -= handler, "SetChargeDetailRecord", "ChargeDetailRecord", "CDR", "Response", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); #endregion }
/// <summary> /// Create a new OICP CPO client logger using the given logging delegates. /// </summary> /// <param name="CPOClient">A OICP CPO 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 CPOClientLogger(ICPOClient CPOClient, 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(CPOClient, 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.CPOClient = CPOClient ?? throw new ArgumentNullException(nameof(CPOClient), "The given CPO client must not be null!"); #endregion #region Register log events // PushData/-Status RegisterEvent("PushEVSEDataRequest", handler => CPOClient.OnPushEVSEDataSOAPRequest += handler, handler => CPOClient.OnPushEVSEDataSOAPRequest -= handler, "PushEVSEData", "EVSE", "EVSEData", "Request", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("PushEVSEDataResponse", handler => CPOClient.OnPushEVSEDataSOAPResponse += handler, handler => CPOClient.OnPushEVSEDataSOAPResponse -= handler, "PushEVSEData", "EVSE", "EVSEData", "Response", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("PushEVSEStatusRequest", handler => CPOClient.OnPushEVSEStatusSOAPRequest += handler, handler => CPOClient.OnPushEVSEStatusSOAPRequest -= handler, "PushEVSEStatus", "EVSE", "AuthorizationStart", "Request", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("PushEVSEStatusResponse", handler => CPOClient.OnPushEVSEStatusSOAPResponse += handler, handler => CPOClient.OnPushEVSEStatusSOAPResponse -= handler, "PushEVSEStatus", "EVSE", "AuthorizationStart", "Response", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); // AuthorizeStart/-Stop RegisterEvent("AuthorizeStartRequest", handler => CPOClient.OnAuthorizeStartSOAPRequest += handler, handler => CPOClient.OnAuthorizeStartSOAPRequest -= handler, "AuthorizeStart", "Authorize", "Request", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("AuthorizeStartResponse", handler => CPOClient.OnAuthorizeStartSOAPResponse += handler, handler => CPOClient.OnAuthorizeStartSOAPResponse -= handler, "AuthorizeStart", "Authorize", "Response", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("AuthorizeStopRequest", handler => CPOClient.OnAuthorizeStopSOAPRequest += handler, handler => CPOClient.OnAuthorizeStopSOAPRequest -= handler, "AuthorizeStop", "Authorize", "Request", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("AuthorizeStopResponse", handler => CPOClient.OnAuthorizeStopSOAPResponse += handler, handler => CPOClient.OnAuthorizeStopSOAPResponse -= handler, "AuthorizeStop", "Authorize", "Response", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); // SendCDR / PullAuthenticationData RegisterEvent("SendChargeDetailRecordRequest", handler => CPOClient.OnSendChargeDetailRecordSOAPRequest += handler, handler => CPOClient.OnSendChargeDetailRecordSOAPRequest -= handler, "SendChargeDetailRecord", "ChargeDetailRecord", "CDR", "Request", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("SendChargeDetailRecordResponse", handler => CPOClient.OnSendChargeDetailRecordSOAPResponse += handler, handler => CPOClient.OnSendChargeDetailRecordSOAPResponse -= handler, "SendChargeDetailRecord", "ChargeDetailRecord", "CDR", "Response", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("PullAuthenticationDataRequest", handler => CPOClient.OnPullAuthenticationDataSOAPRequest += handler, handler => CPOClient.OnPullAuthenticationDataSOAPRequest -= handler, "PullAuthenticationData", "AuthenticationData", "Request", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); RegisterEvent("PullAuthenticationDataResponse", handler => CPOClient.OnPullAuthenticationDataSOAPResponse += handler, handler => CPOClient.OnPullAuthenticationDataSOAPResponse -= handler, "PullAuthenticationData", "AuthenticationData", "Response", "All"). RegisterDefaultConsoleLogTarget(this). RegisterDefaultDiscLogTarget(this); #endregion }