CommandMessage.php 3.9 KB

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