use of org.hisp.dhis.sms.outbound.GatewayResponse in project dhis2-core by dhis2.
the class SmsGateway method wrapHttpStatus.
public OutboundMessageResponse wrapHttpStatus(HttpStatus httpStatus) {
GatewayResponse gatewayResponse;
OutboundMessageResponse status = new OutboundMessageResponse();
if (OK_CODES.contains(httpStatus)) {
gatewayResponse = GATEWAY_RESPONSE_MAP.get(httpStatus);
status.setOk(true);
} else {
gatewayResponse = GATEWAY_RESPONSE_MAP.getOrDefault(httpStatus, GatewayResponse.FAILED);
status.setOk(false);
}
status.setResponseObject(gatewayResponse);
status.setDescription(gatewayResponse.getResponseMessage());
return status;
}
Aggregations