mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-12-05 12:41:08 +01:00
SMACK-363 Applied code cleanup patches for many generics related issues.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@13325 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
6dc64671e2
commit
e08c8afe44
109 changed files with 577 additions and 605 deletions
|
|
@ -20,6 +20,7 @@
|
|||
package org.jivesoftware.smackx.workgroup.agent;
|
||||
|
||||
import org.jivesoftware.smackx.workgroup.MetaData;
|
||||
import org.jivesoftware.smackx.workgroup.QueueUser;
|
||||
import org.jivesoftware.smackx.workgroup.WorkgroupInvitation;
|
||||
import org.jivesoftware.smackx.workgroup.WorkgroupInvitationListener;
|
||||
import org.jivesoftware.smackx.workgroup.ext.history.AgentChatHistory;
|
||||
|
|
@ -60,7 +61,7 @@ public class AgentSession {
|
|||
private boolean online = false;
|
||||
private Presence.Mode presenceMode;
|
||||
private int maxChats;
|
||||
private final Map<String, String> metaData;
|
||||
private final Map<String, List<String>> metaData;
|
||||
|
||||
private Map<String, WorkgroupQueue> queues;
|
||||
|
||||
|
|
@ -96,7 +97,7 @@ public class AgentSession {
|
|||
|
||||
this.maxChats = -1;
|
||||
|
||||
this.metaData = new HashMap<String, String>();
|
||||
this.metaData = new HashMap<String, List<String>>();
|
||||
|
||||
this.queues = new HashMap<String, WorkgroupQueue>();
|
||||
|
||||
|
|
@ -199,10 +200,10 @@ public class AgentSession {
|
|||
*/
|
||||
public void setMetaData(String key, String val) throws XMPPException {
|
||||
synchronized (this.metaData) {
|
||||
String oldVal = (String)this.metaData.get(key);
|
||||
List<String> oldVals = metaData.get(key);
|
||||
|
||||
if ((oldVal == null) || (!oldVal.equals(val))) {
|
||||
metaData.put(key, val);
|
||||
if ((oldVals == null) || (!oldVals.get(0).equals(val))) {
|
||||
oldVals.set(0, val);
|
||||
|
||||
setStatus(presenceMode, maxChats);
|
||||
}
|
||||
|
|
@ -218,7 +219,7 @@ public class AgentSession {
|
|||
*/
|
||||
public void removeMetaData(String key) throws XMPPException {
|
||||
synchronized (this.metaData) {
|
||||
String oldVal = (String)metaData.remove(key);
|
||||
List<String> oldVal = metaData.remove(key);
|
||||
|
||||
if (oldVal != null) {
|
||||
setStatus(presenceMode, maxChats);
|
||||
|
|
@ -233,8 +234,8 @@ public class AgentSession {
|
|||
* @return the meta data value associated with the key or <tt>null</tt> if the meta-data
|
||||
* doesn't exist..
|
||||
*/
|
||||
public String getMetaData(String key) {
|
||||
return (String)metaData.get(key);
|
||||
public List<String> getMetaData(String key) {
|
||||
return metaData.get(key);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -642,7 +643,7 @@ public class AgentSession {
|
|||
}
|
||||
|
||||
private void fireInvitationEvent(String groupChatJID, String sessionID, String body,
|
||||
String from, Map metaData) {
|
||||
String from, Map<String, List<String>> metaData) {
|
||||
WorkgroupInvitation invitation = new WorkgroupInvitation(connection.getUser(), groupChatJID,
|
||||
workgroupJID, sessionID, body, from, metaData);
|
||||
|
||||
|
|
@ -654,7 +655,7 @@ public class AgentSession {
|
|||
}
|
||||
|
||||
private void fireQueueUsersEvent(WorkgroupQueue queue, WorkgroupQueue.Status status,
|
||||
int averageWaitTime, Date oldestEntry, Set users) {
|
||||
int averageWaitTime, Date oldestEntry, Set<QueueUser> users) {
|
||||
synchronized (queueUsersListeners) {
|
||||
for (QueueUsersListener listener : queueUsersListeners) {
|
||||
if (status != null) {
|
||||
|
|
@ -754,7 +755,7 @@ public class AgentSession {
|
|||
MUCUser.Invite invite = mucUser != null ? mucUser.getInvite() : null;
|
||||
if (invite != null && workgroupJID.equals(invite.getFrom())) {
|
||||
String sessionID = null;
|
||||
Map metaData = null;
|
||||
Map<String, List<String>> metaData = null;
|
||||
|
||||
SessionID sessionIDExt = (SessionID)message.getExtension(SessionID.ELEMENT_NAME,
|
||||
SessionID.NAMESPACE);
|
||||
|
|
@ -980,7 +981,7 @@ public class AgentSession {
|
|||
* @return Map a map of all metadata associated with the sessionID.
|
||||
* @throws XMPPException if an error occurs while getting information from the server.
|
||||
*/
|
||||
public Map getChatMetadata(String sessionID) throws XMPPException {
|
||||
public Map<String, List<String>> getChatMetadata(String sessionID) throws XMPPException {
|
||||
ChatMetadata request = new ChatMetadata();
|
||||
request.setType(IQ.Type.GET);
|
||||
request.setTo(workgroupJID);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue