mediation
Module mediation
choreo/mediation
Annotations
mediation: FaultFlow
An annotation for marking a public function as the implmenting function of a policy for the
fault-flow of a mediation sequence. A function marked as FaultFlow
is expected to have the following
function parameter signature: (http:Response, http:Request, mediation:Context)
.
e.g.,
@mediation:FaultFlow public function addHeaderOut(http:Response errResp, error e, http:Response? resp, http:Request req, mediation:Context ctx) returns http:Response|false|error|() {}
mediation: RequestFlow
An annotation for marking a public function as the implmenting function of a policy for the
in-flow of a mediation sequence. A function marked as RequestFlow
is expected to have the following
function parameter signature: (http:Response, mediation:Context)
.
e.g.,
@mediation:RequestFlow public function addHeaderIn(http:Response resp, mediation:Context ctx) returns http:Response|false|error|() {}
mediation: ResponseFlow
An annotation for marking a public function as the implmenting function of a policy for the
out-flow of a mediation sequence. A function marked as ResponseFlow
is expected to have the following
function parameter signature: (http:Response, http:Request, mediation:Context)
.
e.g.,
@mediation:ResponseFlow public function addHeaderOut(http:Response resp, http:Request req, mediation:Context ctx) returns http:Response|false|error|() {}
Records
mediation: Context
A key-value store for sharing information with the policy implementations as well as across the policies. A parameter of this type is required to be there in the function signature of a policy function.
Fields
- resourcePath string - The resource path to call in the upstream server. By default, the resource paths of the proxy will map 1:1 to the resource paths of the backend. If policy authors wish to change this mapping, they can give an alternative value to the resource path through this field.
- httpMethod string - The HTTP method to be used when making the call to the upstream server. By default, the proxy will call the upstream server using the same method that was used to invoke the particular resource in the proxy. If a different method needs to be used, policy authors can modify the value of this field.