コード例 #1
0
ファイル: SendCDRResult.cs プロジェクト: rewatt/WWCP_Core
 public static SendCDRResult Error(Authorizator_Id AuthorizatorId,
                                   String Description = null)
 {
     return(new SendCDRResult(SendCDRResultType.Error,
                              AuthorizatorId,
                              Description));
 }
コード例 #2
0
ファイル: SendCDRResult.cs プロジェクト: rewatt/WWCP_Core
 public static SendCDRResult UnknownEVSE(Authorizator_Id AuthorizatorId,
                                         String Description = null)
 {
     return(new SendCDRResult(SendCDRResultType.UnknownEVSE,
                              AuthorizatorId,
                              Description));
 }
コード例 #3
0
ファイル: SendCDRResult.cs プロジェクト: rewatt/WWCP_Core
 public static SendCDRResult OutOfService(Authorizator_Id AuthorizatorId,
                                          String Description = null)
 {
     return(new SendCDRResult(SendCDRResultType.OutOfService,
                              AuthorizatorId,
                              Description));
 }
コード例 #4
0
ファイル: SendCDRResult.cs プロジェクト: rewatt/WWCP_Core
 public static SendCDRResult InvalidSessionId(Authorizator_Id AuthorizatorId,
                                              String Description = null)
 {
     return(new SendCDRResult(SendCDRResultType.InvalidSessionId,
                              AuthorizatorId,
                              Description != null ? Description : "Invalid session identification!"));
 }
コード例 #5
0
ファイル: SendCDRResult.cs プロジェクト: rewatt/WWCP_Core
 public static SendCDRResult NotForwared(Authorizator_Id AuthorizatorId,
                                         String Description = null)
 {
     return(new SendCDRResult(SendCDRResultType.NotForwared,
                              AuthorizatorId,
                              Description));
 }
コード例 #6
0
ファイル: SendCDRResult.cs プロジェクト: rewatt/WWCP_Core
 private SendCDRResult(SendCDRResultType Result,
                       Authorizator_Id AuthorizatorId,
                       String Description = null)
 {
     this._AuthorizatorId = AuthorizatorId;
     this._Status         = Result;
     this._Description    = Description;
 }
コード例 #7
0
 /// <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));
 }
コード例 #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));
 }
コード例 #9
0
        /// <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;
        }
コード例 #10
0
 /// <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));
 }
コード例 #11
0
        /// <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];
        }
コード例 #12
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;
        }
コード例 #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();
        }
コード例 #14
0
        /// <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];
        }
コード例 #15
0
 /// <summary>
 /// The EVSE is unknown.
 /// </summary>
 public static AuthStopEVSEResult UnknownEVSE(Authorizator_Id AuthorizatorId)
 {
     return(new AuthStopEVSEResult(AuthorizatorId,
                                   AuthStopEVSEResultType.UnknownEVSE));
 }
コード例 #16
0
 /// <summary>
 /// The charging station is reserved.
 /// </summary>
 public static AuthStartChargingStationResult Reserved(Authorizator_Id AuthorizatorId)
 {
     return(new AuthStartChargingStationResult(AuthorizatorId,
                                               AuthStartChargingStationResultType.Reserved));
 }
コード例 #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));
 }
コード例 #18
0
 /// <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));
 }
コード例 #19
0
ファイル: SendCDRResult.cs プロジェクト: rewatt/WWCP_Core
 public static SendCDRResult Forwarded(Authorizator_Id AuthorizatorId)
 {
     return(new SendCDRResult(SendCDRResultType.Forwarded, AuthorizatorId));
 }
コード例 #20
0
 /// <summary>
 /// The given charging session identification is unknown or invalid.
 /// </summary>
 public static AuthStopChargingStationResult InvalidSessionId(Authorizator_Id AuthorizatorId)
 {
     return(new AuthStopChargingStationResult(AuthorizatorId,
                                              AuthStopChargingStationResultType.InvalidSessionId));
 }
コード例 #21
0
 /// <summary>
 /// The result is unknown and/or should be ignored.
 /// </summary>
 public static AuthStopChargingStationResult Unspecified(Authorizator_Id AuthorizatorId)
 {
     return(new AuthStopChargingStationResult(AuthorizatorId,
                                              AuthStopChargingStationResultType.Unspecified));
 }
コード例 #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));
 }
コード例 #23
0
 /// <summary>
 /// The charging station is unknown.
 /// </summary>
 public static AuthStopChargingStationResult UnknownChargingStation(Authorizator_Id AuthorizatorId)
 {
     return(new AuthStopChargingStationResult(AuthorizatorId,
                                              AuthStopChargingStationResultType.UnknownChargingStation));
 }
コード例 #24
0
 /// <summary>
 /// The EVSE is out of service.
 /// </summary>
 public static AuthStopEVSEResult OutOfService(Authorizator_Id AuthorizatorId)
 {
     return(new AuthStopEVSEResult(AuthorizatorId,
                                   AuthStopEVSEResultType.OutOfService));
 }
コード例 #25
0
 /// <summary>
 /// The charging station is out of service.
 /// </summary>
 public static AuthStopChargingStationResult OutOfService(Authorizator_Id AuthorizatorId)
 {
     return(new AuthStopChargingStationResult(AuthorizatorId,
                                              AuthStopChargingStationResultType.OutOfService));
 }
コード例 #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));
 }
コード例 #27
0
 /// <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));
 }
コード例 #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));
 }
コード例 #29
0
 /// <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));
 }
コード例 #30
0
 /// <summary>
 /// The EVSE is reserved.
 /// </summary>
 public static AuthStartEVSEResult Reserved(Authorizator_Id AuthorizatorId)
 {
     return(new AuthStartEVSEResult(AuthorizatorId,
                                    AuthStartEVSEResultType.Reserved));
 }