Ejemplo n.º 1
0
        /// <summary>
        /// Create a charging reservation.
        /// </summary>
        public ChargingReservation(ChargingReservation_Id ReservationId,
                                   DateTime Timestamp,
                                   DateTime StartTime,
                                   TimeSpan Duration,
                                   DateTime EndTime,
                                   TimeSpan ConsumedReservationTime,
                                   ChargingReservationLevel ReservationLevel,

                                   EVSP_Id ProviderId = null,
                                   eMA_Id eMAId       = null,

                                   RoamingNetwork RoamingNetwork        = null,
                                   ChargingPool_Id ChargingPoolId       = null,
                                   ChargingStation_Id ChargingStationId = null,
                                   EVSE_Id EVSEId = null,
                                   ChargingProduct_Id ChargingProductId = null,

                                   IEnumerable <Auth_Token> AuthTokens = null,
                                   IEnumerable <eMA_Id> eMAIds         = null,
                                   IEnumerable <UInt32> PINs           = null)

        {
            #region Initial checks

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

            #endregion

            this._ReservationId           = ReservationId;
            this._Timestamp               = Timestamp.ToUniversalTime();
            this._StartTime               = StartTime.ToUniversalTime();
            this._Duration                = Duration;
            this._EndTime                 = StartTime.ToUniversalTime() + Duration;
            this._ConsumedReservationTime = ConsumedReservationTime;
            this._ReservationLevel        = ReservationLevel;

            this._ProviderId = ProviderId;
            this._eMAId      = eMAId;

            this._RoamingNetwork    = RoamingNetwork;
            this._ChargingPoolId    = ChargingPoolId;
            this._ChargingStationId = ChargingStationId;
            this._EVSEId            = EVSEId;
            this._ChargingProductId = ChargingProductId;

            this._AuthTokens = AuthTokens != null ? new HashSet <Auth_Token>(AuthTokens) : new HashSet <Auth_Token>();
            this._eMAIds     = eMAIds != null ? new HashSet <eMA_Id>    (eMAIds)     : new HashSet <eMA_Id>();
            this._PINs       = PINs != null ? new HashSet <UInt32>    (PINs)       : new HashSet <UInt32>();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create a charging reservation.
        /// </summary>
        public ChargingReservation(ChargingReservation_Id Id,
                                   DateTime Timestamp,
                                   DateTime StartTime,
                                   TimeSpan Duration,
                                   DateTime EndTime,
                                   TimeSpan ConsumedReservationTime,
                                   ChargingReservationLevel ReservationLevel,

                                   eMobilityProvider_Id?ProviderId          = null,
                                   RemoteAuthentication StartAuthentication = null,

                                   RoamingNetwork_Id?RoamingNetworkId = null,
                                   ChargingStationOperator_Id?ChargingStationOperatorId = null,
                                   ChargingPool_Id?ChargingPoolId       = null,
                                   ChargingStation_Id?ChargingStationId = null,
                                   EVSE_Id?EVSEId = null,
                                   ChargingProduct ChargingProduct = null,

                                   IEnumerable <Auth_Token> AuthTokens      = null,
                                   IEnumerable <eMobilityAccount_Id> eMAIds = null,
                                   IEnumerable <UInt32> PINs = null,

                                   IEnumerable <ChargingReservation> SubReservations = null)

        {
            this.Id        = Id;
            this.Timestamp = Timestamp.ToUniversalTime();
            this.StartTime = StartTime.ToUniversalTime();
            this.Duration  = Duration;
            this.EndTime   = StartTime.ToUniversalTime() + Duration;
            this.ConsumedReservationTime = ConsumedReservationTime;
            this.ReservationLevel        = ReservationLevel;

            this.ProviderId          = ProviderId;
            this.StartAuthentication = StartAuthentication;

            this.RoamingNetworkId          = RoamingNetworkId;
            this.ChargingStationOperatorId = ChargingStationOperatorId;
            this.ChargingPoolId            = ChargingPoolId;
            this.ChargingStationId         = ChargingStationId;
            this.EVSEId          = EVSEId;
            this.ChargingProduct = ChargingProduct;

            this._AuthTokens = AuthTokens != null ? new HashSet <Auth_Token>         (AuthTokens)      : new HashSet <Auth_Token>();
            this._eMAIds     = eMAIds != null ? new HashSet <eMobilityAccount_Id>(eMAIds)          : new HashSet <eMobilityAccount_Id>();
            this._PINs       = PINs != null ? new HashSet <UInt32>             (PINs)            : new HashSet <UInt32>();

            this._SubReservations = SubReservations != null ? new HashSet <ChargingReservation>(SubReservations) : new HashSet <ChargingReservation>();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Create a charging reservation.
        /// </summary>
        public ChargingReservation(DateTime Timestamp,
                                   DateTime StartTime,
                                   TimeSpan Duration,
                                   DateTime EndTime,
                                   ChargingReservationLevel ReservationLevel,

                                   EVSP_Id ProviderId = null,
                                   eMA_Id eMAId       = null,

                                   RoamingNetwork RoamingNetwork        = null,
                                   ChargingPool_Id ChargingPoolId       = null,
                                   ChargingStation_Id ChargingStationId = null,
                                   EVSE_Id EVSEId = null,
                                   ChargingProduct_Id ChargingProductId = null,

                                   IEnumerable <Auth_Token> AuthTokens = null,
                                   IEnumerable <eMA_Id> eMAIds         = null,
                                   IEnumerable <UInt32> PINs           = null)

            : this(ChargingReservation_Id.New,
                   Timestamp,
                   StartTime,
                   Duration,
                   EndTime,
                   TimeSpan.FromSeconds(0),
                   ReservationLevel,

                   ProviderId,
                   eMAId,

                   RoamingNetwork,
                   ChargingPoolId,
                   ChargingStationId,
                   EVSEId,
                   ChargingProductId,

                   AuthTokens,
                   eMAIds,
                   PINs)

        {
        }
        Reserve(ChargingLocation ChargingLocation,
                ChargingReservationLevel ReservationLevel = ChargingReservationLevel.EVSE,
                DateTime?StartTime = null,
                TimeSpan?Duration  = null,
                ChargingReservation_Id?ReservationId      = null,
                eMobilityProvider_Id?ProviderId           = null,
                RemoteAuthentication RemoteAuthentication = null,
                ChargingProduct ChargingProduct           = null,
                IEnumerable <Auth_Token> AuthTokens       = null,
                IEnumerable <eMobilityAccount_Id> eMAIds  = null,
                IEnumerable <UInt32> PINs = null,

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

        {
            return(Task.FromResult(ReservationResult.OutOfService));
        }
Ejemplo n.º 5
0
        Reserve(ChargingLocation ChargingLocation,
                ChargingReservationLevel ReservationLevel = ChargingReservationLevel.EVSE,
                DateTime?StartTime = null,
                TimeSpan?Duration  = null,
                ChargingReservation_Id?ReservationId      = null,
                eMobilityProvider_Id?ProviderId           = null,
                RemoteAuthentication RemoteAuthentication = null,
                ChargingProduct ChargingProduct           = null,
                IEnumerable <Auth_Token> AuthTokens       = null,
                IEnumerable <eMobilityAccount_Id> eMAIds  = null,
                IEnumerable <UInt32> PINs = null,

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

        {
            if (_ANetworkChargingStation == null)
            {
                return(ReservationResult.OutOfService);
            }

            return(await _ANetworkChargingStation.
                   Reserve(ChargingLocation,
                           ReservationLevel,
                           StartTime,
                           Duration,
                           ReservationId,
                           ProviderId,
                           RemoteAuthentication,
                           ChargingProduct,
                           AuthTokens,
                           eMAIds,
                           PINs,

                           Timestamp,
                           CancellationToken,
                           EventTrackingId,
                           RequestTimeout));
        }
Ejemplo n.º 6
0
 public Task <ReservationResult> Reserve(ChargingLocation ChargingLocation, ChargingReservationLevel ReservationLevel = ChargingReservationLevel.EVSE, DateTime?StartTime = null, TimeSpan?Duration = null, ChargingReservation_Id?ReservationId = null, eMobilityProvider_Id?ProviderId = null, RemoteAuthentication RemoteAuthentication = null, ChargingProduct ChargingProduct = null, IEnumerable <Auth_Token> AuthTokens = null, IEnumerable <eMobilityAccount_Id> eMAIds = null, IEnumerable <uint> PINs = null, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null)
 {
     throw new NotImplementedException();
 }