Smack

org.jivesoftware.smack.packet
Class Registration

java.lang.Object
  extended by org.jivesoftware.smack.packet.Packet
      extended by org.jivesoftware.smack.packet.IQ
          extended by org.jivesoftware.smack.packet.Registration

public class Registration
extends IQ

Represents registration packets. An empty GET query will cause the server to return information about it's registration support. SET queries can be used to create accounts or update existing account information. XMPP servers may require a number of attributes to be set when creating a new account. The standard account attributes are as follows:

Author:
Matt Tucker

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jivesoftware.smack.packet.IQ
IQ.Type
 
Field Summary
 
Fields inherited from class org.jivesoftware.smack.packet.Packet
ID_NOT_AVAILABLE
 
Constructor Summary
Registration()
           
 
Method Summary
 Map getAttributes()
          Returns the map of String key/value pairs of account attributes.
 String getChildElementXML()
          Returns the sub-element XML section of the IQ packet, or null if there isn't one.
 String getInstructions()
          Returns the registration instructions, or null if no instructions have been set.
 String getPassword()
          Returns the password, or null if no password has been set.
 String getUsername()
          Returns the username, or null if no username has ben set.
 void setAttributes(Map attributes)
          Sets the account attributes.
 void setInstructions(String instructions)
          Sets the registration instructions.
 void setPassword(String password)
          Sets the password.
 void setUsername(String username)
          Sets the username.
 
Methods inherited from class org.jivesoftware.smack.packet.IQ
getType, setType, toXML
 
Methods inherited from class org.jivesoftware.smack.packet.Packet
addExtension, deleteProperty, getError, getExtension, getExtensions, getExtensionsXML, getFrom, getPacketID, getProperty, getPropertyNames, getTo, removeExtension, setError, setFrom, setPacketID, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Registration

public Registration()
Method Detail

getUsername

public String getUsername()
Returns the username, or null if no username has ben set.

Returns:
the username.

setUsername

public void setUsername(String username)
Sets the username.

Parameters:
username - the username.

getPassword

public String getPassword()
Returns the password, or null if no password has been set.

Returns:
the password.

setPassword

public void setPassword(String password)
Sets the password.

Parameters:
password - the password.

getInstructions

public String getInstructions()
Returns the registration instructions, or null if no instructions have been set. If present, instructions should be displayed to the end-user that will complete the registration process.

Returns:
the registration instructions, or null if there are none.

setInstructions

public void setInstructions(String instructions)
Sets the registration instructions.

Parameters:
instructions - the registration instructions.

getAttributes

public Map getAttributes()
Returns the map of String key/value pairs of account attributes.

Returns:
the account attributes.

setAttributes

public void setAttributes(Map attributes)
Sets the account attributes. The map must only contain String key/value pairs.

Parameters:
attributes - the account attributes.

getChildElementXML

public String getChildElementXML()
Description copied from class: IQ
Returns the sub-element XML section of the IQ packet, or null if there isn't one. Packet extensions must be included, if any are defined.

Extensions of this class must override this method.

Specified by:
getChildElementXML in class IQ
Returns:
the child element section of the IQ XML.

Smack

Copyright © 2003 Jive Software.