Example #1
0
 public static SendCDRResult Error(Authorizator_Id AuthorizatorId,
                                   String Description = null)
 {
     return(new SendCDRResult(SendCDRResultType.Error,
                              AuthorizatorId,
                              Description));
 }
Example #2
0
 public static SendCDRResult UnknownEVSE(Authorizator_Id AuthorizatorId,
                                         String Description = null)
 {
     return(new SendCDRResult(SendCDRResultType.UnknownEVSE,
                              AuthorizatorId,
                              Description));
 }
Example #3
0
 public static SendCDRResult OutOfService(Authorizator_Id AuthorizatorId,
                                          String Description = null)
 {
     return(new SendCDRResult(SendCDRResultType.OutOfService,
                              AuthorizatorId,
                              Description));
 }
Example #4
0
 public static SendCDRResult InvalidSessionId(Authorizator_Id AuthorizatorId,
                                              String Description = null)
 {
     return(new SendCDRResult(SendCDRResultType.InvalidSessionId,
                              AuthorizatorId,
                              Description != null ? Description : "Invalid session identification!"));
 }
Example #5
0
 public static SendCDRResult NotForwared(Authorizator_Id AuthorizatorId,
                                         String Description = null)
 {
     return(new SendCDRResult(SendCDRResultType.NotForwared,
                              AuthorizatorId,
                              Description));
 }
Example #6
0
 private SendCDRResult(SendCDRResultType Result,
                       Authorizator_Id AuthorizatorId,
                       String Description = null)
 {
     this._AuthorizatorId = AuthorizatorId;
     this._Status         = Result;
     this._Description    = Description;
 }
 /// <summary>
 /// The authorize start operation is not allowed (ev customer is blocked).
 /// </summary>
 /// <param name="AuthorizatorId">An authorizator identification.</param>
 /// <param name="ProviderId">The unique identification of the ev service provider.</param>
 /// <param name="Description">An optional description of the auth start result.</param>
 /// <param name="AdditionalInfo">An optional additional message.</param>
 public static AuthStopChargingStationResult Blocked(Authorizator_Id AuthorizatorId,
                                                     EVSP_Id ProviderId,
                                                     String Description    = null,
                                                     String AdditionalInfo = null)
 {
     return(new AuthStopChargingStationResult(AuthorizatorId,
                                              AuthStopChargingStationResultType.Blocked,
                                              ProviderId,
                                              Description,
                                              AdditionalInfo));
 }
