mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-12-06 05:01:12 +01:00
SMACK-279: The XMPPConnection extends the new abstract Connection class
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@11613 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
11a41e79ca
commit
127319a821
102 changed files with 1420 additions and 1194 deletions
|
|
@ -23,7 +23,7 @@ import org.jivesoftware.smackx.workgroup.packet.AgentInfo;
|
|||
import org.jivesoftware.smackx.workgroup.packet.AgentWorkgroups;
|
||||
import org.jivesoftware.smack.PacketCollector;
|
||||
import org.jivesoftware.smack.SmackConfiguration;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.filter.PacketIDFilter;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
|
|
@ -36,10 +36,10 @@ import java.util.Collection;
|
|||
* @author Derek DeMoro
|
||||
*/
|
||||
public class Agent {
|
||||
private XMPPConnection connection;
|
||||
private Connection connection;
|
||||
private String workgroupJID;
|
||||
|
||||
public static Collection<String> getWorkgroups(String serviceJID, String agentJID, XMPPConnection connection) throws XMPPException {
|
||||
public static Collection<String> getWorkgroups(String serviceJID, String agentJID, Connection connection) throws XMPPException {
|
||||
AgentWorkgroups request = new AgentWorkgroups(agentJID);
|
||||
request.setTo(serviceJID);
|
||||
PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(request.getPacketID()));
|
||||
|
|
@ -62,7 +62,7 @@ public class Agent {
|
|||
/**
|
||||
* Constructs an Agent.
|
||||
*/
|
||||
Agent(XMPPConnection connection, String workgroupJID) {
|
||||
Agent(Connection connection, String workgroupJID) {
|
||||
this.connection = connection;
|
||||
this.workgroupJID = workgroupJID;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ package org.jivesoftware.smackx.workgroup.agent;
|
|||
import org.jivesoftware.smackx.workgroup.packet.AgentStatus;
|
||||
import org.jivesoftware.smackx.workgroup.packet.AgentStatusRequest;
|
||||
import org.jivesoftware.smack.PacketListener;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.filter.PacketFilter;
|
||||
import org.jivesoftware.smack.filter.PacketTypeFilter;
|
||||
import org.jivesoftware.smack.packet.Packet;
|
||||
|
|
@ -50,7 +50,7 @@ public class AgentRoster {
|
|||
private static final int EVENT_AGENT_REMOVED = 1;
|
||||
private static final int EVENT_PRESENCE_CHANGED = 2;
|
||||
|
||||
private XMPPConnection connection;
|
||||
private Connection connection;
|
||||
private String workgroupJID;
|
||||
private List<String> entries;
|
||||
private List<AgentRosterListener> listeners;
|
||||
|
|
@ -64,7 +64,7 @@ public class AgentRoster {
|
|||
*
|
||||
* @param connection an XMPP connection.
|
||||
*/
|
||||
AgentRoster(XMPPConnection connection, String workgroupJID) {
|
||||
AgentRoster(Connection connection, String workgroupJID) {
|
||||
this.connection = connection;
|
||||
this.workgroupJID = workgroupJID;
|
||||
entries = new ArrayList<String>();
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ import java.util.*;
|
|||
*/
|
||||
public class AgentSession {
|
||||
|
||||
private XMPPConnection connection;
|
||||
private Connection connection;
|
||||
|
||||
private String workgroupJID;
|
||||
|
||||
|
|
@ -83,7 +83,7 @@ public class AgentSession {
|
|||
* authentication.
|
||||
* @param workgroupJID the fully qualified JID of the workgroup.
|
||||
*/
|
||||
public AgentSession(String workgroupJID, XMPPConnection connection) {
|
||||
public AgentSession(String workgroupJID, Connection connection) {
|
||||
// Login must have been done before passing in connection.
|
||||
if (!connection.isAuthenticated()) {
|
||||
throw new IllegalStateException("Must login to server before creating workgroup.");
|
||||
|
|
@ -1112,12 +1112,12 @@ public class AgentSession {
|
|||
/**
|
||||
* Returns the generic metadata of the workgroup the agent belongs to.
|
||||
*
|
||||
* @param con the XMPPConnection to use.
|
||||
* @param con the Connection to use.
|
||||
* @param query an optional query object used to tell the server what metadata to retrieve. This can be null.
|
||||
* @throws XMPPException if an error occurs while sending the request to the server.
|
||||
* @return the settings for the workgroup.
|
||||
*/
|
||||
public GenericSettings getGenericSettings(XMPPConnection con, String query) throws XMPPException {
|
||||
public GenericSettings getGenericSettings(Connection con, String query) throws XMPPException {
|
||||
GenericSettings setting = new GenericSettings();
|
||||
setting.setType(IQ.Type.GET);
|
||||
setting.setTo(workgroupJID);
|
||||
|
|
@ -1138,7 +1138,7 @@ public class AgentSession {
|
|||
return response;
|
||||
}
|
||||
|
||||
public boolean hasMonitorPrivileges(XMPPConnection con) throws XMPPException {
|
||||
public boolean hasMonitorPrivileges(Connection con) throws XMPPException {
|
||||
MonitorPacket request = new MonitorPacket();
|
||||
request.setType(IQ.Type.GET);
|
||||
request.setTo(workgroupJID);
|
||||
|
|
@ -1160,7 +1160,7 @@ public class AgentSession {
|
|||
|
||||
}
|
||||
|
||||
public void makeRoomOwner(XMPPConnection con, String sessionID) throws XMPPException {
|
||||
public void makeRoomOwner(Connection con, String sessionID) throws XMPPException {
|
||||
MonitorPacket request = new MonitorPacket();
|
||||
request.setType(IQ.Type.SET);
|
||||
request.setTo(workgroupJID);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
package org.jivesoftware.smackx.workgroup.agent;
|
||||
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.packet.Packet;
|
||||
|
||||
|
|
@ -36,7 +36,7 @@ import java.util.Map;
|
|||
*/
|
||||
public class Offer {
|
||||
|
||||
private XMPPConnection connection;
|
||||
private Connection connection;
|
||||
private AgentSession session;
|
||||
|
||||
private String sessionID;
|
||||
|
|
@ -64,7 +64,7 @@ public class Offer {
|
|||
* @param content content of the offer. The content explains the reason for the offer
|
||||
* (e.g. user request, transfer)
|
||||
*/
|
||||
Offer(XMPPConnection conn, AgentSession agentSession, String userID,
|
||||
Offer(Connection conn, AgentSession agentSession, String userID,
|
||||
String userJID, String workgroupName, Date expiresDate,
|
||||
String sessionID, Map metaData, OfferContent content)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
package org.jivesoftware.smackx.workgroup.agent;
|
||||
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.provider.IQProvider;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
|
|
@ -46,7 +46,7 @@ public class OfferConfirmation extends IQ {
|
|||
}
|
||||
|
||||
|
||||
public void notifyService(XMPPConnection con, String workgroup, String createdRoomName) {
|
||||
public void notifyService(Connection con, String workgroup, String createdRoomName) {
|
||||
NotifyServicePacket packet = new NotifyServicePacket(workgroup, createdRoomName);
|
||||
con.sendPacket(packet);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import org.jivesoftware.smackx.workgroup.packet.Transcript;
|
|||
import org.jivesoftware.smackx.workgroup.packet.Transcripts;
|
||||
import org.jivesoftware.smack.PacketCollector;
|
||||
import org.jivesoftware.smack.SmackConfiguration;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.filter.PacketIDFilter;
|
||||
|
||||
|
|
@ -35,9 +35,9 @@ import org.jivesoftware.smack.filter.PacketIDFilter;
|
|||
* @author Gaston Dombiak
|
||||
*/
|
||||
public class TranscriptManager {
|
||||
private XMPPConnection connection;
|
||||
private Connection connection;
|
||||
|
||||
public TranscriptManager(XMPPConnection connection) {
|
||||
public TranscriptManager(Connection connection) {
|
||||
this.connection = connection;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ package org.jivesoftware.smackx.workgroup.agent;
|
|||
import org.jivesoftware.smackx.workgroup.packet.TranscriptSearch;
|
||||
import org.jivesoftware.smack.PacketCollector;
|
||||
import org.jivesoftware.smack.SmackConfiguration;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.filter.PacketIDFilter;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
|
|
@ -37,9 +37,9 @@ import org.jivesoftware.smackx.ReportedData;
|
|||
* @author Gaston Dombiak
|
||||
*/
|
||||
public class TranscriptSearchManager {
|
||||
private XMPPConnection connection;
|
||||
private Connection connection;
|
||||
|
||||
public TranscriptSearchManager(XMPPConnection connection) {
|
||||
public TranscriptSearchManager(Connection connection) {
|
||||
this.connection = connection;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue