com.alogient.cameleon.sdk.community.interspire.request.impl.CreateUnSubscribersRequest Maven / Gradle / Ivy
The newest version!
package com.alogient.cameleon.sdk.community.interspire.request.impl;
import com.alogient.cameleon.sdk.community.interspire.jaxb.Details;
import com.alogient.cameleon.sdk.community.interspire.jaxb.XmlRequest;
import com.alogient.cameleon.sdk.community.interspire.jaxb.type.RequestMethod;
import com.alogient.cameleon.sdk.community.interspire.jaxb.type.RequestType;
import com.alogient.cameleon.sdk.community.interspire.request.IUnSubscribersRequest;
import com.alogient.cameleon.sdk.community.interspire.response.IResponse;
import com.alogient.cameleon.sdk.community.interspire.response.UnSubscriberResponse;
/**
* Used to unsubscribe a user from a list
*
* User: jmirc
* Date: 27-Jan-2010
* Time: 5:25:13 PM
*/
public class CreateUnSubscribersRequest extends BaseRequest implements IUnSubscribersRequest {
/**
* The XML request
*/
private XmlRequest xmlRequest;
/**
* Details
*/
private Details details = new Details();
/**
* Contructor.
* JABX needs a default contructor.
*/
public CreateUnSubscribersRequest() {
super(null, UnSubscriberResponse.class);
}
/**
* Default constructor
* @param username the Interspire username
* @param userToken the Interspire token
* @param interspireURL The URL of the Interspire server
*/
public CreateUnSubscribersRequest(String username, String userToken,
String interspireURL) {
super(interspireURL, UnSubscriberResponse.class);
this.xmlRequest = new XmlRequest();
xmlRequest.setUserName(username);
xmlRequest.setUserToken(userToken);
xmlRequest.setRequestType(RequestType.SUBSCRIBERS);
xmlRequest.setRequestMethod(RequestMethod.DELETE_SUBSCRIBER);
xmlRequest.setDetails(details);
}
@Override
public XmlRequest getXmlRequest() {
return xmlRequest;
}
@Override
public void setEmailAddress(String emailAddress) {
details.setEmailAddress(emailAddress);
}
@Override
public void setListNumber(String listNumber) {
details.setListNumber(listNumber);
}
@Override
public IResponse sendRequest() throws Exception {
return super.send(xmlRequest);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy