认识smack中的基本对象 - Registration

53 篇文章 0 订阅
49 篇文章 0 订阅

一 Registration类的介绍

Registration是信息查询包IQ的子类,所以它也包含表示操作类型的四个属性:GET/SET等,当其类型属性为GET时,表示从服务器获取注册对象的信息;而SET类型则表示创建用户,或者是更新已有用户的账户资料。当创建一个新账户时,XMPP服务器会需要一系列的其他属性值,标准的账户属性值列表如下:

name: 用户名称

first: 用户的姓

last: 用户的名称

email: Email地址

city: 所在城市

state: 所在的州

zip: 邮编

phone: 手机号

url: 用户的个人主页

date: 注册日期

misc: 相关的文字信息

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.

二 常用方法

设置、获取注册账户的键值对。

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.
--------------------------------------------------------------------------------

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值