public class CreateUserCommand extends PostCommand<CreateUserResponse>
Command.CommonParameters, Command.Response
CONTENT_TYPE_JSON
Constructor and Description |
---|
CreateUserCommand(CreateUserCommand source) |
CreateUserCommand(java.lang.String email) |
Modifier and Type | Method and Description |
---|---|
PostCommand |
copy()
Returns a copy of this object.
|
protected CreateUserResponse |
createResponse(java.lang.String text,
int status,
java.lang.String contentType,
org.json.simple.JSONObject json)
Creates an instance of the response class, initialized with
the response text, the HTTP status code, and parsed JSONObject.
|
java.lang.String |
getEmail() |
org.json.simple.JSONObject |
getJsonObject()
Returns the JSON object to post, or null if the JSON object
has not yet been set.
|
boolean |
isSendEmail() |
void |
setEmail(java.lang.String email)
Set the email address for the new user.
|
void |
setSendEmail(boolean sendEmail)
Set to true to send email to the user with login instructions, false to skip email.
|
createRequest, setJsonObject
_execute, checkThrowError, execute, getActionName, getActionUrl, getControllerName, getHttpRequest, getParameters, getParamValueAsString, getQueryString, getRequiredVersion, getTimeout, setParameters, setRequiredVersion, setTimeout
public CreateUserCommand(java.lang.String email)
public CreateUserCommand(CreateUserCommand source)
public java.lang.String getEmail()
public void setEmail(java.lang.String email)
email
- The user's email addresspublic boolean isSendEmail()
public void setSendEmail(boolean sendEmail)
sendEmail
- True to send email, false to skip.protected CreateUserResponse createResponse(java.lang.String text, int status, java.lang.String contentType, org.json.simple.JSONObject json)
Command
Override this method to create an instance of a different class that extends CommandResponse
createResponse
in class Command<CreateUserResponse>
text
- The response text from the server.status
- The HTTP status code.contentType
- The Content-Type header value.json
- The parsed JSONObject (or null if no JSON was returned).public org.json.simple.JSONObject getJsonObject()
PostCommand
getJsonObject
in class PostCommand<CreateUserResponse>
public PostCommand copy()
Command
copy
in class PostCommand<CreateUserResponse>