Пример #1
0
        CreateeMIPv0_7_4_CSORoamingProvider(this RoamingNetwork RoamingNetwork,
                                            EMPRoamingProvider_Id Id,
                                            I18NString Name,
                                            I18NString Description,
                                            CPORoaming CPORoaming,

                                            eMIPv0_7_4.Partner_Id PartnerId,
                                            ChargingStationOperator DefaultOperator,

                                            WWCPChargeDetailRecord2ChargeDetailRecordDelegate WWCPChargeDetailRecord2eMIPChargeDetailRecord = null,

                                            IncludeEVSEIdDelegate IncludeEVSEIds = null,
                                            IncludeEVSEDelegate IncludeEVSEs     = null,
                                            IncludeChargingStationIdDelegate IncludeChargingStationIds = null,
                                            IncludeChargingStationDelegate IncludeChargingStations     = null,
                                            IncludeChargingPoolIdDelegate IncludeChargingPoolIds       = null,
                                            IncludeChargingPoolDelegate IncludeChargingPools           = null,
                                            ChargeDetailRecordFilterDelegate ChargeDetailRecordFilter  = null,
                                            CustomOperatorIdMapperDelegate CustomOperatorIdMapper      = null,
                                            CustomEVSEIdMapperDelegate CustomEVSEIdMapper = null,

                                            TimeSpan?SendHeartbeatsEvery = null,
                                            TimeSpan?ServiceCheckEvery   = null,
                                            TimeSpan?StatusCheckEvery    = null,
                                            TimeSpan?CDRCheckEvery       = null,

                                            Boolean DisableSendHeartbeats          = false,
                                            Boolean DisablePushData                = false,
                                            Boolean DisablePushStatus              = false,
                                            Boolean DisableAuthentication          = false,
                                            Boolean DisableSendChargeDetailRecords = false,

                                            Action <eMIPv0_7_4.CPO.WWCPCPOAdapter> eMIPConfigurator = null,
                                            Action <IEMPRoamingProvider> Configurator = null,

                                            String EllipticCurve = "P-256",
                                            ECPrivateKeyParameters PrivateKey           = null,
                                            PublicKeyCertificates PublicKeyCertificates = null,

                                            CounterValues?CPOClientSendHeartbeatCounter = null,
                                            CounterValues?CPOClientSetChargingPoolAvailabilityStatusCounter      = null,
                                            CounterValues?CPOClientSetChargingStationAvailabilityStatusCounter   = null,
                                            CounterValues?CPOClientSetEVSEAvailabilityStatusCounter              = null,
                                            CounterValues?CPOClientSetChargingConnectorAvailabilityStatusCounter = null,
                                            CounterValues?CPOClientSetEVSEBusyStatusCounter       = null,
                                            CounterValues?CPOClientSetEVSESyntheticStatusCounter  = null,
                                            CounterValues?CPOClientGetServiceAuthorisationCounter = null,
                                            CounterValues?CPOClientSetSessionEventReportCounter   = null,
                                            CounterValues?CPOClientSetChargeDetailRecordCounter   = null)

        {
            #region Initial checks

            if (RoamingNetwork == null)
            {
                throw new ArgumentNullException(nameof(RoamingNetwork), "The given roaming network must not be null!");
            }

            if (Id == null)
            {
                throw new ArgumentNullException(nameof(Id), "The given unique roaming provider identification must not be null!");
            }

            if (Name.IsNullOrEmpty())
            {
                throw new ArgumentNullException(nameof(Name), "The given roaming provider name must not be null or empty!");
            }

            if (CPORoaming is null)
            {
                throw new ArgumentNullException(nameof(CPORoaming), "The given CPO roaming must not be null!");
            }

            #endregion

            var NewRoamingProvider = new WWCPCPOAdapter(Id,
                                                        Name,
                                                        Description,
                                                        RoamingNetwork,
                                                        CPORoaming,

                                                        PartnerId,
                                                        DefaultOperator,

                                                        IncludeEVSEIds,
                                                        IncludeEVSEs,
                                                        IncludeChargingStationIds,
                                                        IncludeChargingStations,
                                                        IncludeChargingPoolIds,
                                                        IncludeChargingPools,
                                                        ChargeDetailRecordFilter,
                                                        CustomOperatorIdMapper,
                                                        CustomEVSEIdMapper,

                                                        //EVSE2EVSEDataRecord,
                                                        //EVSEStatusUpdate2EVSEStatusRecord,
                                                        WWCPChargeDetailRecord2eMIPChargeDetailRecord,

                                                        SendHeartbeatsEvery,
                                                        ServiceCheckEvery,
                                                        StatusCheckEvery,
                                                        CDRCheckEvery,

                                                        DisableSendHeartbeats,
                                                        DisablePushData,
                                                        DisablePushStatus,
                                                        DisableAuthentication,
                                                        DisableSendChargeDetailRecords,

                                                        EllipticCurve,
                                                        PrivateKey,
                                                        PublicKeyCertificates);

            eMIPConfigurator?.Invoke(NewRoamingProvider);

            return(RoamingNetwork.
                   CreateNewRoamingProvider(NewRoamingProvider,
                                            Configurator) as WWCPCPOAdapter);
        }
Пример #2
0
        CreateOICPv2_3_EMPRoamingProvider(this RoamingNetwork RoamingNetwork,
                                          EMPRoamingProvider_Id Id,
                                          I18NString Name,
                                          I18NString Description,
                                          OICPv2_3.CPO.CPORoaming CPORoaming,

                                          OICPv2_3.EVSE2EVSEDataRecordDelegate EVSE2EVSEDataRecord = null,
                                          OICPv2_3.EVSEStatusUpdate2EVSEStatusRecordDelegate EVSEStatusUpdate2EVSEStatusRecord = null,
                                          OICPv2_3.WWCPChargeDetailRecord2ChargeDetailRecordDelegate WWCPChargeDetailRecord2OICPChargeDetailRecord = null,

                                          ChargingStationOperator DefaultOperator   = null,
                                          OperatorIdFormats DefaultOperatorIdFormat = OperatorIdFormats.ISO_STAR,
                                          ChargingStationOperatorNameSelectorDelegate OperatorNameSelector = null,

                                          IncludeEVSEIdDelegate IncludeEVSEIds = null,
                                          IncludeEVSEDelegate IncludeEVSEs     = null,
                                          ChargeDetailRecordFilterDelegate ChargeDetailRecordFilter = null,
                                          //CustomEVSEIdMapperDelegate                                  CustomEVSEIdMapper                              = null,

                                          TimeSpan?ServiceCheckEvery = null,
                                          TimeSpan?StatusCheckEvery  = null,
                                          TimeSpan?CDRCheckEvery     = null,

                                          Boolean DisablePushData                = false,
                                          Boolean DisablePushStatus              = false,
                                          Boolean DisableAuthentication          = false,
                                          Boolean DisableSendChargeDetailRecords = false,

                                          Action <OICPv2_3.CPO.WWCPEMPAdapter> OICPConfigurator = null,
                                          Action <IEMPRoamingProvider> Configurator             = null,

                                          String EllipticCurve = "P-256",
                                          ECPrivateKeyParameters PrivateKey           = null,
                                          PublicKeyCertificates PublicKeyCertificates = null)

        {
            #region Initial checks

            if (Id == null)
            {
                throw new ArgumentNullException(nameof(Id), "The given unique roaming provider identification must not be null!");
            }

            if (Name.IsNullOrEmpty())
            {
                throw new ArgumentNullException(nameof(Name), "The given roaming provider name must not be null or empty!");
            }

            if (RoamingNetwork == null)
            {
                throw new ArgumentNullException(nameof(RoamingNetwork), "The given roaming network must not be null!");
            }

            if (CPORoaming == null)
            {
                throw new ArgumentNullException(nameof(CPORoaming), "The given CPORoaming must not be null!");
            }

            #endregion

            var NewRoamingProvider = new OICPv2_3.CPO.WWCPEMPAdapter(Id,
                                                                     Name,
                                                                     Description,
                                                                     RoamingNetwork,
                                                                     CPORoaming,

                                                                     EVSE2EVSEDataRecord,
                                                                     EVSEStatusUpdate2EVSEStatusRecord,
                                                                     WWCPChargeDetailRecord2OICPChargeDetailRecord,

                                                                     DefaultOperator,
                                                                     DefaultOperatorIdFormat,
                                                                     OperatorNameSelector,

                                                                     IncludeEVSEIds,
                                                                     IncludeEVSEs,
                                                                     ChargeDetailRecordFilter,
                                                                     //CustomEVSEIdMapper,

                                                                     ServiceCheckEvery,
                                                                     StatusCheckEvery,
                                                                     CDRCheckEvery,

                                                                     DisablePushData,
                                                                     DisablePushStatus,
                                                                     DisableAuthentication,
                                                                     DisableSendChargeDetailRecords,

                                                                     EllipticCurve,
                                                                     PrivateKey,
                                                                     PublicKeyCertificates);

            OICPConfigurator?.Invoke(NewRoamingProvider);

            return(RoamingNetwork.
                   CreateNewRoamingProvider(NewRoamingProvider,
                                            Configurator) as OICPv2_3.CPO.WWCPEMPAdapter);
        }