Part of bzrlib.smart.request View In Hierarchy
Known subclasses: bzrlib.smart.branch.SmartServerBranchRequest, bzrlib.smart.bzrdir.SmartServerRequestBzrDir, bzrlib.smart.bzrdir.SmartServerRequestInitializeBzrDir, bzrlib.smart.bzrdir.SmartServerRequestOpenBzrDir, bzrlib.smart.bzrdir.SmartServerRequestOpenBzrDir_2_1, bzrlib.smart.repository.SmartServerRepositoryRequest, bzrlib.smart.request.GetBundleRequest, bzrlib.smart.request.HelloRequest, bzrlib.smart.request.SmartServerIsReadonly, bzrlib.smart.vfs.VfsRequest, bzrlib.tests.test_smart_request.CheckJailRequest, bzrlib.tests.test_smart_request.ChunkErrorRequest, bzrlib.tests.test_smart_request.DoErrorRequest, bzrlib.tests.test_smart_request.DoUnexpectedErrorRequest, bzrlib.tests.test_smart_request.EndErrorRequest, bzrlib.tests.test_smart_request.NoBodyRequest
To define a new request, subclass this class and override the do
method
(and if appropriate, do_body
as well). Request implementors should take
care to call translate_client_path
and transport_from_client_path
as
appropriate when dealing with paths received from the client.
Method | __init__ | Constructor. |
Method | do | Mandatory extension point for SmartServerRequest subclasses. |
Method | execute | Public entry point to execute this request. |
Method | do_body | Called if the client sends a body with the request. |
Method | do_chunk | Called with each body chunk if the request has a streamed body. |
Method | do_end | Called when the end of the request has been received. |
Method | setup_jail | Undocumented |
Method | teardown_jail | Undocumented |
Method | translate_client_path | Translate a path received from a network client into a local |
Method | transport_from_client_path | Get a backing transport corresponding to the location referred to by |
Method | _check_enabled | Raises DisabledMethod if this method is disabled. |
Parameters | backing_transport | the base transport to be used when performing this request. |
root_client_path | the client path that maps to the root of backing_transport. This is used to interpret relpaths received from the client. Clients will not be able to refer to paths above this root. If root_client_path is None, then no translation will be performed on client paths. Default is '/'. | |
jail_root | if specified, the root of the BzrDir.open jail to use instead of backing_transport. |
Subclasses must implement this.
This should return a SmartServerResponse if this command expects to receive no body.
It will return a SmartServerResponse if the command does not expect a body.
Parameters | args | the arguments of the request. |
The do() method is still called, and must have returned None.
Must return a SmartServerResponse.
The do() method is still called, and must have returned None.
All paths received from the client must be translated.
Parameters | client_path | the path from the client. |
Returns | a relpath that may be used with self._backing_transport (unlike the untranslated client_path, which must not be used with the backing transport). |