Example #8
0
 /// <summary>
 /// The authorize start was not successful (e.g. ev customer is unkown).
 /// </summary>
 /// <param name="AuthorizatorId">An authorizator identification.</param>
 /// <param name="ProviderId">The unique identification of the ev service provider.</param>
 /// <param name="Description">An optional description of the auth start result.</param>
 /// <param name="AdditionalInfo">An optional additional message.</param>
 public static AuthStartResult NotAuthorized(Authorizator_Id AuthorizatorId,
                                             EVSP_Id ProviderId,
                                             String Description    = null,
                                             String AdditionalInfo = null)
 {
     return(new AuthStartResult(AuthorizatorId,
                                AuthStartResultType.NotAuthorized,
                                ProviderId,
                                Description,
                                AdditionalInfo));
 }
        /// <summary>
        /// Create a new authorize stop result.
        /// </summary>
        /// <param name="AuthorizatorId">An authorizator identification.</param>
        /// <param name="ErrorMessage">An error message.</param>
        private AuthStopChargingStationResult(Authorizator_Id AuthorizatorId,
                                              String ErrorMessage = null)
        {
            #region Initial checks

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

            #endregion

            this._Result         = AuthStopChargingStationResultType.Error;
            this._AuthorizatorId = AuthorizatorId;
            this._Description    = ErrorMessage != null ? ErrorMessage : String.Empty;
        }
 /// <summary>
 /// The authorize start was successful.
 /// </summary>
 /// <param name="AuthorizatorId">An authorizator identification.</param>
 /// <param name="SessionId">The charging session identification for the authorize start operation.</param>
 /// <param name="ProviderId">The unique identification of the ev service provider.</param>
 /// <param name="Description">An optional description of the auth start result.</param>
 /// <param name="AdditionalInfo">An optional additional message.</param>
 /// <param name="ListOfAuthStopTokens">An optional enumeration of authorize stop tokens.</param>
 /// <param name="ListOfAuthStopPINs">An optional enumeration of authorize stop PINs.</param>
 public static AuthStartChargingStationResult Authorized(Authorizator_Id AuthorizatorId,
                                                         ChargingSession_Id SessionId,
                                                         EVSP_Id ProviderId,
                                                         String Description    = null,
                                                         String AdditionalInfo = null,
                                                         IEnumerable <Auth_Token> ListOfAuthStopTokens = null,
                                                         IEnumerable <UInt32> ListOfAuthStopPINs       = null)
 {
     return(new AuthStartChargingStationResult(AuthorizatorId,
                                               SessionId,
                                               ProviderId,
                                               Description,
                                               AdditionalInfo,
                                               ListOfAuthStopTokens,
                                               ListOfAuthStopPINs));
 }
        /// <summary>
        /// Create a new remote start result.
        /// </summary>
        /// <param name="AuthorizatorId">An authorizator identification.</param>
        /// <param name="ErrorMessage">An error message.</param>
        private AuthStartChargingStationResult(Authorizator_Id AuthorizatorId,
                                               String ErrorMessage = null)
        {
            #region Initial checks

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

            #endregion

            this._Result               = AuthStartChargingStationResultType.Error;
            this._AuthorizatorId       = AuthorizatorId;
            this._Description          = ErrorMessage != null ? ErrorMessage         : String.Empty;
            this._ListOfAuthStopTokens = ListOfAuthStopTokens != null ? ListOfAuthStopTokens : new Auth_Token[0];
            this._ListOfAuthStopPINs   = ListOfAuthStopPINs != null ? ListOfAuthStopPINs   : new UInt32[0];
        }
        /// <summary>
        /// Create a new authorize stop result.
        /// </summary>
        /// <param name="AuthorizatorId">The identification of the authorizing entity.</param>
        /// <param name="Result">The authorize stop result type.</param>
        /// <param name="ProviderId">An optional identification of the ev service provider.</param>
        /// <param name="Description">An optional description of the auth stop result.</param>
        /// <param name="AdditionalInfo">An optional additional message.</param>
        private AuthStopChargingStationResult(Authorizator_Id AuthorizatorId,
                                              AuthStopChargingStationResultType Result,
                                              EVSP_Id ProviderId    = null,
                                              String Description    = null,
                                              String AdditionalInfo = null)
        {
            #region Initial checks

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

            #endregion

            this._AuthorizatorId = AuthorizatorId;
            this._Result         = Result;
            this._ProviderId     = ProviderId;
            this._Description    = Description != null ? Description    : String.Empty;
            this._AdditionalInfo = AdditionalInfo != null ? AdditionalInfo : String.Empty;
        }
Example #13
0
        /// <summary>
        /// Create and register a new roaming network having the given
        /// unique roaming network identification.
        /// </summary>
        /// <param name="RoamingNetworkId">The unique identification of the new roaming network.</param>
        /// <param name="AuthorizatorId">The unique identification for the Auth service.</param>
        /// <param name="Description">A multilanguage description of the roaming network.</param>
        /// <param name="Action">An optional delegate to configure the new EVSE operator after its creation.</param>
        public RoamingNetwork CreateNewRoamingNetwork(RoamingNetwork_Id RoamingNetworkId,
                                                      Authorizator_Id AuthorizatorId = null,
                                                      I18NString Description         = null,
                                                      Action <RoamingNetwork> Action = null)
        {
            #region Initial checks

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

            if (_RoamingNetworks.ContainsKey(RoamingNetworkId))
            {
                throw new RoamingNetworkAlreadyExists(RoamingNetworkId);
            }

            #endregion

            var _RoamingNetwork = new RoamingNetwork(RoamingNetworkId, AuthorizatorId)
            {
                Description = Description
            };

            Action.FailSafeInvoke(_RoamingNetwork);

            if (RoamingNetworkAddition.SendVoting(this, _RoamingNetwork))
            {
                if (_RoamingNetworks.TryAdd(RoamingNetworkId, _RoamingNetwork))
                {
                    RoamingNetworkAddition.SendNotification(this, _RoamingNetwork);
                    return(_RoamingNetwork);
                }
            }

            throw new Exception();
        }
        /// <summary>
        /// Create a new successful authorize start result.
        /// </summary>
        /// <param name="AuthorizatorId">The identification of the authorizing entity.</param>
        /// <param name="SessionId">The charging session identification for the authorize start operation.</param>
        /// <param name="ProviderId">The unique identification of the ev service provider.</param>
        /// <param name="Description">An optional description of the auth start result.</param>
        /// <param name="AdditionalInfo">An optional additional message.</param>
        /// <param name="ListOfAuthStopTokens">An optional enumeration of authorize stop tokens.</param>
        /// <param name="ListOfAuthStopPINs">An optional enumeration of authorize stop PINs.</param>
        private AuthStartChargingStationResult(Authorizator_Id AuthorizatorId,
                                               ChargingSession_Id SessionId,
                                               EVSP_Id ProviderId,
                                               String Description    = null,
                                               String AdditionalInfo = null,
                                               IEnumerable <Auth_Token> ListOfAuthStopTokens = null,
                                               IEnumerable <UInt32> ListOfAuthStopPINs       = null)
        {
            #region Initial checks

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

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

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

            #endregion

            this._Result               = AuthStartChargingStationResultType.Authorized;
            this._AuthorizatorId       = AuthorizatorId;
            this._SessionId            = SessionId;
            this._ProviderId           = ProviderId;
            this._Description          = Description != null ? Description          : String.Empty;
            this._AdditionalInfo       = AdditionalInfo != null ? AdditionalInfo       : String.Empty;
            this._ListOfAuthStopTokens = ListOfAuthStopTokens != null ? ListOfAuthStopTokens : new Auth_Token[0];
            this._ListOfAuthStopPINs   = ListOfAuthStopPINs != null ? ListOfAuthStopPINs   : new UInt32[0];
        }
Example #15
0
 /// <summary>
 /// The EVSE is unknown.
 /// </summary>
 public static AuthStopEVSEResult UnknownEVSE(Authorizator_Id AuthorizatorId)
 {
     return(new AuthStopEVSEResult(AuthorizatorId,
                                   AuthStopEVSEResultType.UnknownEVSE));
 }
 /// <summary>
 /// The charging station is reserved.
 /// </summary>
 public static AuthStartChargingStationResult Reserved(Authorizator_Id AuthorizatorId)
 {
     return(new AuthStartChargingStationResult(AuthorizatorId,
                                               AuthStartChargingStationResultType.Reserved));
 }
Example #17
0
 /// <summary>
 /// The authorize start operation led to an error.
 /// </summary>
 /// <param name="AuthorizatorId">An authorizator identification.</param>
 /// <param name="ErrorMessage">An error message.</param>
 public static AuthStartEVSEResult Error(Authorizator_Id AuthorizatorId,
                                         String ErrorMessage = null)
 {
     return(new AuthStartEVSEResult(AuthorizatorId,
                                    ErrorMessage));
 }
 /// <summary>
 /// The authorize stop ran into a timeout between charging station and ev.
 /// </summary>
 public static AuthStopChargingStationResult StartChargingTimeout(Authorizator_Id AuthorizatorId)
 {
     return(new AuthStopChargingStationResult(AuthorizatorId,
                                              AuthStopChargingStationResultType.StopChargingTimeout));
 }
