|
CCF
|
#include <rpc_context_impl.h>
Inherits ccf::RpcContext.
Inherited by http::HttpRpcContext.
Public Member Functions | |
| RpcContextImpl (const std::shared_ptr< SessionContext > &s, HttpVersion v=HttpVersion::HTTP1) | |
| std::shared_ptr< SessionContext > | get_session_context () const override |
| virtual void | set_user_data (std::shared_ptr< void > data) override |
| virtual void * | get_user_data () const override |
| void | set_claims_digest (ccf::ClaimsDigest::Digest &&digest) override |
| virtual const ccf::PathParams & | get_request_path_params () override |
| virtual const ccf::PathParams & | get_decoded_request_path_params () override |
| HttpVersion | get_http_version () const |
| virtual void | set_error (http_status status, const std::string &code, std::string &&msg, const std::vector< nlohmann::json > &details={}) override |
| void | set_error (ccf::ErrorDetails &&error) override |
| void | set_response_json (const nlohmann::json &body, http_status status) override |
| void | set_grpc_error (grpc_status grpc_status, std::string &&msg) |
| virtual void | set_tx_id (const ccf::TxID &tx_id)=0 |
| virtual bool | should_apply_writes () const =0 |
| virtual void | reset_response ()=0 |
| virtual std::vector< uint8_t > | serialise_response () const =0 |
| virtual const std::vector< uint8_t > & | get_serialised_request ()=0 |
Public Member Functions inherited from ccf::RpcContext | |
| virtual | ~RpcContext ()=default |
| virtual const std::vector< uint8_t > & | get_request_body () const =0 |
| virtual const std::string & | get_request_query () const =0 |
| virtual const ccf::RESTVerb & | get_request_verb () const =0 |
| virtual std::string | get_request_path () const =0 |
| virtual std::string | get_method () const =0 |
| virtual std::shared_ptr< ccf::http::HTTPResponder > | get_responder () const =0 |
| virtual const http::HeaderMap & | get_request_headers () const =0 |
| Returns map of all headers found in the request. | |
| virtual std::optional< std::string > | get_request_header (const std::string_view &name) const =0 |
| virtual const std::string & | get_request_url () const =0 |
| virtual ccf::FrameFormat | frame_format () const =0 |
| virtual void | set_response_body (const std::vector< uint8_t > &body)=0 |
| Sets the main body or payload of the response. | |
| virtual void | set_response_body (std::vector< uint8_t > &&body)=0 |
| Sets the main body or payload of the response. | |
| virtual void | set_response_body (std::string &&body)=0 |
| Sets the main body or payload of the response. | |
| virtual const std::vector< uint8_t > & | get_response_body () const =0 |
| virtual void | set_response_status (int status)=0 |
| Sets initial status code summarising result of RPC. | |
| virtual int | get_response_status () const =0 |
| virtual void | set_response_header (const std::string_view &name, const std::string_view &value)=0 |
| virtual void | set_response_header (const std::string_view &name, size_t n) |
| virtual void | set_response_header (const http::HeaderKeyValue &kv) |
| virtual void | clear_response_headers ()=0 |
| virtual void | set_response_trailer (const std::string_view &name, const std::string_view &value)=0 |
| virtual void | set_response_trailer (const std::string_view &name, size_t n) |
| virtual void | set_response_trailer (const http::HeaderKeyValue &kv) |
| virtual void | set_apply_writes (bool apply)=0 |
Public Attributes | |
| ccf::ClaimsDigest | claims = ccf::empty_claims() |
| ccf::PathParams | path_params = {} |
| ccf::PathParams | decoded_path_params = {} |
| bool | response_is_pending = false |
| bool | terminate_session = false |
Protected Attributes | |
| std::shared_ptr< SessionContext > | session |
| HttpVersion | http_version |
| std::shared_ptr< void > | user_data |
|
inline |
|
inlineoverridevirtual |
Decodes the path before returning a map of all PathParams. For example, if the endpoint was installed at /foo/{name}/{age}, and for the request path /foo/bob%3A/42, this would return the map: {"name": "bob:", "age": "42"}
Implements ccf::RpcContext.
|
inline |
|
inlineoverridevirtual |
Returns a map of all PathParams parsed out of the original query path. For instance if this endpoint was installed at /foo/{name}/{age}, and the request path /foo/bob/42, this would return the map: {"name": "bob", "age": "42"}
Implements ccf::RpcContext.
|
pure virtual |
Implemented in http::HttpRpcContext.
|
inlineoverridevirtual |
Return information about the persistent session which this request was received on. Allows correlation between multiple requests coming from the same long-lived session.
Implements ccf::RpcContext.
|
inlineoverridevirtual |
Implements ccf::RpcContext.
|
pure virtual |
Implemented in http::HttpRpcContext.
|
pure virtual |
Implemented in http::HttpRpcContext.
|
inlineoverridevirtual |
Sets the application claims digest associated with this transaction. This digest is used to construct the Merkle tree leaf representing this transaction. This allows a transaction to make specific, separately-revealable claims in each transaction, without being bound to the transaction serialisation format or what is stored in the KV. The digest will be included in receipts issued for that transaction.
Implements ccf::RpcContext.
|
inlineoverridevirtual |
Construct error response, formatted according to the request content type (either JSON OData-formatted or gRPC error)
Implements ccf::RpcContext.
|
inlineoverridevirtual |
Construct error response, formatted according to the request content type (either JSON OData-formatted or gRPC error)
Implements ccf::RpcContext.
|
inline |
|
inlineoverridevirtual |
Implements ccf::RpcContext.
|
pure virtual |
Implemented in http::HttpRpcContext.
|
inlineoverridevirtual |
Implements ccf::RpcContext.
|
pure virtual |
Implemented in http::HttpRpcContext.
| ccf::ClaimsDigest ccf::RpcContextImpl::claims = ccf::empty_claims() |
| ccf::PathParams ccf::RpcContextImpl::decoded_path_params = {} |
|
protected |
| ccf::PathParams ccf::RpcContextImpl::path_params = {} |
| bool ccf::RpcContextImpl::response_is_pending = false |
|
protected |
| bool ccf::RpcContextImpl::terminate_session = false |
|
protected |