本文整理汇总了Java中org.jivesoftware.smackx.muc.HostedRoom类的典型用法代码示例。如果您正苦于以下问题:Java HostedRoom类的具体用法?Java HostedRoom怎么用?Java HostedRoom使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HostedRoom类属于org.jivesoftware.smackx.muc包,在下文中一共展示了HostedRoom类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getHostRooms
import org.jivesoftware.smackx.muc.HostedRoom; //导入依赖的package包/类
/**
* 获取用户的所有聊天室
* @param xmppConnection
* @return
*/
public static List<HostedRoom> getHostRooms(XMPPConnection xmppConnection){
List<HostedRoom> roominfos = new ArrayList<HostedRoom>();
try {
new ServiceDiscoveryManager(xmppConnection);
Collection<HostedRoom> hostrooms = MultiUserChat.getHostedRooms(xmppConnection,xmppConnection.getServiceName());
for (HostedRoom entry : hostrooms) {
roominfos.add(entry);
Log.i("room", "名字:" + entry.getName() + " - ID:" + entry.getJid());
}
Log.i("room", "服务会议数量:" + roominfos.size());
} catch (XMPPException e) {
Log.e("getHostRooms",e.getMessage());
e.printStackTrace();
}
return roominfos;
}
开发者ID:FanHuaRan,项目名称:SmackStudy,代码行数:22,代码来源:XMPPUtil.java
示例2: getStatus
import org.jivesoftware.smackx.muc.HostedRoom; //导入依赖的package包/类
public ModuleSummary[] getStatus() {
ArrayList<ModuleSummary> entries = new ArrayList<ModuleSummary>();
try {
for (Iterator<HostedRoom> iter = MultiUserChat.getHostedRooms(conn, conferenceService).iterator(); iter.hasNext();) {
HostedRoom room = iter.next();
MultiUserChat.getRoomInfo(conn, room.getJid());
}
}
// FIXME: review error message
catch (XMPPException e) {
e.printStackTrace();
}
return entries.toArray(new ModuleSummary[entries.size()]);
}
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:15,代码来源:JabberClient.java
示例3: getHostRooms
import org.jivesoftware.smackx.muc.HostedRoom; //导入依赖的package包/类
/**
* 获取用户的所有聊天室
* @param xmppConnection
* @return
*/
public static List<HostedRoom> getHostRooms(XMPPConnection xmppConnection){
try {
new ServiceDiscoveryManager(xmppConnection);
Collection<HostedRoom> hostrooms = MultiUserChat.getHostedRooms(xmppConnection,xmppConnection.getServiceName());
return hostrooms.stream().collect(Collectors.toList());
} catch (XMPPException e) {
e.printStackTrace();
return null;
}
}
开发者ID:FanHuaRan,项目名称:SmackStudy,代码行数:16,代码来源:XMPPUtil.java
示例4: getAllHostedRooms
import org.jivesoftware.smackx.muc.HostedRoom; //导入依赖的package包/类
/**
* ��ȡHostedrooms
*
* @return
*/
public List<MucRoom> getAllHostedRooms() {
List<MucRoom> rooms = new ArrayList<MucRoom>();
try {
new ServiceDiscoveryManager(connection);
Collection<HostedRoom> hrooms = MultiUserChat.getHostedRooms(
connection, connection.getServiceName());
if (!hrooms.isEmpty()) {
for (HostedRoom r : hrooms) {
RoomInfo roominfo = MultiUserChat.getRoomInfo(connection,
r.getJid());
SLog.i("������Info", roominfo.toString());
MucRoom mr = new MucRoom();
mr.setDescription(roominfo.getDescription());
mr.setName(r.getName());
mr.setJid(r.getJid());
mr.setOccupants(roominfo.getOccupantsCount());
mr.setSubject(roominfo.getSubject());
rooms.add(mr);
}
}
} catch (XMPPException e) {
SLog.e(tag, " ��ȡHosted Rooms ����");
SLog.e(tag, Log.getStackTraceString(e));
}
return rooms;
}
开发者ID:ice-coffee,项目名称:EIM,代码行数:32,代码来源:XmppConnectionManager.java
示例5: getConferenceRoom
import org.jivesoftware.smackx.muc.HostedRoom; //导入依赖的package包/类
/**
* ��ȡ�����������л�����
* @return
* @throws XMPPException
*/
public List<MucRoom> getConferenceRoom() throws XMPPException {
List<MucRoom> list = new ArrayList<MucRoom>();
new ServiceDiscoveryManager(connection);
if (!MultiUserChat.getHostedRooms(connection,
connection.getServiceName()).isEmpty()) {
for (HostedRoom k : MultiUserChat.getHostedRooms(connection,
connection.getServiceName())) {
for (HostedRoom j : MultiUserChat.getHostedRooms(connection,
k.getJid())) {
RoomInfo info2 = MultiUserChat.getRoomInfo(connection,
j.getJid());
if (j.getJid().indexOf("@") > 0) {
MucRoom friendrooms = new MucRoom();
friendrooms.setName(j.getName());//�����ҵ�����
friendrooms.setJid(j.getJid());//������JID
friendrooms.setOccupants(info2.getOccupantsCount());//��������ռ��������
friendrooms.setDescription(info2.getDescription());//�����ҵ�����
friendrooms.setSubject(info2.getSubject());//�����ҵ�����
list.add(friendrooms);
}
}
}
}
return list;
}
开发者ID:ice-coffee,项目名称:EIM,代码行数:33,代码来源:XmppConnectionManager.java
示例6: xmppHostedRooms2MultiChatRooms
import org.jivesoftware.smackx.muc.HostedRoom; //导入依赖的package包/类
public List<PersonalInfo> xmppHostedRooms2MultiChatRooms(Collection<HostedRoom> hostedRooms, String ownerJid, byte serviceId) {
if (hostedRooms == null){
return Collections.emptyList();
}
List<PersonalInfo> chats = new ArrayList<PersonalInfo>(hostedRooms.size());
for (HostedRoom room: hostedRooms){
chats.add(xmppHostedRoom2PersonalInfo(room, serviceId));
}
return chats;
}
开发者ID:snuk182,项目名称:aceim,代码行数:12,代码来源:XMPPEntityAdapter.java
示例7: xmppHostedRoom2PersonalInfo
import org.jivesoftware.smackx.muc.HostedRoom; //导入依赖的package包/类
private PersonalInfo xmppHostedRoom2PersonalInfo(HostedRoom room, byte serviceId) {
if (room == null) {
return null;
}
PersonalInfo info = new PersonalInfo(serviceId);
info.setProtocolUid(room.getJid());
info.setMultichat(true);
info.getProperties().putString(PersonalInfo.INFO_NICK, room.getName());
return info;
}
开发者ID:snuk182,项目名称:aceim,代码行数:13,代码来源:XMPPEntityAdapter.java
示例8: getHostRooms
import org.jivesoftware.smackx.muc.HostedRoom; //导入依赖的package包/类
@Override
public List<HostedRoom> getHostRooms() {
return XMPPUtil.getHostRooms(xmppConnection);
}
开发者ID:FanHuaRan,项目名称:SmackStudy,代码行数:5,代码来源:XMPPConnectionWrapper.java
示例9: loadRooms
import org.jivesoftware.smackx.muc.HostedRoom; //导入依赖的package包/类
private void loadRooms() {
getXmppBinder().execute(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
try {
Collection<HostedRoom> hostedRooms = MultiUserChat
.getHostedRooms(
getXmppBinder().getXmppConnection(),
"conference."
+ XmppConnectionUtils.getXmppHost());
if (!hostedRooms.isEmpty()) {
ArrayList<TabContactsModel> models = new ArrayList<TabContactsModel>();
for (HostedRoom hostedRoom : hostedRooms) {
RoomInfo roomInfo = MultiUserChat.getRoomInfo(
getXmppBinder().getXmppConnection(),
hostedRoom.getJid());
TabContactsModel model = new TabContactsModel();
MultiChatDesc desc = MultiChatDesc
.fromString(roomInfo.getDescription());
if (!YiUtils.isStringInvalid(roomInfo.getSubject())) {
model.setMsg(roomInfo.getSubject());
} else if (!YiUtils.isStringInvalid(desc.getName())) {
model.setMsg(desc.getName());
} else {
model.setMsg(roomInfo.getRoom());
}
model.setUser(roomInfo.getRoom());
model.setSubMsg(roomInfo.getDescription());
models.add(model);
}
Message message = getHandler().obtainMessage(
MSG_UPDATE_LIST, models);
message.sendToTarget();
}
} catch (Exception e) {
// TODO: handle exception
YiLog.getInstance().e(e, "load rooms failed");
}
}
});
}
开发者ID:ikantech,项目名称:yiim_v2,代码行数:45,代码来源:MultiRoomDiscoverActivity.java
示例10: xmppHostedRoom2MultiChatRoom
import org.jivesoftware.smackx.muc.HostedRoom; //导入依赖的package包/类
public MultiChatRoom xmppHostedRoom2MultiChatRoom(HostedRoom room, String ownerJid, byte serviceId) {
MultiChatRoom chat = new MultiChatRoom(room.getJid(), ownerJid, XMPPApiConstants.PROTOCOL_NAME, serviceId);
chat.setName(room.getName());
return chat;
}
开发者ID:snuk182,项目名称:aceim,代码行数:6,代码来源:XMPPEntityAdapter.java
示例11: getHostRooms
import org.jivesoftware.smackx.muc.HostedRoom; //导入依赖的package包/类
/**
* 获取用户的所有聊天室
* @return
*/
List<HostedRoom> getHostRooms();
开发者ID:FanHuaRan,项目名称:SmackStudy,代码行数:6,代码来源:IXMPConnectionWrapper.java
示例12: getRoomList
import org.jivesoftware.smackx.muc.HostedRoom; //导入依赖的package包/类
/**
* Returns a Collection of all rooms in the specified Conference Service.
*
* @param serviceName
* the name of the conference service.
* @return a Collection of all rooms in the Conference service.
* @throws Exception
* if a problem occurs while getting the room list
*/
private static Collection<HostedRoom> getRoomList(String serviceName)
throws Exception {
return MultiUserChat.getHostedRooms(SparkManager.getConnection(),
serviceName);
}
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:15,代码来源:ConferenceRoomBrowser.java
示例13: getRoomList
import org.jivesoftware.smackx.muc.HostedRoom; //导入依赖的package包/类
/**
* Return a list of available Conference rooms from the server
* based on the service name.
*
* @param serviceName the service name (ex. [email protected])
* @return a collection of rooms.
* @throws Exception if an error occured during fetch.
*/
public static Collection<HostedRoom> getRoomList(String serviceName) throws Exception {
return MultiUserChat.getHostedRooms(SparkManager.getConnection(), serviceName);
}
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:12,代码来源:ConferenceUtils.java
注:本文中的org.jivesoftware.smackx.muc.HostedRoom类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论