|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object soc.message.SOCMessage soc.message.SOCCreateAccount
public class SOCCreateAccount
This message is a request to create an account
The server will respond with a SOCStatusMessage
indicating whether the account was created,
with status SOCStatusMessage.SV_ACCT_CREATED_OK
or an error/rejection status and brief text.
In version 1.1.19 and higher, by default users must authenticate before creating user accounts.
(See SOCServerFeatures.FEAT_OPEN_REG
.) If the user needs to log in but hasn't
before sending SOCCreateAccount
, the server replies with SOCStatusMessage.SV_PW_WRONG
.
In version 1.1.20 and higher, after creating the very first account the reply status is
SOCStatusMessage.SV_ACCT_CREATED_OK_FIRST_ONE
unless FEAT_OPEN_REG
is active.
Field Summary | |
---|---|
private java.lang.String |
email
Email address, optional; see getEmail() . |
private java.lang.String |
host
Host name, required; see getHost() for details and history. |
private java.lang.String |
nickname
Nickname |
private static java.lang.String |
NULLEMAIL
symbol to represent a null email |
private java.lang.String |
password
Password, required; see getPassword() for details and history. |
private static long |
serialVersionUID
|
Constructor Summary | |
---|---|
SOCCreateAccount(java.lang.String nn,
java.lang.String pw,
java.lang.String hn,
java.lang.String em)
Create a CreateAccount message. |
Method Summary | |
---|---|
java.lang.String |
getEmail()
Optional email address for the requested new account. |
java.lang.String |
getHost()
Host name for the requested new account. |
java.lang.String |
getNickname()
Nickname (username) to give to requested account. |
java.lang.String |
getPassword()
Password for the requested new account. |
static SOCCreateAccount |
parseDataStr(java.lang.String s)
Parse the command String into a CreateAccount message. |
java.lang.String |
toCmd()
CREATEACCOUNT sep nickname sep2 password sep2 host sep2 email |
static java.lang.String |
toCmd(java.lang.String nn,
java.lang.String pw,
java.lang.String hn,
java.lang.String em)
CREATEACCOUNT sep nickname sep2 password sep2 host sep2 email |
java.lang.String |
toString()
Simple human-readable representation, used for debug purposes. |
Methods inherited from class soc.message.SOCMessage |
---|
arrayIntoStringBuf, enumIntoStringBuf, getClassNameShort, getMaximumVersion, getMinimumVersion, getType, isSingleLineAndSafe, isSingleLineAndSafe, toMsg |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private static java.lang.String NULLEMAIL
private java.lang.String nickname
private java.lang.String password
getPassword()
for details and history.
private java.lang.String host
getHost()
for details and history.
private java.lang.String email
getEmail()
.
Constructor Detail |
---|
public SOCCreateAccount(java.lang.String nn, java.lang.String pw, java.lang.String hn, java.lang.String em) throws java.lang.IllegalArgumentException
nn
- nickname Nickname (username) to give to requested account.
The name must pass SOCMessage.isSingleLineAndSafe(String)
in server v1.1.19 and higher.pw
- password; must not be null or ""hn
- host name; must not be null or ""em
- email; can be "", should not be null
java.lang.IllegalArgumentException
- if pw
or hn
are null or empty ("")Method Detail |
---|
public java.lang.String getNickname()
SOCMessage.isSingleLineAndSafe(String)
in server v1.1.19 and higher.
public java.lang.String getPassword()
toCmd(String, String, String, String)
,
and parseDataStr(String)
.
Before v1.1.19, those methods didn't check their parameters for a non-blank password;
parseDataStr(String)
has always rejected a message without a password because
two adjacent field-separator tokens (if no password) would be treated as one, and
not enough fields would be found in the message.
public java.lang.String getHost()
toCmd(String, String, String, String)
,
and parseDataStr(String)
.
Before v1.1.19, those methods didn't check their parameters for a non-blank host;
parseDataStr(String)
has always rejected a message without a host because
two adjacent field-separator tokens (if no host) would be treated as one, and
not enough fields would be found in the message.
public java.lang.String getEmail()
public java.lang.String toCmd()
toCmd
in class SOCMessage
public static java.lang.String toCmd(java.lang.String nn, java.lang.String pw, java.lang.String hn, java.lang.String em) throws java.lang.IllegalArgumentException
nn
- the nicknamepw
- the password; must not be null or ""hn
- the host name; must not be null or ""em
- the email; optional, can use null or ""
java.lang.IllegalArgumentException
- if pw
or hn
are null or empty ("")public static SOCCreateAccount parseDataStr(java.lang.String s)
s
- the String to parse
public java.lang.String toString()
SOCMessage
toString
in class SOCMessage
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |