You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

132 lines
5.1 KiB

4 years ago
  1. #if MYSQL_6_10
  2. // Copyright © 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  3. //
  4. // MySQL Connector/NET is licensed under the terms of the GPLv2
  5. // <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
  6. // MySQL Connectors. There are special exceptions to the terms and
  7. // conditions of the GPLv2 as it is applied to this software, see the
  8. // FLOSS License Exception
  9. // <http://www.mysql.com/about/legal/licensing/foss-exception.html>.
  10. //
  11. // This program is free software; you can redistribute it and/or modify
  12. // it under the terms of the GNU General Public License as published
  13. // by the Free Software Foundation; version 2 of the License.
  14. //
  15. // This program is distributed in the hope that it will be useful, but
  16. // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  17. // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  18. // for more details.
  19. //
  20. // You should have received a copy of the GNU General Public License along
  21. // with this program; if not, write to the Free Software Foundation, Inc.,
  22. // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  23. using System;
  24. using System.Collections.Generic;
  25. using System.Configuration;
  26. using System.Text;
  27. namespace Externals.MySql.Data.MySqlClient
  28. {
  29. /// <summary>
  30. /// Defines a replication configurarion element in the configuration file.
  31. /// </summary>
  32. internal sealed class ReplicationConfigurationElement : ConfigurationElement
  33. {
  34. /// <summary>
  35. /// Gets a collection of <see cref="ReplicationServerGroupConfigurationElement"/> objects representing the server groups.
  36. /// </summary>
  37. [ConfigurationProperty("ServerGroups", IsRequired = true)]
  38. [ConfigurationCollection(typeof(ReplicationServerGroupConfigurationElement), AddItemName = "Group")]
  39. public GenericConfigurationElementCollection<ReplicationServerGroupConfigurationElement> ServerGroups
  40. {
  41. get { return (GenericConfigurationElementCollection<ReplicationServerGroupConfigurationElement>)this["ServerGroups"]; }
  42. }
  43. }
  44. /// <summary>
  45. /// Defines a replication server group in the configuration file.
  46. /// </summary>
  47. internal sealed class ReplicationServerGroupConfigurationElement : ConfigurationElement
  48. {
  49. /// <summary>
  50. /// Gets or sets the name of the replication server group configuration.
  51. /// </summary>
  52. [ConfigurationProperty("name", IsRequired = true)]
  53. public string Name
  54. {
  55. get { return (string)this["name"]; }
  56. set { this["name"] = value; }
  57. }
  58. /// <summary>
  59. /// Gets or sets the group type of the replication server group configuration.
  60. /// </summary>
  61. [ConfigurationProperty("groupType", IsRequired = false)]
  62. public string GroupType
  63. {
  64. get { return (string)this["groupType"]; }
  65. set { this["groupType"] = value; }
  66. }
  67. /// <summary>
  68. /// Gets or sets the number of seconds to wait for retry.
  69. /// </summary>
  70. [ConfigurationProperty("retryTime", IsRequired = false, DefaultValue = 60)]
  71. public int RetryTime
  72. {
  73. get { return (int)this["retryTime"]; }
  74. set { this["retryTime"] = value; }
  75. }
  76. /// <summary>
  77. /// Gets a collection of <see cref="ReplicationServerConfigurationElement"/> objects representing the
  78. /// server configurations associated to this group configuration.
  79. /// </summary>
  80. [ConfigurationProperty("Servers")]
  81. [ConfigurationCollection(typeof(ReplicationServerConfigurationElement), AddItemName = "Server")]
  82. public GenericConfigurationElementCollection<ReplicationServerConfigurationElement> Servers
  83. {
  84. get { return (GenericConfigurationElementCollection<ReplicationServerConfigurationElement>)this["Servers"]; }
  85. }
  86. }
  87. /// <summary>
  88. /// Defines a replication server in configuration file.
  89. /// </summary>
  90. internal sealed class ReplicationServerConfigurationElement : ConfigurationElement
  91. {
  92. /// <summary>
  93. /// Gets or sets the name of the replication server configuration.
  94. /// </summary>
  95. [ConfigurationProperty("name", IsRequired = true)]
  96. public string Name
  97. {
  98. get { return (string)this["name"]; }
  99. set { this["name"] = value; }
  100. }
  101. /// <summary>
  102. /// Gets or sets whether the replication server is configured as master.
  103. /// </summary>
  104. [ConfigurationProperty("IsMaster", IsRequired = false, DefaultValue = false)]
  105. public bool IsMaster
  106. {
  107. get { return (bool)this["IsMaster"]; }
  108. set { this["IsMaster"] = value; }
  109. }
  110. /// <summary>
  111. /// Gets or sets the connection string associated to this replication server.
  112. /// </summary>
  113. [ConfigurationProperty("connectionstring", IsRequired = true)]
  114. public string ConnectionString
  115. {
  116. get { return (string)this["connectionstring"]; }
  117. set { this["connectionstring"] = value; }
  118. }
  119. }
  120. }
  121. #endif