CommandMessage.php 3.9 KB

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