use of org.wso2.carbon.apimgt.common.gateway.dto.ExtensionResponseDTO in project carbon-apimgt by wso2.
the class ExtensionListenerUtil method preProcessRequest.
/**
* Handles pre-process request by constructing the request context DTO, invoking the matching extension listener
* implementation and processing the extension listener response.
*
* @param messageContext Synapse Message Context
* @param type Extension type
* @return boolean indicating to continue normal handler response flow or respond back immediately
*/
public static boolean preProcessRequest(MessageContext messageContext, String type) {
ExtensionListener extensionListener = getExtensionListener(type);
if (extensionListener != null) {
RequestContextDTO requestContextDTO = generateRequestContextDTO(messageContext);
ExtensionResponseDTO responseDTO = extensionListener.preProcessRequest(requestContextDTO);
return handleExtensionResponse(messageContext, responseDTO);
}
return true;
}
use of org.wso2.carbon.apimgt.common.gateway.dto.ExtensionResponseDTO in project carbon-apimgt by wso2.
the class ExtensionListenerUtil method preProcessResponse.
/**
* Handles pre-process response by constructing the response context DTO, invoking the matching extension listener
* implementation and processing the extension listener response.
*
* @param messageContext Synapse Message Context
* @param type Extension type
* @return boolean indicating to continue normal handler response flow or respond back immediately
*/
public static boolean preProcessResponse(MessageContext messageContext, String type) {
ExtensionListener extensionListener = getExtensionListener(type);
if (extensionListener != null) {
ResponseContextDTO responseContextDTO = generateResponseContextDTO(messageContext);
ExtensionResponseDTO responseDTO = extensionListener.preProcessResponse(responseContextDTO);
return handleExtensionResponse(messageContext, responseDTO);
}
return true;
}
use of org.wso2.carbon.apimgt.common.gateway.dto.ExtensionResponseDTO in project carbon-apimgt by wso2.
the class ExtensionListenerUtil method postProcessResponse.
/**
* Handles post-process response by constructing the response context DTO, invoking the matching extension listener
* implementation and processing the extension listener response.
*
* @param messageContext Synapse Message Context
* @param type Extension type
* @return boolean indicating to continue normal handler response flow or respond back immediately
*/
public static boolean postProcessResponse(MessageContext messageContext, String type) {
ExtensionListener extensionListener = getExtensionListener(type);
if (extensionListener != null) {
ResponseContextDTO responseContextDTO = generateResponseContextDTO(messageContext);
ExtensionResponseDTO responseDTO = extensionListener.postProcessResponse(responseContextDTO);
return handleExtensionResponse(messageContext, responseDTO);
}
return true;
}
use of org.wso2.carbon.apimgt.common.gateway.dto.ExtensionResponseDTO in project carbon-apimgt by wso2.
the class ExtensionListenerUtil method postProcessRequest.
/**
* Handles post-process request by constructing the request context DTO, invoking the matching extension listener
* implementation and processing the extension listener response.
*
* @param messageContext Synapse Message Context
* @param type Extension type
* @return boolean indicating to continue normal handler response flow or respond back immediately
*/
public static boolean postProcessRequest(MessageContext messageContext, String type) {
ExtensionListener extensionListener = getExtensionListener(type);
if (extensionListener != null) {
RequestContextDTO requestContextDTO = generateRequestContextDTO(messageContext);
ExtensionResponseDTO responseDTO = extensionListener.postProcessRequest(requestContextDTO);
return handleExtensionResponse(messageContext, responseDTO);
}
return true;
}
Aggregations