CommandMessage.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Amf
  17. * @subpackage Value
  18. * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id: CommandMessage.php 2504 2011-12-28 07:35:29Z liu21st $
  21. */
  22. /**
  23. * @see Zend_Amf_Value_Messaging_AsyncMessage
  24. */
  25. require_once 'Zend/Amf/Value/Messaging/AsyncMessage.php';
  26. /**
  27. * A message that represents an infrastructure command passed between
  28. * client and server. Subscribe/unsubscribe operations result in
  29. * CommandMessage transmissions, as do polling operations.
  30. *
  31. * Corresponds to flex.messaging.messages.CommandMessage
  32. *
  33. * Note: THESE VALUES MUST BE THE SAME ON CLIENT AND SERVER
  34. *
  35. * @package Zend_Amf
  36. * @subpackage Value
  37. * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  38. * @license http://framework.zend.com/license/new-bsd New BSD License
  39. */
  40. class Zend_Amf_Value_Messaging_CommandMessage extends Zend_Amf_Value_Messaging_AsyncMessage
  41. {
  42. /**
  43. * This operation is used to subscribe to a remote destination.
  44. * @const int
  45. */
  46. const SUBSCRIBE_OPERATION = 0;
  47. /**
  48. * This operation is used to unsubscribe from a remote destination.
  49. * @const int
  50. */
  51. const UNSUSBSCRIBE_OPERATION = 1;
  52. /**
  53. * This operation is used to poll a remote destination for pending,
  54. * undelivered messages.
  55. * @const int
  56. */
  57. const POLL_OPERATION = 2;
  58. /**
  59. * This operation is used by a remote destination to sync missed or cached messages
  60. * back to a client as a result of a client issued poll command.
  61. * @const int
  62. */
  63. const CLIENT_SYNC_OPERATION = 4;
  64. /**
  65. * This operation is used to test connectivity over the current channel to
  66. * the remote endpoint.
  67. * @const int
  68. */
  69. const CLIENT_PING_OPERATION = 5;
  70. /**
  71. * This operation is used to request a list of failover endpoint URIs
  72. * for the remote destination based on cluster membership.
  73. * @const int
  74. */
  75. const CLUSTER_REQUEST_OPERATION = 7;
  76. /**
  77. * This operation is used to send credentials to the endpoint so that
  78. * the user can be logged in over the current channel.
  79. * The credentials need to be Base64 encoded and stored in the <code>body</code>
  80. * of the message.
  81. * @const int
  82. */
  83. const LOGIN_OPERATION = 8;
  84. /**
  85. * This operation is used to log the user out of the current channel, and
  86. * will invalidate the server session if the channel is HTTP based.
  87. * @const int
  88. */
  89. const LOGOUT_OPERATION = 9;
  90. /**
  91. * This operation is used to indicate that the client's subscription to a
  92. * remote destination has been invalidated.
  93. * @const int
  94. */
  95. const SESSION_INVALIDATE_OPERATION = 10;
  96. /**
  97. * This operation is used by the MultiTopicConsumer to subscribe/unsubscribe
  98. * from multiple subtopics/selectors in the same message.
  99. * @const int
  100. */
  101. const MULTI_SUBSCRIBE_OPERATION = 11;
  102. /**
  103. * This operation is used to indicate that a channel has disconnected
  104. * @const int
  105. */
  106. const DISCONNECT_OPERATION = 12;
  107. /**
  108. * This is the default operation for new CommandMessage instances.
  109. * @const int
  110. */
  111. const UNKNOWN_OPERATION = 10000;
  112. /**
  113. * The operation to execute for messages of this type
  114. * @var int
  115. */
  116. public $operation = self::UNKNOWN_OPERATION;
  117. }