File indexing completed on 2024-06-23 05:55:43

0001 <?php
0002 
0003 /**
0004  * Copyright (c) 2007-2011, Servigistics, Inc.
0005  * All rights reserved.
0006  *
0007  * Redistribution and use in source and binary forms, with or without
0008  * modification, are permitted provided that the following conditions are met:
0009  *
0010  *  - Redistributions of source code must retain the above copyright notice,
0011  *    this list of conditions and the following disclaimer.
0012  *  - Redistributions in binary form must reproduce the above copyright
0013  *    notice, this list of conditions and the following disclaimer in the
0014  *    documentation and/or other materials provided with the distribution.
0015  *  - Neither the name of Servigistics, Inc. nor the names of
0016  *    its contributors may be used to endorse or promote products derived from
0017  *    this software without specific prior written permission.
0018  *
0019  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0020  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0021  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0022  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0023  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0024  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0025  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0026  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0027  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0028  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0029  * POSSIBILITY OF SUCH DAMAGE.
0030  *
0031  * @copyright Copyright 2007-2011 Servigistics, Inc. (http://servigistics.com)
0032  * @license http://solr-php-client.googlecode.com/svn/trunk/COPYING New BSD
0033  * @version $Id: $
0034  *
0035  * @package Apache
0036  * @subpackage Solr
0037  * @author Timo Schmidt <timo.schmidt@aoemedia.de>, Donovan Jimenez <djimenez@conduit-it.com>
0038  */
0039 require_once 'Zend/Service/Solr/HttpTransport/Response.php';
0040 
0041 /**
0042  * Interface that all Transport (HTTP Requester) implementations must implement. These
0043  * Implementations can then be plugged into the Service instance in order to user their
0044  * the desired method for making HTTP requests
0045  */
0046 interface Zend_Service_Solr_HttpTransport_Interface {
0047 
0048     /**
0049      * Get the current default timeout for all HTTP requests
0050      *
0051      * @return float
0052      */
0053     public function getDefaultTimeout();
0054 
0055     /**
0056      * Set the current default timeout for all HTTP requests
0057      *
0058      * @param float $timeout
0059      */
0060     public function setDefaultTimeout($timeout);
0061 
0062     /**
0063      * Perform a GET HTTP operation with an optional timeout and return the response
0064      * contents, use getLastResponseHeaders to retrieve HTTP headers
0065      *
0066      * @param string $url
0067      * @param float $timeout
0068      * @return Zend_Service_Solr_HttpTransport_Response HTTP response
0069      */
0070     public function performGetRequest($url, $timeout = false);
0071 
0072     /**
0073      * Perform a HEAD HTTP operation with an optional timeout and return the response
0074      * headers - NOTE: head requests have no response body
0075      *
0076      * @param string $url
0077      * @param float $timeout
0078      * @return Zend_Service_Solr_HttpTransport_Response HTTP response
0079      */
0080     public function performHeadRequest($url, $timeout = false);
0081 
0082     /**
0083      * Perform a POST HTTP operation with an optional timeout and return the response
0084      * contents, use getLastResponseHeaders to retrieve HTTP headers
0085      *
0086      * @param string $url
0087      * @param string $rawPost
0088      * @param string $contentType
0089      * @param float $timeout
0090      * @return Zend_Service_Solr_HttpTransport_Response HTTP response
0091      */
0092     public function performPostRequest($url, $rawPost, $contentType, $timeout = false);
0093 }