use of org.jivesoftware.openfire.event.GroupEventListener in project Openfire by igniterealtime.
the class WorkgroupManager method addGroupManagerListener.
/**
* Listens for changes in the Group model to update respective agents.
*/
private void addGroupManagerListener() {
groupEventListener = new GroupEventListener() {
public void groupCreated(Group group, Map params) {
}
public void groupDeleting(Group group, Map params) {
}
public void groupModified(Group group, Map params) {
}
public void memberAdded(Group group, Map params) {
String userJID = (String) params.get("member");
JID jid = new JID(userJID);
if (!agentManager.hasAgent(jid)) {
for (Workgroup workgroup : workgroups.values()) {
for (RequestQueue queue : workgroup.getRequestQueues()) {
if (queue.hasGroup(group)) {
agentManager.getAgents(group);
}
}
}
}
}
public void memberRemoved(Group group, Map params) {
}
public void adminAdded(Group group, Map params) {
}
public void adminRemoved(Group group, Map params) {
}
};
GroupEventDispatcher.addListener(groupEventListener);
}
Aggregations