PageRenderTime 1151ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/codes-php/phpjakarta/WindowsAzure/ServiceManagement/Models/InputEndpoint.php

http://bukuphpjs.codeplex.com
PHP | 152 lines | 48 code | 14 blank | 90 comment | 0 complexity | 3903c19fc4a277225dd1de3759dea8b1 MD5 | raw file
Possible License(s): Apache-2.0, MIT, LGPL-2.1
  1. <?php
  2. /**
  3. * LICENSE: Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. * http://www.apache.org/licenses/LICENSE-2.0
  7. *
  8. * Unless required by applicable law or agreed to in writing, software
  9. * distributed under the License is distributed on an "AS IS" BASIS,
  10. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. * See the License for the specific language governing permissions and
  12. * limitations under the License.
  13. *
  14. * PHP version 5
  15. *
  16. * @category Microsoft
  17. * @package WindowsAzure\ServiceManagement\Models
  18. * @author Azure PHP SDK <azurephpsdk@microsoft.com>
  19. * @copyright 2012 Microsoft Corporation
  20. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
  21. * @link https://github.com/windowsazure/azure-sdk-for-php
  22. */
  23. namespace WindowsAzure\ServiceManagement\Models;
  24. use WindowsAzure\Common\Internal\Resources;
  25. use WindowsAzure\Common\Internal\Utilities;
  26. /**
  27. * Represents a Windows Azure deployment input endpoint.
  28. *
  29. * @category Microsoft
  30. * @package WindowsAzure\ServiceManagement\Models
  31. * @author Azure PHP SDK <azurephpsdk@microsoft.com>
  32. * @copyright 2012 Microsoft Corporation
  33. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
  34. * @version Release: @package_version@
  35. * @link https://github.com/windowsazure/azure-sdk-for-php
  36. */
  37. class InputEndpoint
  38. {
  39. /**
  40. * @var string
  41. */
  42. private $_roleName;
  43. /**
  44. * @var string
  45. */
  46. private $_vip;
  47. /**
  48. * @var string
  49. */
  50. private $_port;
  51. /**
  52. * Creates a new InputEndpoint from parsed response body.
  53. *
  54. * @param array $parsed The parsed response body in array representation.
  55. *
  56. * @return InputEndpoint
  57. */
  58. public static function create($parsed)
  59. {
  60. $inputEndpoint = new InputEndpoint();
  61. $vip = Utilities::tryGetValue($parsed, Resources::XTAG_VIP);
  62. $port = Utilities::tryGetValue($parsed, Resources::XTAG_PORT);
  63. $roleName = Utilities::tryGetValue(
  64. $parsed,
  65. Resources::XTAG_ROLE_NAME
  66. );
  67. $inputEndpoint->setPort($port);
  68. $inputEndpoint->setRoleName($roleName);
  69. $inputEndpoint->setVip($vip);
  70. return $inputEndpoint;
  71. }
  72. /**
  73. * Gets the input endpoint role name.
  74. *
  75. * The name of the role.
  76. *
  77. * @return string
  78. */
  79. public function getRoleName()
  80. {
  81. return $this->_roleName;
  82. }
  83. /**
  84. * Sets the input endpoint role name.
  85. *
  86. * @param string $roleName The input endpoint role name.
  87. *
  88. * @return none
  89. */
  90. public function setRoleName($roleName)
  91. {
  92. $this->_roleName = $roleName;
  93. }
  94. /**
  95. * Gets the input endpoint VIP.
  96. *
  97. * The virtual IP address that this input endpoint is exposed on.
  98. *
  99. * @return string
  100. */
  101. public function getVip()
  102. {
  103. return $this->_vip;
  104. }
  105. /**
  106. * Sets the input endpoint VIP.
  107. *
  108. * @param string $vip The input endpoint VIP.
  109. *
  110. * @return none
  111. */
  112. public function setVip($vip)
  113. {
  114. $this->_vip = $vip;
  115. }
  116. /**
  117. * Gets the input endpoint port.
  118. *
  119. * The port this input endpoint is exposed on.
  120. *
  121. * @return string
  122. */
  123. public function getPort()
  124. {
  125. return $this->_port;
  126. }
  127. /**
  128. * Sets the input endpoint port.
  129. *
  130. * @param string $port The input endpoint port.
  131. *
  132. * @return none
  133. */
  134. public function setPort($port)
  135. {
  136. $this->_port = $port;
  137. }
  138. }