use of org.hisp.dhis.sms.outbound.ClickatellRequestEntity in project dhis2-core by dhis2.
the class ClickatellHttpGateway method send.
@Override
public OutboundMessageResponse send(String subject, String text, Set<String> recipients, SmsGatewayConfig config) {
ClickatellGatewayConfig clickatellConfiguration = (ClickatellGatewayConfig) config;
HttpEntity<ClickatellRequestEntity> request = new HttpEntity<>(getRequestBody(text, recipients), getRequestHeaderParameters(clickatellConfiguration));
HttpStatus httpStatus = send(clickatellConfiguration.getUrlTemplate() + MAX_MESSAGE_PART, request, HttpMethod.POST, ClickatellResponseEntity.class);
return wrapHttpStatus(httpStatus);
}
use of org.hisp.dhis.sms.outbound.ClickatellRequestEntity in project dhis2-core by dhis2.
the class ClickatellHttpGateway method getRequestBody.
// -------------------------------------------------------------------------
// Supportive methods
// -------------------------------------------------------------------------
private ClickatellRequestEntity getRequestBody(String text, Set<String> recipients) {
ClickatellRequestEntity requestBody = new ClickatellRequestEntity();
requestBody.setContent(text);
requestBody.setTo(recipients);
return requestBody;
}
use of org.hisp.dhis.sms.outbound.ClickatellRequestEntity in project dhis2-core by dhis2.
the class ClickatellGateway method getRequestBody.
// -------------------------------------------------------------------------
// Supportive methods
// -------------------------------------------------------------------------
private ClickatellRequestEntity getRequestBody(String text, Set<String> recipients) {
ClickatellRequestEntity requestBody = new ClickatellRequestEntity();
requestBody.setContent(text);
requestBody.setTo(recipients);
return requestBody;
}
use of org.hisp.dhis.sms.outbound.ClickatellRequestEntity in project dhis2-core by dhis2.
the class ClickatellGateway method send.
@Override
public OutboundMessageResponse send(String subject, String text, Set<String> recipients, SmsGatewayConfig config) {
ClickatellGatewayConfig clickatellConfiguration = (ClickatellGatewayConfig) config;
HttpEntity<ClickatellRequestEntity> request = new HttpEntity<>(getRequestBody(text, recipients), getRequestHeaderParameters(clickatellConfiguration));
HttpStatus httpStatus = send(clickatellConfiguration.getUrlTemplate() + MAX_MESSAGE_PART, request, ClickatellResponseEntity.class);
return wrapHttpStatus(httpStatus);
}
Aggregations