ru.dezhik.sms.sender.api.smsru.senders.SMSRuSendersHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sms-sender Show documentation
Show all versions of sms-sender Show documentation
Library for sending SMS via sms.ru gateway
package ru.dezhik.sms.sender.api.smsru.senders;
import java.util.List;
import java.util.StringTokenizer;
import org.apache.http.NameValuePair;
import ru.dezhik.sms.sender.api.smsru.AbstractSMSRuApiHandler;
/**
* @author ilya.dezhin
*/
public class SMSRuSendersHandler extends AbstractSMSRuApiHandler {
@Override
public String getMethodPath() {
return "/my/senders";
}
@Override
public void validate(SMSRuSendersRequest request) throws IllegalArgumentException {
}
@Override
public void appendParams(SMSRuSendersRequest request, List params) {
}
@Override
public SMSRuSendersResponse parseResponse(SMSRuSendersRequest request, String responseStr) {
final SMSRuSendersResponse response = new SMSRuSendersResponse();
final StringTokenizer tokenizer = tokenizeResponse(responseStr);
parseAndSetStatus(request, response, tokenizer);
while (tokenizer.hasMoreTokens()) {
response.addSenders(tokenizer.nextToken());
}
return response;
}
}