Example #19
0
 public static SendCDRResult Forwarded(Authorizator_Id AuthorizatorId)
 {
     return(new SendCDRResult(SendCDRResultType.Forwarded, AuthorizatorId));
 }
 /// <summary>
 /// The given charging session identification is unknown or invalid.
 /// </summary>
 public static AuthStopChargingStationResult InvalidSessionId(Authorizator_Id AuthorizatorId)
 {
     return(new AuthStopChargingStationResult(AuthorizatorId,
                                              AuthStopChargingStationResultType.InvalidSessionId));
 }
 /// <summary>
 /// The result is unknown and/or should be ignored.
 /// </summary>
 public static AuthStopChargingStationResult Unspecified(Authorizator_Id AuthorizatorId)
 {
     return(new AuthStopChargingStationResult(AuthorizatorId,
                                              AuthStopChargingStationResultType.Unspecified));
 }
Example #22
0
 /// <summary>
 /// The result is unknown and/or should be ignored.
 /// </summary>
 public static AuthStopEVSEResult Unspecified(Authorizator_Id AuthorizatorId)
 {
     return(new AuthStopEVSEResult(AuthorizatorId,
                                   AuthStopEVSEResultType.Unspecified));
 }
 /// <summary>
 /// The charging station is unknown.
 /// </summary>
 public static AuthStopChargingStationResult UnknownChargingStation(Authorizator_Id AuthorizatorId)
 {
     return(new AuthStopChargingStationResult(AuthorizatorId,
                                              AuthStopChargingStationResultType.UnknownChargingStation));
 }
Example #24
0
 /// <summary>
 /// The EVSE is out of service.
 /// </summary>
 public static AuthStopEVSEResult OutOfService(Authorizator_Id AuthorizatorId)
 {
     return(new AuthStopEVSEResult(AuthorizatorId,
                                   AuthStopEVSEResultType.OutOfService));
 }
 /// <summary>
 /// The charging station is out of service.
 /// </summary>
 public static AuthStopChargingStationResult OutOfService(Authorizator_Id AuthorizatorId)
 {
     return(new AuthStopChargingStationResult(AuthorizatorId,
                                              AuthStopChargingStationResultType.OutOfService));
 }
Example #26
0
 /// <summary>
 /// The authorize stop ran into a timeout between evse operator backend and evse.
 /// </summary>
 public static AuthStopEVSEResult EVSECommunicationTimeout(Authorizator_Id AuthorizatorId)
 {
     return(new AuthStopEVSEResult(AuthorizatorId,
                                   AuthStopEVSEResultType.EVSECommunicationTimeout));
 }
 /// <summary>
 /// The authorize stop ran into a timeout between evse operator backend and charging station.
 /// </summary>
 public static AuthStopChargingStationResult ChargingStationCommunicationTimeout(Authorizator_Id AuthorizatorId)
 {
     return(new AuthStopChargingStationResult(AuthorizatorId,
                                              AuthStopChargingStationResultType.ChargingStationCommunicationTimeout));
 }
Example #28
0
 /// <summary>
 /// The authorize stop ran into a timeout between evse operator backend and charging station.
 /// </summary>
 public static AuthStartResult CommunicationTimeout(Authorizator_Id AuthorizatorId)
 {
     return(new AuthStartResult(AuthorizatorId,
                                AuthStartResultType.CommunicationTimeout));
 }
 /// <summary>
 /// The authorize stop operation led to an error.
 /// </summary>
 /// <param name="AuthorizatorId">An authorizator identification.</param>
 /// <param name="ErrorMessage">An error message.</param>
 public static AuthStopChargingStationResult Error(Authorizator_Id AuthorizatorId,
                                                   String ErrorMessage = null)
 {
     return(new AuthStopChargingStationResult(AuthorizatorId,
                                              ErrorMessage));
 }
Example #30
0
 /// <summary>
 /// The EVSE is reserved.
 /// </summary>
 public static AuthStartEVSEResult Reserved(Authorizator_Id AuthorizatorId)
 {
     return(new AuthStartEVSEResult(AuthorizatorId,
                                    AuthStartEVSEResultType.Reserved));
 }