MultiRequestInterface.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. /**
  3. * Licensed to Jasig under one or more contributor license
  4. * agreements. See the NOTICE file distributed with this work for
  5. * additional information regarding copyright ownership.
  6. *
  7. * Jasig licenses this file to you under the Apache License,
  8. * Version 2.0 (the "License"); you may not use this file except in
  9. * compliance with the License. You may obtain a copy of the License at:
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS,
  15. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. * See the License for the specific language governing permissions and
  17. * limitations under the License.
  18. *
  19. * PHP Version 5
  20. *
  21. * @file CAS/Request/MultiRequestInterface.php
  22. * @category Authentication
  23. * @package PhpCAS
  24. * @author Adam Franco <afranco@middlebury.edu>
  25. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
  26. * @link https://wiki.jasig.org/display/CASC/phpCAS
  27. */
  28. /**
  29. * This interface defines a class library for performing multiple web requests
  30. * in batches. Implementations of this interface may perform requests serially
  31. * or in parallel.
  32. *
  33. * @class CAS_Request_MultiRequestInterface
  34. * @category Authentication
  35. * @package PhpCAS
  36. * @author Adam Franco <afranco@middlebury.edu>
  37. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
  38. * @link https://wiki.jasig.org/display/CASC/phpCAS
  39. */
  40. interface CAS_Request_MultiRequestInterface
  41. {
  42. /*********************************************************
  43. * Add Requests
  44. *********************************************************/
  45. /**
  46. * Add a new Request to this batch.
  47. * Note, implementations will likely restrict requests to their own concrete
  48. * class hierarchy.
  49. *
  50. * @param CAS_Request_RequestInterface $request request interface
  51. *
  52. * @return void
  53. * @throws CAS_OutOfSequenceException If called after the Request has been
  54. * sent.
  55. * @throws CAS_InvalidArgumentException If passed a Request of the wrong
  56. * implmentation.
  57. */
  58. public function addRequest (CAS_Request_RequestInterface $request);
  59. /**
  60. * Retrieve the number of requests added to this batch.
  61. *
  62. * @return int number of request elements
  63. */
  64. public function getNumRequests ();
  65. /*********************************************************
  66. * 2. Send the Request
  67. *********************************************************/
  68. /**
  69. * Perform the request. After sending, all requests will have their
  70. * responses poulated.
  71. *
  72. * @return bool TRUE on success, FALSE on failure.
  73. * @throws CAS_OutOfSequenceException If called multiple times.
  74. */
  75. public function send ();
  76. }