mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 09:09:38 +02:00
Expose InterruptedException
SMACK-632
This commit is contained in:
parent
43b99a2a85
commit
bc61527bd2
124 changed files with 977 additions and 597 deletions
|
@ -36,7 +36,7 @@ public class Agent {
|
|||
private XMPPConnection connection;
|
||||
private String workgroupJID;
|
||||
|
||||
public static Collection<String> getWorkgroups(String serviceJID, String agentJID, XMPPConnection connection) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public static Collection<String> getWorkgroups(String serviceJID, String agentJID, XMPPConnection connection) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
AgentWorkgroups request = new AgentWorkgroups(agentJID);
|
||||
request.setTo(serviceJID);
|
||||
AgentWorkgroups response = (AgentWorkgroups) connection.createPacketCollectorAndSend(request).nextResultOrThrow();
|
||||
|
@ -67,8 +67,9 @@ public class Agent {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public String getName() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public String getName() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
AgentInfo agentInfo = new AgentInfo();
|
||||
agentInfo.setType(IQ.Type.get);
|
||||
agentInfo.setTo(workgroupJID);
|
||||
|
@ -87,8 +88,9 @@ public class Agent {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void setName(String newName) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public void setName(String newName) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
AgentInfo agentInfo = new AgentInfo();
|
||||
agentInfo.setType(IQ.Type.set);
|
||||
agentInfo.setTo(workgroupJID);
|
||||
|
|
|
@ -65,8 +65,9 @@ public class AgentRoster {
|
|||
*
|
||||
* @param connection an XMPP connection.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
AgentRoster(XMPPConnection connection, String workgroupJID) throws NotConnectedException {
|
||||
AgentRoster(XMPPConnection connection, String workgroupJID) throws NotConnectedException, InterruptedException {
|
||||
this.connection = connection;
|
||||
this.workgroupJID = workgroupJID;
|
||||
entries = new ArrayList<String>();
|
||||
|
@ -90,8 +91,9 @@ public class AgentRoster {
|
|||
* which means the method will return immediately, and the roster will be
|
||||
* reloaded at a later point when the server responds to the reload request.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void reload() throws NotConnectedException {
|
||||
public void reload() throws NotConnectedException, InterruptedException {
|
||||
AgentStatusRequest request = new AgentStatusRequest();
|
||||
request.setTo(workgroupJID);
|
||||
connection.sendPacket(request);
|
||||
|
|
|
@ -175,8 +175,9 @@ public class AgentSession {
|
|||
*
|
||||
* @return the AgentRoster
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public AgentRoster getAgentRoster() throws NotConnectedException {
|
||||
public AgentRoster getAgentRoster() throws NotConnectedException, InterruptedException {
|
||||
if (agentRoster == null) {
|
||||
agentRoster = new AgentRoster(connection, workgroupJID);
|
||||
}
|
||||
|
@ -234,8 +235,9 @@ public class AgentSession {
|
|||
* @param val the non-null meta data value
|
||||
* @throws XMPPException if an exception occurs.
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void setMetaData(String key, String val) throws XMPPException, SmackException {
|
||||
public void setMetaData(String key, String val) throws XMPPException, SmackException, InterruptedException {
|
||||
synchronized (this.metaData) {
|
||||
List<String> oldVals = metaData.get(key);
|
||||
|
||||
|
@ -254,8 +256,9 @@ public class AgentSession {
|
|||
* @param key the meta data key.
|
||||
* @throws XMPPException if an exception occurs.
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void removeMetaData(String key) throws XMPPException, SmackException {
|
||||
public void removeMetaData(String key) throws XMPPException, SmackException, InterruptedException {
|
||||
synchronized (this.metaData) {
|
||||
List<String> oldVal = metaData.remove(key);
|
||||
|
||||
|
@ -285,8 +288,9 @@ public class AgentSession {
|
|||
* @throws XMPPException if an error occurs setting the online status.
|
||||
* @throws SmackException assertEquals(SmackException.Type.NO_RESPONSE_FROM_SERVER, e.getType());
|
||||
return;
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void setOnline(boolean online) throws XMPPException, SmackException {
|
||||
public void setOnline(boolean online) throws XMPPException, SmackException, InterruptedException {
|
||||
// If the online status hasn't changed, do nothing.
|
||||
if (this.online == online) {
|
||||
return;
|
||||
|
@ -344,9 +348,10 @@ public class AgentSession {
|
|||
* @param maxChats the maximum number of chats the agent is willing to accept.
|
||||
* @throws XMPPException if an error occurs setting the agent status.
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
* @throws IllegalStateException if the agent is not online with the workgroup.
|
||||
*/
|
||||
public void setStatus(Presence.Mode presenceMode, int maxChats) throws XMPPException, SmackException {
|
||||
public void setStatus(Presence.Mode presenceMode, int maxChats) throws XMPPException, SmackException, InterruptedException {
|
||||
setStatus(presenceMode, maxChats, null);
|
||||
}
|
||||
|
||||
|
@ -372,10 +377,11 @@ public class AgentSession {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws IllegalStateException if the agent is not online with the workgroup.
|
||||
*/
|
||||
public void setStatus(Presence.Mode presenceMode, int maxChats, String status)
|
||||
throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
if (!online) {
|
||||
throw new IllegalStateException("Cannot set status when the agent is not online.");
|
||||
}
|
||||
|
@ -423,9 +429,10 @@ public class AgentSession {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws IllegalStateException if the agent is not online with the workgroup.
|
||||
*/
|
||||
public void setStatus(Presence.Mode presenceMode, String status) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public void setStatus(Presence.Mode presenceMode, String status) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
if (!online) {
|
||||
throw new IllegalStateException("Cannot set status when the agent is not online.");
|
||||
}
|
||||
|
@ -459,8 +466,9 @@ public class AgentSession {
|
|||
* @param userID the ID of the user to remove.
|
||||
* @throws XMPPException if an exception occurs.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void dequeueUser(String userID) throws XMPPException, NotConnectedException {
|
||||
public void dequeueUser(String userID) throws XMPPException, NotConnectedException, InterruptedException {
|
||||
// todo: this method simply won't work right now.
|
||||
DepartQueuePacket departPacket = new DepartQueuePacket(this.workgroupJID);
|
||||
|
||||
|
@ -476,8 +484,9 @@ public class AgentSession {
|
|||
* @return the transcripts of a given user.
|
||||
* @throws XMPPException if an error occurs while getting the information.
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public Transcripts getTranscripts(String userID) throws XMPPException, SmackException {
|
||||
public Transcripts getTranscripts(String userID) throws XMPPException, SmackException, InterruptedException {
|
||||
return transcriptManager.getTranscripts(workgroupJID, userID);
|
||||
}
|
||||
|
||||
|
@ -488,8 +497,9 @@ public class AgentSession {
|
|||
* @return the full conversation transcript of a given session.
|
||||
* @throws XMPPException if an error occurs while getting the information.
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public Transcript getTranscript(String sessionID) throws XMPPException, SmackException {
|
||||
public Transcript getTranscript(String sessionID) throws XMPPException, SmackException, InterruptedException {
|
||||
return transcriptManager.getTranscript(workgroupJID, sessionID);
|
||||
}
|
||||
|
||||
|
@ -501,8 +511,9 @@ public class AgentSession {
|
|||
* @return the Form to use for searching transcripts.
|
||||
* @throws XMPPException if an error occurs while sending the request to the server.
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public Form getTranscriptSearchForm() throws XMPPException, SmackException {
|
||||
public Form getTranscriptSearchForm() throws XMPPException, SmackException, InterruptedException {
|
||||
return transcriptSearchManager.getSearchForm(XmppStringUtils.parseDomain(workgroupJID));
|
||||
}
|
||||
|
||||
|
@ -515,8 +526,9 @@ public class AgentSession {
|
|||
* @return the result of the transcript search.
|
||||
* @throws SmackException
|
||||
* @throws XMPPException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public ReportedData searchTranscripts(Form completedForm) throws XMPPException, SmackException {
|
||||
public ReportedData searchTranscripts(Form completedForm) throws XMPPException, SmackException, InterruptedException {
|
||||
return transcriptSearchManager.submitSearch(XmppStringUtils.parseDomain(workgroupJID),
|
||||
completedForm);
|
||||
}
|
||||
|
@ -531,8 +543,9 @@ public class AgentSession {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public OccupantsInfo getOccupantsInfo(String roomID) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public OccupantsInfo getOccupantsInfo(String roomID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
OccupantsInfo request = new OccupantsInfo(roomID);
|
||||
request.setType(IQ.Type.get);
|
||||
request.setTo(workgroupJID);
|
||||
|
@ -689,7 +702,7 @@ public class AgentSession {
|
|||
|
||||
// PacketListener Implementation.
|
||||
|
||||
private void handlePacket(Stanza packet) throws NotConnectedException {
|
||||
private void handlePacket(Stanza packet) throws NotConnectedException, InterruptedException {
|
||||
if (packet instanceof OfferRequestProvider.OfferRequestPacket) {
|
||||
// Acknowledge the IQ set.
|
||||
IQ reply = IQ.createResultIQ((IQ) packet);
|
||||
|
@ -796,8 +809,9 @@ public class AgentSession {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void setNote(String sessionID, String note) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public void setNote(String sessionID, String note) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
ChatNotes notes = new ChatNotes();
|
||||
notes.setType(IQ.Type.set);
|
||||
notes.setTo(workgroupJID);
|
||||
|
@ -814,8 +828,9 @@ public class AgentSession {
|
|||
* @throws XMPPErrorException if an error occurs while retrieving the ChatNote.
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public ChatNotes getNote(String sessionID) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public ChatNotes getNote(String sessionID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
ChatNotes request = new ChatNotes();
|
||||
request.setType(IQ.Type.get);
|
||||
request.setTo(workgroupJID);
|
||||
|
@ -833,8 +848,9 @@ public class AgentSession {
|
|||
* @return the chat history associated with a given jid.
|
||||
* @throws XMPPException if an error occurs while retrieving the AgentChatHistory.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public AgentChatHistory getAgentHistory(String jid, int maxSessions, Date startDate) throws XMPPException, NotConnectedException {
|
||||
public AgentChatHistory getAgentHistory(String jid, int maxSessions, Date startDate) throws XMPPException, NotConnectedException, InterruptedException {
|
||||
AgentChatHistory request;
|
||||
if (startDate != null) {
|
||||
request = new AgentChatHistory(jid, maxSessions, startDate);
|
||||
|
@ -859,8 +875,9 @@ public class AgentSession {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public SearchSettings getSearchSettings() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public SearchSettings getSearchSettings() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
SearchSettings request = new SearchSettings();
|
||||
request.setType(IQ.Type.get);
|
||||
request.setTo(workgroupJID);
|
||||
|
@ -877,8 +894,9 @@ public class AgentSession {
|
|||
* @throws XMPPErrorException if an error occurs while getting information from the server.
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public MacroGroup getMacros(boolean global) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public MacroGroup getMacros(boolean global) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
Macros request = new Macros();
|
||||
request.setType(IQ.Type.get);
|
||||
request.setTo(workgroupJID);
|
||||
|
@ -895,8 +913,9 @@ public class AgentSession {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void saveMacros(MacroGroup group) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public void saveMacros(MacroGroup group) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
Macros request = new Macros();
|
||||
request.setType(IQ.Type.set);
|
||||
request.setTo(workgroupJID);
|
||||
|
@ -913,8 +932,9 @@ 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.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public Map<String, List<String>> getChatMetadata(String sessionID) throws XMPPException, NotConnectedException {
|
||||
public Map<String, List<String>> getChatMetadata(String sessionID) throws XMPPException, NotConnectedException, InterruptedException {
|
||||
ChatMetadata request = new ChatMetadata();
|
||||
request.setType(IQ.Type.get);
|
||||
request.setTo(workgroupJID);
|
||||
|
@ -952,8 +972,9 @@ public class AgentSession {
|
|||
* the request.
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void sendRoomInvitation(RoomInvitation.Type type, String invitee, String sessionID, String reason) throws NoResponseException, XMPPErrorException, NotConnectedException
|
||||
public void sendRoomInvitation(RoomInvitation.Type type, String invitee, String sessionID, String reason) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException
|
||||
{
|
||||
final RoomInvitation invitation = new RoomInvitation(type, invitee, sessionID, reason);
|
||||
IQ iq = new RoomInvitation.RoomInvitationIQ(invitation);
|
||||
|
@ -989,8 +1010,9 @@ public class AgentSession {
|
|||
* the request.
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void sendRoomTransfer(RoomTransfer.Type type, String invitee, String sessionID, String reason) throws NoResponseException, XMPPErrorException, NotConnectedException
|
||||
public void sendRoomTransfer(RoomTransfer.Type type, String invitee, String sessionID, String reason) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException
|
||||
{
|
||||
final RoomTransfer transfer = new RoomTransfer(type, invitee, sessionID, reason);
|
||||
IQ iq = new RoomTransfer.RoomTransferIQ(transfer);
|
||||
|
@ -1010,8 +1032,9 @@ public class AgentSession {
|
|||
* @throws XMPPErrorException if an error occurs while sending the request to the server.
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public GenericSettings getGenericSettings(XMPPConnection con, String query) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public GenericSettings getGenericSettings(XMPPConnection con, String query) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
GenericSettings setting = new GenericSettings();
|
||||
setting.setType(IQ.Type.get);
|
||||
setting.setTo(workgroupJID);
|
||||
|
@ -1021,7 +1044,7 @@ public class AgentSession {
|
|||
return response;
|
||||
}
|
||||
|
||||
public boolean hasMonitorPrivileges(XMPPConnection con) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public boolean hasMonitorPrivileges(XMPPConnection con) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
MonitorPacket request = new MonitorPacket();
|
||||
request.setType(IQ.Type.get);
|
||||
request.setTo(workgroupJID);
|
||||
|
@ -1030,7 +1053,7 @@ public class AgentSession {
|
|||
return response.isMonitor();
|
||||
}
|
||||
|
||||
public void makeRoomOwner(XMPPConnection con, String sessionID) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public void makeRoomOwner(XMPPConnection con, String sessionID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
MonitorPacket request = new MonitorPacket();
|
||||
request.setType(IQ.Type.set);
|
||||
request.setTo(workgroupJID);
|
||||
|
|
|
@ -81,8 +81,9 @@ public class Offer {
|
|||
/**
|
||||
* Accepts the offer.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void accept() throws NotConnectedException {
|
||||
public void accept() throws NotConnectedException, InterruptedException {
|
||||
Stanza acceptPacket = new AcceptPacket(this.session.getWorkgroupJID());
|
||||
connection.sendPacket(acceptPacket);
|
||||
// TODO: listen for a reply.
|
||||
|
@ -92,8 +93,9 @@ public class Offer {
|
|||
/**
|
||||
* Rejects the offer.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void reject() throws NotConnectedException {
|
||||
public void reject() throws NotConnectedException, InterruptedException {
|
||||
RejectPacket rejectPacket = new RejectPacket(this.session.getWorkgroupJID());
|
||||
connection.sendPacket(rejectPacket);
|
||||
// TODO: listen for a reply.
|
||||
|
|
|
@ -53,7 +53,7 @@ public class OfferConfirmation extends SimpleIQ {
|
|||
}
|
||||
|
||||
|
||||
public void notifyService(XMPPConnection con, String workgroup, String createdRoomName) throws NotConnectedException {
|
||||
public void notifyService(XMPPConnection con, String workgroup, String createdRoomName) throws NotConnectedException, InterruptedException {
|
||||
NotifyServicePacket packet = new NotifyServicePacket(workgroup, createdRoomName);
|
||||
con.sendPacket(packet);
|
||||
}
|
||||
|
|
|
@ -47,8 +47,9 @@ public class TranscriptManager {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public Transcript getTranscript(String workgroupJID, String sessionID) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public Transcript getTranscript(String workgroupJID, String sessionID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
Transcript request = new Transcript(sessionID);
|
||||
request.setTo(workgroupJID);
|
||||
Transcript response = (Transcript) connection.createPacketCollectorAndSend(request).nextResultOrThrow();
|
||||
|
@ -65,8 +66,9 @@ public class TranscriptManager {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public Transcripts getTranscripts(String workgroupJID, String userID) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public Transcripts getTranscripts(String workgroupJID, String userID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
Transcripts request = new Transcripts(userID);
|
||||
request.setTo(workgroupJID);
|
||||
Transcripts response = (Transcripts) connection.createPacketCollectorAndSend(request).nextResultOrThrow();
|
||||
|
|
|
@ -50,8 +50,9 @@ public class TranscriptSearchManager {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public Form getSearchForm(String serviceJID) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public Form getSearchForm(String serviceJID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
TranscriptSearch search = new TranscriptSearch();
|
||||
search.setType(IQ.Type.get);
|
||||
search.setTo(serviceJID);
|
||||
|
@ -72,8 +73,9 @@ public class TranscriptSearchManager {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public ReportedData submitSearch(String serviceJID, Form completedForm) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public ReportedData submitSearch(String serviceJID, Form completedForm) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
TranscriptSearch search = new TranscriptSearch();
|
||||
search.setType(IQ.Type.get);
|
||||
search.setTo(serviceJID);
|
||||
|
|
|
@ -175,8 +175,9 @@ public class Workgroup {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public boolean isAvailable() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public boolean isAvailable() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
Presence directedPresence = new Presence(Presence.Type.available);
|
||||
directedPresence.setTo(workgroupJID);
|
||||
PacketFilter typeFilter = new PacketTypeFilter(Presence.class);
|
||||
|
@ -250,8 +251,9 @@ public class Workgroup {
|
|||
* that a connection failure occured or that the server explicitly rejected the
|
||||
* request to join the queue.
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void joinQueue() throws XMPPException, SmackException {
|
||||
public void joinQueue() throws XMPPException, SmackException, InterruptedException {
|
||||
joinQueue(null);
|
||||
}
|
||||
|
||||
|
@ -288,8 +290,9 @@ public class Workgroup {
|
|||
* that a connection failure occured or that the server explicitly rejected the
|
||||
* request to join the queue.
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void joinQueue(Form answerForm) throws XMPPException, SmackException {
|
||||
public void joinQueue(Form answerForm) throws XMPPException, SmackException, InterruptedException {
|
||||
joinQueue(answerForm, null);
|
||||
}
|
||||
|
||||
|
@ -327,8 +330,9 @@ public class Workgroup {
|
|||
* request to join the queue.
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void joinQueue(Form answerForm, String userID) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public void joinQueue(Form answerForm, String userID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
// If already in the queue ignore the join request.
|
||||
if (inQueue) {
|
||||
throw new IllegalStateException("Already in queue " + workgroupJID);
|
||||
|
@ -374,8 +378,9 @@ public class Workgroup {
|
|||
* that a connection failure occured or that the server explicitly rejected the
|
||||
* request to join the queue.
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void joinQueue(Map<String,Object> metadata, String userID) throws XMPPException, SmackException {
|
||||
public void joinQueue(Map<String,Object> metadata, String userID) throws XMPPException, SmackException, InterruptedException {
|
||||
// If already in the queue ignore the join request.
|
||||
if (inQueue) {
|
||||
throw new IllegalStateException("Already in queue " + workgroupJID);
|
||||
|
@ -408,8 +413,9 @@ public class Workgroup {
|
|||
* request to the server.
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void departQueue() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public void departQueue() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
// If not in the queue ignore the depart request.
|
||||
if (!inQueue) {
|
||||
return;
|
||||
|
@ -584,8 +590,9 @@ public class Workgroup {
|
|||
* @return the ChatSetting if found, otherwise false.
|
||||
* @throws XMPPException if an error occurs while getting information from the server.
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public ChatSetting getChatSetting(String key) throws XMPPException, SmackException {
|
||||
public ChatSetting getChatSetting(String key) throws XMPPException, SmackException, InterruptedException {
|
||||
ChatSettings chatSettings = getChatSettings(key, -1);
|
||||
return chatSettings.getFirstEntry();
|
||||
}
|
||||
|
@ -597,8 +604,9 @@ public class Workgroup {
|
|||
* @return the ChatSettings of given type, otherwise null.
|
||||
* @throws XMPPException if an error occurs while getting information from the server.
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public ChatSettings getChatSettings(int type) throws XMPPException, SmackException {
|
||||
public ChatSettings getChatSettings(int type) throws XMPPException, SmackException, InterruptedException {
|
||||
return getChatSettings(null, type);
|
||||
}
|
||||
|
||||
|
@ -608,8 +616,9 @@ public class Workgroup {
|
|||
* @return all ChatSettings of a given workgroup.
|
||||
* @throws XMPPException if an error occurs while getting information from the server.
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public ChatSettings getChatSettings() throws XMPPException, SmackException {
|
||||
public ChatSettings getChatSettings() throws XMPPException, SmackException, InterruptedException {
|
||||
return getChatSettings(null, -1);
|
||||
}
|
||||
|
||||
|
@ -621,8 +630,9 @@ public class Workgroup {
|
|||
* @throws NoResponseException
|
||||
* @throws XMPPErrorException if an error occurs while getting information from the server.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
private ChatSettings getChatSettings(String key, int type) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
private ChatSettings getChatSettings(String key, int type) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
ChatSettings request = new ChatSettings();
|
||||
if (key != null) {
|
||||
request.setKey(key);
|
||||
|
@ -644,8 +654,9 @@ public class Workgroup {
|
|||
*
|
||||
* @return true if the email service is available, otherwise return false.
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public boolean isEmailAvailable() throws SmackException {
|
||||
public boolean isEmailAvailable() throws SmackException, InterruptedException {
|
||||
ServiceDiscoveryManager discoManager = ServiceDiscoveryManager.getInstanceFor(connection);
|
||||
|
||||
try {
|
||||
|
@ -665,8 +676,9 @@ public class Workgroup {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public OfflineSettings getOfflineSettings() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public OfflineSettings getOfflineSettings() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
OfflineSettings request = new OfflineSettings();
|
||||
request.setType(IQ.Type.get);
|
||||
request.setTo(workgroupJID);
|
||||
|
@ -683,8 +695,9 @@ public class Workgroup {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public SoundSettings getSoundSettings() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public SoundSettings getSoundSettings() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
SoundSettings request = new SoundSettings();
|
||||
request.setType(IQ.Type.get);
|
||||
request.setTo(workgroupJID);
|
||||
|
@ -700,8 +713,9 @@ public class Workgroup {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public WorkgroupProperties getWorkgroupProperties() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public WorkgroupProperties getWorkgroupProperties() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
WorkgroupProperties request = new WorkgroupProperties();
|
||||
request.setType(IQ.Type.get);
|
||||
request.setTo(workgroupJID);
|
||||
|
@ -719,8 +733,9 @@ public class Workgroup {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public WorkgroupProperties getWorkgroupProperties(String jid) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public WorkgroupProperties getWorkgroupProperties(String jid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
WorkgroupProperties request = new WorkgroupProperties();
|
||||
request.setJid(jid);
|
||||
request.setType(IQ.Type.get);
|
||||
|
@ -741,8 +756,9 @@ public class Workgroup {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public Form getWorkgroupForm() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public Form getWorkgroupForm() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
WorkgroupForm workgroupForm = new WorkgroupForm();
|
||||
workgroupForm.setType(IQ.Type.get);
|
||||
workgroupForm.setTo(workgroupJID);
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.jivesoftware.smack.SmackException.NotConnectedException;
|
|||
public class DefaultMessageEventRequestListener implements MessageEventRequestListener {
|
||||
|
||||
public void deliveredNotificationRequested(String from, String packetID,
|
||||
MessageEventManager messageEventManager) throws NotConnectedException
|
||||
MessageEventManager messageEventManager) throws NotConnectedException, InterruptedException
|
||||
{
|
||||
// Send to the message's sender that the message has been delivered
|
||||
messageEventManager.sendDeliveredNotification(from, packetID);
|
||||
|
|
|
@ -208,8 +208,9 @@ public class MessageEventManager extends Manager {
|
|||
* @param to the recipient of the notification.
|
||||
* @param packetID the id of the message to send.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void sendDeliveredNotification(String to, String packetID) throws NotConnectedException {
|
||||
public void sendDeliveredNotification(String to, String packetID) throws NotConnectedException, InterruptedException {
|
||||
// Create the message to send
|
||||
Message msg = new Message(to);
|
||||
// Create a MessageEvent Package and add it to the message
|
||||
|
@ -227,8 +228,9 @@ public class MessageEventManager extends Manager {
|
|||
* @param to the recipient of the notification.
|
||||
* @param packetID the id of the message to send.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void sendDisplayedNotification(String to, String packetID) throws NotConnectedException {
|
||||
public void sendDisplayedNotification(String to, String packetID) throws NotConnectedException, InterruptedException {
|
||||
// Create the message to send
|
||||
Message msg = new Message(to);
|
||||
// Create a MessageEvent Package and add it to the message
|
||||
|
@ -246,8 +248,9 @@ public class MessageEventManager extends Manager {
|
|||
* @param to the recipient of the notification.
|
||||
* @param packetID the id of the message to send.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void sendComposingNotification(String to, String packetID) throws NotConnectedException {
|
||||
public void sendComposingNotification(String to, String packetID) throws NotConnectedException, InterruptedException {
|
||||
// Create the message to send
|
||||
Message msg = new Message(to);
|
||||
// Create a MessageEvent Package and add it to the message
|
||||
|
@ -265,8 +268,9 @@ public class MessageEventManager extends Manager {
|
|||
* @param to the recipient of the notification.
|
||||
* @param packetID the id of the message to send.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void sendCancelledNotification(String to, String packetID) throws NotConnectedException {
|
||||
public void sendCancelledNotification(String to, String packetID) throws NotConnectedException, InterruptedException {
|
||||
// Create the message to send
|
||||
Message msg = new Message(to);
|
||||
// Create a MessageEvent Package and add it to the message
|
||||
|
|
|
@ -48,9 +48,10 @@ public interface MessageEventRequestListener {
|
|||
* @param packetID the id of the message that was sent.
|
||||
* @param messageEventManager the messageEventManager that fired the listener.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void deliveredNotificationRequested(String from, String packetID,
|
||||
MessageEventManager messageEventManager) throws NotConnectedException;
|
||||
MessageEventManager messageEventManager) throws NotConnectedException, InterruptedException;
|
||||
|
||||
/**
|
||||
* Called when a request for message displayed notification is received.
|
||||
|
|
|
@ -115,8 +115,9 @@ public class RosterExchangeManager {
|
|||
* @param roster the roster to send
|
||||
* @param targetUserID the user that will receive the roster entries
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void send(Roster roster, String targetUserID) throws NotConnectedException {
|
||||
public void send(Roster roster, String targetUserID) throws NotConnectedException, InterruptedException {
|
||||
// Create a new message to send the roster
|
||||
Message msg = new Message(targetUserID);
|
||||
// Create a RosterExchange Package and add it to the message
|
||||
|
@ -134,8 +135,9 @@ public class RosterExchangeManager {
|
|||
* @param rosterEntry the roster entry to send
|
||||
* @param targetUserID the user that will receive the roster entries
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void send(RosterEntry rosterEntry, String targetUserID) throws NotConnectedException {
|
||||
public void send(RosterEntry rosterEntry, String targetUserID) throws NotConnectedException, InterruptedException {
|
||||
// Create a new message to send the roster
|
||||
Message msg = new Message(targetUserID);
|
||||
// Create a RosterExchange Package and add it to the message
|
||||
|
@ -155,8 +157,9 @@ public class RosterExchangeManager {
|
|||
* @param rosterGroup the roster group to send
|
||||
* @param targetUserID the user that will receive the roster entries
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void send(RosterGroup rosterGroup, String targetUserID) throws NotConnectedException {
|
||||
public void send(RosterGroup rosterGroup, String targetUserID) throws NotConnectedException, InterruptedException {
|
||||
// Create a new message to send the roster
|
||||
Message msg = new Message(targetUserID);
|
||||
// Create a RosterExchange Package and add it to the message
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue