FactoryOptions.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. declare(strict_types=1);
  7. namespace Magento\Framework\Amqp\Connection;
  8. /**
  9. * Options a connection will be created according to.
  10. */
  11. class FactoryOptions
  12. {
  13. /**
  14. * @var string
  15. */
  16. private $host;
  17. /**
  18. * @var string
  19. */
  20. private $port;
  21. /**
  22. * @var string
  23. */
  24. private $username;
  25. /**
  26. * @var string
  27. */
  28. private $password;
  29. /**
  30. * @var string
  31. */
  32. private $virtualHost;
  33. /**
  34. * @var bool
  35. */
  36. private $sslEnabled = false;
  37. /**
  38. * @var array|null
  39. */
  40. private $sslOptions;
  41. /**
  42. * @return string
  43. */
  44. public function getHost(): string
  45. {
  46. return $this->host;
  47. }
  48. /**
  49. * @param string $host
  50. *
  51. * @return void
  52. */
  53. public function setHost(string $host)
  54. {
  55. $this->host = $host;
  56. }
  57. /**
  58. * @return string
  59. */
  60. public function getPort(): string
  61. {
  62. return $this->port;
  63. }
  64. /**
  65. * @param string $port
  66. *
  67. * @return void
  68. */
  69. public function setPort(string $port)
  70. {
  71. $this->port = $port;
  72. }
  73. /**
  74. * @return string
  75. */
  76. public function getUsername(): string
  77. {
  78. return $this->username;
  79. }
  80. /**
  81. * @param string $username
  82. *
  83. * @return void
  84. */
  85. public function setUsername(string $username)
  86. {
  87. $this->username = $username;
  88. }
  89. /**
  90. * @return string
  91. */
  92. public function getPassword(): string
  93. {
  94. return $this->password;
  95. }
  96. /**
  97. * @param string $password
  98. *
  99. * @return void
  100. */
  101. public function setPassword(string $password)
  102. {
  103. $this->password = $password;
  104. }
  105. /**
  106. * @return string|null
  107. */
  108. public function getVirtualHost()
  109. {
  110. return $this->virtualHost;
  111. }
  112. /**
  113. * @param string|null $virtualHost
  114. *
  115. * @return void
  116. */
  117. public function setVirtualHost(string $virtualHost = null)
  118. {
  119. $this->virtualHost = $virtualHost;
  120. }
  121. /**
  122. * @return bool
  123. */
  124. public function isSslEnabled(): bool
  125. {
  126. return $this->sslEnabled;
  127. }
  128. /**
  129. * @param bool $sslEnabled
  130. *
  131. * @return void
  132. */
  133. public function setSslEnabled(bool $sslEnabled)
  134. {
  135. $this->sslEnabled = $sslEnabled;
  136. }
  137. /**
  138. * @return array|null
  139. */
  140. public function getSslOptions()
  141. {
  142. return $this->sslOptions;
  143. }
  144. /**
  145. * @param array|null $sslOptions
  146. *
  147. * @return void
  148. */
  149. public function setSslOptions(array $sslOptions = null)
  150. {
  151. $this->sslOptions = $sslOptions;
  152. }
  153. }