Service/Nirvanix/Namespace/Base.php
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Service
- Subpackage
- Nirvanix
- Version
- $Id: Base.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Service_Nirvanix_Namespace_Base
This is a proxy class representing one namespace. It allows calls to the namespace to be made by PHP object calls rather than by having to construct HTTP client requests.
- Children
- \Zend_Service_Nirvanix_Namespace_Imfs
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties

$_defaults = array()When a request to the service is to be made, the POST parameters are merged into these. This is a convenience feature so parameters that are repeatedly required like sessionToken do not need to be supplied again and again by the user.
array()Details- Type
- n/a
- $_defaults
- array

string $_host = 'http://services.nirvanix.com'It is possible that the user will wish to use different hosts for different namespaces.
'http://services.nirvanix.com'Details- Type
- string

\Zend_Http_Client $_httpClientMethods

__call(string $methodName, array $args) : \Zend_Service_Nirvanix_ResponseWhen a method call is made against this proxy, convert it to an HTTP request to make against the Nirvanix REST service.
$imfs->DeleteFiles(array('filePath' => 'foo'));
Assuming this object was proxying the IMFS namespace, the method call above would call the DeleteFiles command. The POST parameters would be filePath, merged with the $this->_defaults (containing the sessionToken).
| Name | Type | Description |
|---|---|---|
| $methodName | string | Name of the command to call on this namespace. |
| $args | array | Only the first is used and it must be an array. It contains the POST params. |
| Type | Description |
|---|---|
| \Zend_Service_Nirvanix_Response |

__construct(array $options = array()) : voidClass constructor.
| Name | Type | Description |
|---|---|---|
| $options | array | Options and dependency injection |

_makeUri(string $methodName) : stringMake a complete URI from an RPC method name.
All Nirvanix REST service URIs use the same format.
| Name | Type | Description |
|---|---|---|
| $methodName | string | RPC method name |
| Type | Description |
|---|---|
| string |

_wrapResponse(\Zend_Http_Response $httpResponse) : \Zend_Service_Nirvanix_ResponseAll Nirvanix REST service calls return an XML payload.
This method makes a Zend_Service_Nirvanix_Response from that XML payload.
| Name | Type | Description |
|---|---|---|
| $httpResponse | \Zend_Http_Response | Raw response from Nirvanix |
| Type | Description |
|---|---|
| \Zend_Service_Nirvanix_Response | Wrapped response |

getHttpClient() : \Zend_Http_ClientReturn the HTTP client used for this namespace.
This is useful for inspecting the last request or directly interacting with the HTTP client.
| Type | Description |
|---|---|
| \Zend_Http_Client |