一 Registration類的介紹
Registration是信息查詢包IQ的子類,所以它也包含表示操作類型的四個屬性:GET/SET等,當(dāng)其類型屬性為GET時,表示從服務(wù)器獲取注冊對象的信息;而SET類型則表示創(chuàng)建用戶,或者是更新已有用戶的賬戶資料。當(dāng)創(chuàng)建一個新賬戶時,XMPP服務(wù)器會需要一系列的其他屬性值,標準的賬戶屬性值列表如下:
name: 用戶名稱
first: 用戶的姓
last: 用戶的名稱
email: Email地址
city: 所在城市
state: 所在的州
zip: 郵編
phone: 手機號
url: 用戶的個人主頁
date: 注冊日期
misc: 相關(guān)的文字信息
remove: 賬戶是否停用的標志
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:
·name -- the user's name.
·first -- the user's first name.
·last -- the user's last name.
·email -- the user's email address.
·city -- the user's city.
·state -- the user's state.
·zip -- the user's ZIP code.
·phone -- the user's phone number.
·url -- the user's website.
·date -- the date the registration took place.
·misc -- other miscellaneous information to associate with the account.
·text -- textual information to associate with the account.
·remove -- empty flag to remove account.
二 常用方法
設(shè)置、獲取注冊賬戶的鍵值對。
getAttributes
public Map<String,String> getAttributes() Returns the map of String key/value pairs of account attributes.
Returns:the account attributes.
--------------------------------------------------------------------------------
setAttributes
public void setAttributes(Map<String,String> attributes) Sets the account attributes. The map must only contain String key/value pairs.
Parameters:attributes - the account attributes.
--------------------------------------------------------------------------------