Issue #437 - Updates to status handling - Added SessionManager user presence.
Former-commit-id: 77520e5b98de679a1f08b523fb85464a31bd4c02
This commit is contained in:
parent
18e9f2c6ad
commit
07bc1bf83e
7 changed files with 242 additions and 93 deletions
|
@ -23,10 +23,6 @@ import java.util.Collection;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.ecf.core.util.ECFException;
|
||||
import org.eclipse.ecf.presence.IPresenceContainerAdapter;
|
||||
import org.eclipse.ecf.presence.roster.IRosterSubscriptionSender;
|
||||
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.IPresence;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRoster;
|
||||
|
@ -37,10 +33,7 @@ import com.raytheon.uf.viz.collaboration.comm.identity.user.IChatID;
|
|||
import com.raytheon.uf.viz.collaboration.comm.identity.user.ID;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.Presence;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.Tools;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.user.IDConverter;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.user.RosterId;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueUserId;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
|
@ -123,7 +116,20 @@ public class Roster extends RosterItem implements IRoster {
|
|||
*/
|
||||
@Override
|
||||
public void addRosterEntry(IRosterEntry entry) {
|
||||
entries.put(entry.getUser(), entry);
|
||||
IRosterEntry re = null;
|
||||
|
||||
IQualifiedID id = entry.getUser();
|
||||
re = internalEntries.get(id);
|
||||
// ensure the entry is not present!
|
||||
if(re == null) {
|
||||
// put in the internal entries first.
|
||||
internalEntries.put(entry.getUser(), entry);
|
||||
|
||||
for(IRosterGroup g : entry.getGroups()) {
|
||||
RosterGroup rg = (RosterGroup) g;
|
||||
rg.setRoster(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -198,7 +204,6 @@ public class Roster extends RosterItem implements IRoster {
|
|||
@Override
|
||||
public void addRosterEntry(IQualifiedID user, String nickName,
|
||||
String[] groups) {
|
||||
|
||||
if (user != null) {
|
||||
IRosterEntry entry = internalEntries.get(user.getFQName());
|
||||
if (entry == null) {
|
||||
|
@ -207,6 +212,8 @@ public class Roster extends RosterItem implements IRoster {
|
|||
entry = new RosterEntry(id);
|
||||
}
|
||||
internalEntries.put(entry.getUser(), entry);
|
||||
|
||||
listRoster();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -310,4 +317,34 @@ public class Roster extends RosterItem implements IRoster {
|
|||
// </pre>
|
||||
// *******************************************
|
||||
|
||||
|
||||
public void listRoster() {
|
||||
|
||||
System.out.println("##########################################################################");
|
||||
System.out.println("Roster for : " + user.getFQName());
|
||||
System.out.println("#####################################");
|
||||
System.out.println("# Ungrouped entries");
|
||||
System.out.println("-------------------------------------");
|
||||
Collection<IRosterEntry> entries = getEntries();
|
||||
for(IRosterEntry r : entries) {
|
||||
System.out.print(" " + r.getName());
|
||||
}
|
||||
System.out.println("#####################################");
|
||||
System.out.println("# Groups ");
|
||||
System.out.println("-------------------------------------");
|
||||
Collection<IRosterGroup> groups = getGroups();
|
||||
for(IRosterGroup g : groups) {
|
||||
System.out.print(" " + g.getName());
|
||||
entries = g.getEntries();
|
||||
for(IRosterEntry r : entries) {
|
||||
System.out.print(" " + r.getName());
|
||||
}
|
||||
System.out.println("-----------------");
|
||||
}
|
||||
System.out.println("##########################################################################");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -23,11 +23,15 @@ import java.util.Collection;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.ecf.core.identity.ID;
|
||||
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.IPresence;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterEntry;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterGroup;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.user.IChatID;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.Presence;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.Tools;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.user.RosterId;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
|
@ -143,6 +147,37 @@ public class RosterEntry extends RosterItem implements IRosterEntry,
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param entry
|
||||
* @return
|
||||
*/
|
||||
public static IRosterEntry convertEntry(org.eclipse.ecf.presence.roster.IRosterEntry entry) {
|
||||
RosterEntry rosterEntry = null;
|
||||
if(entry != null) {
|
||||
ID id = entry.getUser().getID();
|
||||
|
||||
String name = Tools.parseName(id.getName());
|
||||
String host = Tools.parseHost(id.getName());
|
||||
String resource = Tools.parseResource(id.getName());
|
||||
IChatID rosterId = new RosterId(name, host, resource);
|
||||
|
||||
rosterEntry = new RosterEntry(rosterId);
|
||||
IPresence p = Presence.convertPresence(entry.getPresence());
|
||||
rosterEntry.setPresence(p);
|
||||
|
||||
// Now check the groups
|
||||
@SuppressWarnings("unchecked")
|
||||
Collection<org.eclipse.ecf.presence.roster.IRosterGroup> inGroups = entry.getGroups();
|
||||
for(org.eclipse.ecf.presence.roster.IRosterGroup g : inGroups) {
|
||||
RosterGroup group = new RosterGroup(g.getName(), null,null);
|
||||
rosterEntry.addGroup(group);
|
||||
}
|
||||
}
|
||||
return rosterEntry;
|
||||
}
|
||||
|
||||
|
||||
public static final void main(String[] args) {
|
||||
|
||||
IChatID id = new IChatID() {
|
||||
|
|
|
@ -19,13 +19,16 @@
|
|||
**/
|
||||
package com.raytheon.uf.viz.collaboration.comm.provider.roster;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRoster;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterEntry;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterGroup;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterItem;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.user.RosterId;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
|
@ -46,19 +49,17 @@ import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterItem;
|
|||
|
||||
public class RosterGroup extends RosterItem implements IRosterGroup {
|
||||
|
||||
private Collection<IRosterEntry> entries = null;
|
||||
private Map<IQualifiedID, IRosterEntry> entries = null;
|
||||
|
||||
private Collection<IRosterGroup> groups = null;
|
||||
private Map<IRosterGroup, IRosterGroup> groups = null;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public RosterGroup(String name, IRosterItem parent, IRoster roster) {
|
||||
super(name, parent, roster);
|
||||
entries = new ArrayList<IRosterEntry>();
|
||||
if (roster.supportsNestedGroups()) {
|
||||
groups = new ArrayList<IRosterGroup>();
|
||||
}
|
||||
entries = new HashMap<IQualifiedID, IRosterEntry>();
|
||||
groups = new HashMap<IRosterGroup, IRosterGroup>();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -66,7 +67,16 @@ public class RosterGroup extends RosterItem implements IRosterGroup {
|
|||
* @param entry
|
||||
*/
|
||||
public void addEntry(IRosterEntry entry) {
|
||||
entries.add(entry);
|
||||
|
||||
IRosterEntry re = entries.get(entry.getUser());
|
||||
if (re == null) {
|
||||
IQualifiedID user = entry.getUser();
|
||||
RosterId id = new RosterId(user.getName(), user.getHost(), null,
|
||||
user.getResource());
|
||||
|
||||
re = new RosterEntry(id);
|
||||
entries.put(entry.getUser(), entry);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -75,7 +85,7 @@ public class RosterGroup extends RosterItem implements IRosterGroup {
|
|||
*/
|
||||
@Override
|
||||
public Collection<IRosterEntry> getEntries() {
|
||||
return entries;
|
||||
return entries.values();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -84,11 +94,7 @@ public class RosterGroup extends RosterItem implements IRosterGroup {
|
|||
* @return
|
||||
*/
|
||||
public IRosterEntry removeEntry(IRosterEntry entry) {
|
||||
IRosterEntry removed = null;
|
||||
if (entries.remove(entry)) {
|
||||
removed = entry;
|
||||
}
|
||||
return removed;
|
||||
return entries.remove(entry.getUser());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -97,6 +103,6 @@ public class RosterGroup extends RosterItem implements IRosterGroup {
|
|||
*/
|
||||
@Override
|
||||
public Collection<IRosterGroup> getGroups() {
|
||||
return groups;
|
||||
return groups.values();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,12 +69,10 @@ public class RosterManager implements IRosterManager {
|
|||
*
|
||||
* @param roster
|
||||
*/
|
||||
public RosterManager(org.eclipse.ecf.presence.roster.IRoster roster, SessionManager manager) {
|
||||
public RosterManager(SessionManager manager) {
|
||||
sessionManager = manager;
|
||||
baseRoster = roster;
|
||||
owner = roster.getName();
|
||||
this.roster = toLocalRoster(roster);
|
||||
}
|
||||
updateRoster();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -86,6 +84,11 @@ public class RosterManager implements IRosterManager {
|
|||
return roster;
|
||||
}
|
||||
|
||||
private void updateRoster() {
|
||||
baseRoster = sessionManager.getPresenceContainerAdapter().getRosterManager().getRoster();
|
||||
roster = toLocalRoster(baseRoster);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param listener
|
||||
|
@ -157,7 +160,6 @@ public class RosterManager implements IRosterManager {
|
|||
.getRosterSubscriptionSender();
|
||||
|
||||
ID id = sessionManager.createID(userId.getFQName());
|
||||
System.out.println(" sendRosterRemove(" + id + ")");
|
||||
try {
|
||||
sender.sendRosterRemove(id);
|
||||
} catch (ECFException e) {
|
||||
|
@ -167,6 +169,33 @@ public class RosterManager implements IRosterManager {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param fromId
|
||||
* @param presence
|
||||
*/
|
||||
public void updateEntry(IChatID fromId, IPresence presence) {
|
||||
RosterEntry re = new RosterEntry(fromId);
|
||||
re.setPresence(presence);
|
||||
|
||||
IRosterEntry modified = roster.modifyRosterEntry(re);
|
||||
if(modified != null) {
|
||||
sessionManager.getEventPublisher().post(re);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param fromId
|
||||
* @param presence
|
||||
*/
|
||||
public void updateEntry(IRosterEntry entry) {
|
||||
IRosterEntry modified = roster.modifyRosterEntry(entry);
|
||||
if(modified != null) {
|
||||
sessionManager.getEventPublisher().post(entry);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param roster
|
||||
|
@ -207,21 +236,6 @@ public class RosterManager implements IRosterManager {
|
|||
return newRoster;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param fromId
|
||||
* @param presence
|
||||
*/
|
||||
public void updateEntry(IChatID fromId, IPresence presence) {
|
||||
RosterEntry re = new RosterEntry(fromId);
|
||||
re.setPresence(presence);
|
||||
|
||||
IRosterEntry modified = roster.modifyRosterEntry(re);
|
||||
if(modified != null) {
|
||||
sessionManager.getEventPublisher().post(re);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.eclipse.ecf.core.identity.ID;
|
|||
import org.eclipse.ecf.core.util.ECFException;
|
||||
import org.eclipse.ecf.presence.IPresenceContainerAdapter;
|
||||
import org.eclipse.ecf.presence.IPresenceSender;
|
||||
import org.eclipse.ecf.presence.roster.IRosterManager;
|
||||
import org.eclipse.ecf.presence.roster.IRosterSubscriptionListener;
|
||||
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
|
||||
|
@ -74,17 +75,13 @@ public class AccountManager implements IAccountManager {
|
|||
} else {
|
||||
subscribedType = IPresence.Type.SUBSCRIBED;
|
||||
}
|
||||
org.eclipse.ecf.presence.Presence.Type sType = Tools
|
||||
.convertPresenceType(subscribedType);
|
||||
|
||||
org.eclipse.ecf.presence.IPresence presence = new org.eclipse.ecf.presence.Presence(
|
||||
sType);
|
||||
|
||||
IPresence presence = new Presence(IPresence.Mode.AVAILABLE,
|
||||
subscribedType, null);
|
||||
try {
|
||||
presenceAdapter.getRosterManager().getPresenceSender()
|
||||
.sendPresenceUpdate(fromID, presence);
|
||||
} catch (ECFException e) {
|
||||
// Will have to do something with this sooner or later.
|
||||
sendPresence(presence);
|
||||
} catch (CollaborationException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,11 +102,14 @@ public class AccountManager implements IAccountManager {
|
|||
|
||||
private ISubscriptionResponder responder;
|
||||
|
||||
private SessionManager sessionManager = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param adapter
|
||||
*/
|
||||
AccountManager(IPresenceContainerAdapter adapter) {
|
||||
AccountManager(IPresenceContainerAdapter adapter, SessionManager manager) {
|
||||
sessionManager = manager;
|
||||
presenceAdapter = adapter;
|
||||
presenceAdapter.getRosterManager().addRosterSubscriptionListener(
|
||||
autoResponder);
|
||||
|
@ -138,7 +138,7 @@ public class AccountManager implements IAccountManager {
|
|||
*/
|
||||
@Override
|
||||
public boolean getAutoSubscriptionMode() {
|
||||
return false;
|
||||
return autoRespond;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -228,12 +228,27 @@ public class AccountManager implements IAccountManager {
|
|||
* @see com.raytheon.uf.viz.collaboration.comm.identity.IAccountManager#createAccount(java.lang.String,
|
||||
* char[], java.util.Map)
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public void createAccount(String name, char[] password,
|
||||
Map<String, String> attributes) throws CollaborationException {
|
||||
if (name != null) {
|
||||
if (password != null) {
|
||||
// create the account
|
||||
org.eclipse.ecf.presence.IAccountManager manager = presenceAdapter
|
||||
.getAccountManager();
|
||||
if (manager != null) {
|
||||
Map map = null;
|
||||
if (attributes != null) {
|
||||
map = (Map) attributes;
|
||||
}
|
||||
|
||||
try {
|
||||
manager.createAccount(name, new String(password), map);
|
||||
} catch (ECFException e) {
|
||||
throw new CollaborationException("Could not create account ");
|
||||
}
|
||||
}
|
||||
// all done so clear the password.
|
||||
Arrays.fill(password, (char) 0);
|
||||
}
|
||||
|
@ -249,13 +264,16 @@ public class AccountManager implements IAccountManager {
|
|||
@Override
|
||||
public void sendPresence(IPresence userPresence)
|
||||
throws CollaborationException {
|
||||
IPresenceSender sender = presenceAdapter.getRosterManager()
|
||||
.getPresenceSender();
|
||||
|
||||
IRosterManager manager = presenceAdapter.getRosterManager();
|
||||
IPresenceSender sender = manager.getPresenceSender();
|
||||
|
||||
try {
|
||||
sender.sendPresenceUpdate(null,
|
||||
Presence.convertPresence(userPresence));
|
||||
sessionManager.setPresence(userPresence);
|
||||
} catch (ECFException e) {
|
||||
// TODO : Exception handing....
|
||||
throw new CollaborationException("Could not send presence");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -172,7 +172,6 @@ public abstract class BaseSession implements ISession {
|
|||
*/
|
||||
public ID createID(String name) throws IDCreateException {
|
||||
ID id = null;
|
||||
name += "/foo"; // TODO fix this in a better way
|
||||
if (connectionNamespace != null) {
|
||||
id = IDFactory.getDefault().createID(connectionNamespace, name);
|
||||
}
|
||||
|
|
|
@ -64,6 +64,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.Presence;
|
|||
import com.raytheon.uf.viz.collaboration.comm.provider.Tools;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.event.VenueInvitationEvent;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.info.InfoAdapter;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.roster.RosterEntry;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.roster.RosterManager;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.user.IDConverter;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.user.RosterId;
|
||||
|
@ -114,6 +115,10 @@ public class SessionManager implements IEventPublisher {
|
|||
|
||||
private String password;
|
||||
|
||||
private IChatID user;
|
||||
|
||||
private IPresence userPresence;
|
||||
|
||||
private IChatRoomInvitationListener intInvitationListener;
|
||||
|
||||
private IPresenceContainerAdapter presenceAdapter;
|
||||
|
@ -167,6 +172,14 @@ public class SessionManager implements IEventPublisher {
|
|||
throw new CollaborationException(
|
||||
"Login failed. Invalid username or password", e);
|
||||
}
|
||||
ID id = container.getConnectedID();
|
||||
if(id != null) {
|
||||
String name = Tools.parseName(id.getName());
|
||||
String host = Tools.parseHost(id.getName());
|
||||
String resource = Tools.parseResource(id.getName());
|
||||
user = new RosterId(name, host, resource);
|
||||
}
|
||||
|
||||
setupAccountManager();
|
||||
|
||||
eventBus = new EventBus();
|
||||
|
@ -198,6 +211,30 @@ public class SessionManager implements IEventPublisher {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @see com.raytheon.uf.viz.collaboration.comm.identity.roster.IRoster#getUser()
|
||||
*/
|
||||
public IChatID getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public IPresence getPresence() {
|
||||
return userPresence;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public void setPresence(IPresence presence) {
|
||||
userPresence = presence;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws CollaborationException
|
||||
* @throws ContainerConnectException
|
||||
|
@ -224,7 +261,7 @@ public class SessionManager implements IEventPublisher {
|
|||
private void setupAccountManager() {
|
||||
if (accountManager == null) {
|
||||
if (isConnected() && (presenceAdapter != null)) {
|
||||
accountManager = new AccountManager(presenceAdapter);
|
||||
accountManager = new AccountManager(presenceAdapter, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -254,16 +291,15 @@ public class SessionManager implements IEventPublisher {
|
|||
*
|
||||
*/
|
||||
private void setupRosterManager() {
|
||||
IRoster roster = null;
|
||||
IPresenceContainerAdapter presenceAdapter = Tools
|
||||
.getPresenceContainerAdapter(container,
|
||||
IPresenceContainerAdapter.class);
|
||||
if (presenceAdapter != null) {
|
||||
roster = presenceAdapter.getRosterManager().getRoster();
|
||||
if (roster != null) {
|
||||
rosterManager = new RosterManager(roster, this);
|
||||
}
|
||||
}
|
||||
rosterManager = new RosterManager(this);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public IPresenceContainerAdapter getPresenceContainerAdapter() {
|
||||
return presenceAdapter;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -384,8 +420,6 @@ public class SessionManager implements IEventPublisher {
|
|||
session.setSessionDataProvider(me);
|
||||
|
||||
IPresence presence = new Presence();
|
||||
presence.setMode(IPresence.Mode.AVAILABLE);
|
||||
presence.setType(IPresence.Type.AVAILABLE);
|
||||
presence.setProperty("DATA_PROVIDER", me.getFQName());
|
||||
presence.setProperty("SESSION_LEADER", me.getFQName());
|
||||
|
||||
|
@ -542,10 +576,11 @@ public class SessionManager implements IEventPublisher {
|
|||
|
||||
@Override
|
||||
public void handleRosterEntryAdd(IRosterEntry entry) {
|
||||
System.out.println("Roster add " + entry.getUser());
|
||||
System.out.println(" groups "
|
||||
+ entry.getGroups());
|
||||
System.out.println(" name " + entry.getName());
|
||||
com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterEntry re = RosterEntry
|
||||
.convertEntry(entry);
|
||||
if (re != null) {
|
||||
getRosterManager().getRoster().addRosterEntry(re);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -554,31 +589,36 @@ public class SessionManager implements IEventPublisher {
|
|||
|
||||
if (changedValue instanceof IRosterEntry) {
|
||||
IRosterEntry re = (IRosterEntry) changedValue;
|
||||
System.out.println("Roster update RosterEntry "
|
||||
+ re.getUser());
|
||||
System.out.println(" groups "
|
||||
+ re.getGroups());
|
||||
System.out.println(" name " + re.getName());
|
||||
System.out.println("Roster update RosterEntry "
|
||||
+ re.getUser());
|
||||
System.out.println(" groups "
|
||||
+ re.getGroups());
|
||||
System.out.println(" name " +
|
||||
re.getName());
|
||||
} else if (changedValue instanceof IRosterGroup) {
|
||||
IRosterGroup rg = (IRosterGroup) changedValue;
|
||||
System.out.println("Roster update RosterGroup "
|
||||
+ rg.getName());
|
||||
System.out.println(" entries "
|
||||
+ rg.getEntries());
|
||||
System.out.println(" name " + rg.getName());
|
||||
|
||||
|
||||
System.out.println("Roster update RosterGroup "
|
||||
+ rg.getName());
|
||||
System.out.println(" entries "
|
||||
+ rg.getEntries());
|
||||
System.out.println(" name " +
|
||||
rg.getName());
|
||||
} else if (changedValue instanceof IRoster) {
|
||||
IRoster r = (IRoster) changedValue;
|
||||
System.out.println("Roster update Roster "
|
||||
+ r.getName());
|
||||
+ r.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleRosterEntryRemove(IRosterEntry entry) {
|
||||
System.out.println("Roster " + entry.getUser());
|
||||
System.out.println(" groups "
|
||||
+ entry.getGroups());
|
||||
System.out.println(" name " + entry.getName());
|
||||
System.out.println("Roster " + entry.getUser());
|
||||
System.out.println(" groups "
|
||||
+ entry.getGroups());
|
||||
System.out.println(" name " +
|
||||
entry.getName());
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue