mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-12-14 06:51:08 +01:00
Expose InterruptedException
SMACK-632
This commit is contained in:
parent
43b99a2a85
commit
bc61527bd2
124 changed files with 977 additions and 597 deletions
|
|
@ -211,8 +211,9 @@ public abstract class AdHocCommand {
|
|||
*
|
||||
* @throws XMPPErrorException if there is an error executing the command.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public abstract void execute() throws NoResponseException, XMPPErrorException, NotConnectedException;
|
||||
public abstract void execute() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException;
|
||||
|
||||
/**
|
||||
* Executes the next action of the command with the information provided in
|
||||
|
|
@ -224,8 +225,9 @@ public abstract class AdHocCommand {
|
|||
* @param response the form answer of the previous stage.
|
||||
* @throws XMPPErrorException if there is a problem executing the command.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public abstract void next(Form response) throws NoResponseException, XMPPErrorException, NotConnectedException;
|
||||
public abstract void next(Form response) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException;
|
||||
|
||||
/**
|
||||
* Completes the command execution with the information provided in the
|
||||
|
|
@ -237,8 +239,9 @@ public abstract class AdHocCommand {
|
|||
* @param response the form answer of the previous stage.
|
||||
* @throws XMPPErrorException if there is a problem executing the command.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public abstract void complete(Form response) throws NoResponseException, XMPPErrorException, NotConnectedException;
|
||||
public abstract void complete(Form response) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException;
|
||||
|
||||
/**
|
||||
* Goes to the previous stage. The requester is asking to re-send the
|
||||
|
|
@ -248,8 +251,9 @@ public abstract class AdHocCommand {
|
|||
*
|
||||
* @throws XMPPErrorException if there is a problem executing the command.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public abstract void prev() throws NoResponseException, XMPPErrorException, NotConnectedException;
|
||||
public abstract void prev() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException;
|
||||
|
||||
/**
|
||||
* Cancels the execution of the command. This can be invoked on any stage of
|
||||
|
|
@ -258,8 +262,9 @@ public abstract class AdHocCommand {
|
|||
*
|
||||
* @throws XMPPErrorException if there is a problem executing the command.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public abstract void cancel() throws NoResponseException, XMPPErrorException, NotConnectedException;
|
||||
public abstract void cancel() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException;
|
||||
|
||||
/**
|
||||
* Returns a collection with the allowed actions based on the current stage.
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ public class AdHocCommandManager extends Manager {
|
|||
try {
|
||||
return processAdHocCommand(requestData);
|
||||
}
|
||||
catch (NoResponseException | NotConnectedException e) {
|
||||
catch (InterruptedException | NoResponseException | NotConnectedException e) {
|
||||
LOGGER.log(Level.INFO, "processAdHocCommand threw exceptino", e);
|
||||
return null;
|
||||
}
|
||||
|
|
@ -252,8 +252,9 @@ public class AdHocCommandManager extends Manager {
|
|||
* @return the discovered items.
|
||||
* @throws XMPPException if the operation failed for some reason.
|
||||
* @throws SmackException if there was no response from the server.
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public DiscoverItems discoverCommands(String jid) throws XMPPException, SmackException {
|
||||
public DiscoverItems discoverCommands(String jid) throws XMPPException, SmackException, InterruptedException {
|
||||
return serviceDiscoveryManager.discoverItems(jid, NAMESPACE);
|
||||
}
|
||||
|
||||
|
|
@ -263,8 +264,9 @@ public class AdHocCommandManager extends Manager {
|
|||
* @param jid the full JID to publish the commands to.
|
||||
* @throws XMPPException if the operation failed for some reason.
|
||||
* @throws SmackException if there was no response from the server.
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void publishCommands(String jid) throws XMPPException, SmackException {
|
||||
public void publishCommands(String jid) throws XMPPException, SmackException, InterruptedException {
|
||||
// Collects the commands to publish as items
|
||||
DiscoverItems discoverItems = new DiscoverItems();
|
||||
Collection<AdHocCommandInfo> xCommandsList = getRegisteredCommands();
|
||||
|
|
@ -318,8 +320,9 @@ public class AdHocCommandManager extends Manager {
|
|||
* the packet to process.
|
||||
* @throws NotConnectedException
|
||||
* @throws NoResponseException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
private IQ processAdHocCommand(AdHocCommandData requestData) throws NoResponseException, NotConnectedException {
|
||||
private IQ processAdHocCommand(AdHocCommandData requestData) throws NoResponseException, NotConnectedException, InterruptedException {
|
||||
// Creates the response with the corresponding data
|
||||
AdHocCommandData response = new AdHocCommandData();
|
||||
response.setTo(requestData.getFrom());
|
||||
|
|
|
|||
|
|
@ -72,17 +72,17 @@ public class RemoteCommand extends AdHocCommand {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void cancel() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public void cancel() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
executeAction(Action.cancel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void complete(Form form) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public void complete(Form form) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
executeAction(Action.complete, form);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public void execute() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
executeAction(Action.execute);
|
||||
}
|
||||
|
||||
|
|
@ -95,22 +95,23 @@ public class RemoteCommand extends AdHocCommand {
|
|||
* @throws XMPPErrorException if an error occurs.
|
||||
* @throws NoResponseException if there was no response from the server.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void execute(Form form) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public void execute(Form form) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
executeAction(Action.execute, form);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void next(Form form) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public void next(Form form) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
executeAction(Action.next, form);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void prev() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public void prev() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
executeAction(Action.prev);
|
||||
}
|
||||
|
||||
private void executeAction(Action action) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
private void executeAction(Action action) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
executeAction(action, null);
|
||||
}
|
||||
|
||||
|
|
@ -124,8 +125,9 @@ public class RemoteCommand extends AdHocCommand {
|
|||
* @throws XMPPErrorException if there is a problem executing the command.
|
||||
* @throws NoResponseException if there was no response from the server.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
private void executeAction(Action action, Form form) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
private void executeAction(Action action, Form form) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
// TODO: Check that all the required fields of the form were filled, if
|
||||
// TODO: not throw the corresponding exeption. This will make a faster response,
|
||||
// TODO: since the request is stoped before it's sent.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue