Search in sources :

Example 1 with ClickatellRequestEntity

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);
}
Also used : ClickatellRequestEntity(org.hisp.dhis.sms.outbound.ClickatellRequestEntity) HttpEntity(org.springframework.http.HttpEntity) HttpStatus(org.springframework.http.HttpStatus)

Example 2 with ClickatellRequestEntity

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;
}
Also used : ClickatellRequestEntity(org.hisp.dhis.sms.outbound.ClickatellRequestEntity)

Example 3 with ClickatellRequestEntity

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;
}
Also used : ClickatellRequestEntity(org.hisp.dhis.sms.outbound.ClickatellRequestEntity)

Example 4 with ClickatellRequestEntity

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);
}
Also used : ClickatellRequestEntity(org.hisp.dhis.sms.outbound.ClickatellRequestEntity) HttpEntity(org.springframework.http.HttpEntity) HttpStatus(org.springframework.http.HttpStatus)

Aggregations

ClickatellRequestEntity (org.hisp.dhis.sms.outbound.ClickatellRequestEntity)4 HttpEntity (org.springframework.http.HttpEntity)2 HttpStatus (org.springframework.http.HttpStatus)2