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
|
|
@ -224,8 +224,9 @@ public class PrivacyListManager extends Manager {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
private Privacy getRequest(Privacy requestPrivacy) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
private Privacy getRequest(Privacy requestPrivacy) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
// The request is a get iq type
|
||||
requestPrivacy.setType(Privacy.Type.get);
|
||||
|
||||
|
|
@ -242,8 +243,9 @@ public class PrivacyListManager extends Manager {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
private Stanza setRequest(Privacy requestPrivacy) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
private Stanza setRequest(Privacy requestPrivacy) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
// The request is a get iq type
|
||||
requestPrivacy.setType(Privacy.Type.set);
|
||||
|
||||
|
|
@ -257,8 +259,9 @@ public class PrivacyListManager extends Manager {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
private Privacy getPrivacyWithListNames() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
private Privacy getPrivacyWithListNames() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
// The request of the list is an empty privacy message
|
||||
Privacy request = new Privacy();
|
||||
|
||||
|
|
@ -273,8 +276,9 @@ public class PrivacyListManager extends Manager {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public PrivacyList getActiveList() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public PrivacyList getActiveList() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
Privacy privacyAnswer = this.getPrivacyWithListNames();
|
||||
String listName = privacyAnswer.getActiveName();
|
||||
boolean isDefaultAndActive = listName != null && listName.equals(privacyAnswer.getDefaultName());
|
||||
|
|
@ -288,9 +292,10 @@ public class PrivacyListManager extends Manager {
|
|||
* @throws NoResponseException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @since 4.1
|
||||
*/
|
||||
public String getActiveListName() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public String getActiveListName() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
if (cachedActiveListName != null) {
|
||||
return cachedActiveListName;
|
||||
}
|
||||
|
|
@ -304,8 +309,9 @@ public class PrivacyListManager extends Manager {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public PrivacyList getDefaultList() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public PrivacyList getDefaultList() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
Privacy privacyAnswer = this.getPrivacyWithListNames();
|
||||
String listName = privacyAnswer.getDefaultName();
|
||||
boolean isDefaultAndActive = listName != null && listName.equals(privacyAnswer.getActiveName());
|
||||
|
|
@ -319,9 +325,10 @@ public class PrivacyListManager extends Manager {
|
|||
* @throws NoResponseException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @since 4.1
|
||||
*/
|
||||
public String getDefaultListName() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public String getDefaultListName() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
if (cachedDefaultListName != null) {
|
||||
return cachedDefaultListName;
|
||||
}
|
||||
|
|
@ -339,9 +346,10 @@ public class PrivacyListManager extends Manager {
|
|||
* @throws NoResponseException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @since 4.1
|
||||
*/
|
||||
public String getEffectiveListName() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public String getEffectiveListName() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
String activeListName = getActiveListName();
|
||||
if (activeListName != null) {
|
||||
return activeListName;
|
||||
|
|
@ -357,8 +365,9 @@ public class PrivacyListManager extends Manager {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
private List<PrivacyItem> getPrivacyListItems(String listName) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
private List<PrivacyItem> getPrivacyListItems(String listName) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
// The request of the list is an privacy message with an empty list
|
||||
Privacy request = new Privacy();
|
||||
request.setPrivacyList(listName, new ArrayList<PrivacyItem>());
|
||||
|
|
@ -377,8 +386,9 @@ public class PrivacyListManager extends Manager {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public PrivacyList getPrivacyList(String listName) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public PrivacyList getPrivacyList(String listName) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
return new PrivacyList(false, false, listName, getPrivacyListItems(listName));
|
||||
}
|
||||
|
||||
|
|
@ -389,8 +399,9 @@ public class PrivacyListManager extends Manager {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public List<PrivacyList> getPrivacyLists() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public List<PrivacyList> getPrivacyLists() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
Privacy privacyAnswer = getPrivacyWithListNames();
|
||||
Set<String> names = privacyAnswer.getPrivacyListNames();
|
||||
List<PrivacyList> lists = new ArrayList<>(names.size());
|
||||
|
|
@ -410,8 +421,9 @@ public class PrivacyListManager extends Manager {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void setActiveListName(String listName) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public void setActiveListName(String listName) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
// The request of the list is an privacy message with an empty list
|
||||
Privacy request = new Privacy();
|
||||
request.setActiveName(listName);
|
||||
|
|
@ -425,8 +437,9 @@ public class PrivacyListManager extends Manager {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void declineActiveList() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public void declineActiveList() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
// The request of the list is an privacy message with an empty list
|
||||
Privacy request = new Privacy();
|
||||
request.setDeclineActiveList(true);
|
||||
|
|
@ -442,8 +455,9 @@ public class PrivacyListManager extends Manager {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void setDefaultListName(String listName) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public void setDefaultListName(String listName) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
// The request of the list is an privacy message with an empty list
|
||||
Privacy request = new Privacy();
|
||||
request.setDefaultName(listName);
|
||||
|
|
@ -457,8 +471,9 @@ public class PrivacyListManager extends Manager {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void declineDefaultList() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public void declineDefaultList() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
// The request of the list is an privacy message with an empty list
|
||||
Privacy request = new Privacy();
|
||||
request.setDeclineDefaultList(true);
|
||||
|
|
@ -475,8 +490,9 @@ public class PrivacyListManager extends Manager {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void createPrivacyList(String listName, List<PrivacyItem> privacyItems) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public void createPrivacyList(String listName, List<PrivacyItem> privacyItems) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
updatePrivacyList(listName, privacyItems);
|
||||
}
|
||||
|
||||
|
|
@ -490,8 +506,9 @@ public class PrivacyListManager extends Manager {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void updatePrivacyList(String listName, List<PrivacyItem> privacyItems) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public void updatePrivacyList(String listName, List<PrivacyItem> privacyItems) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
// Build the privacy package to add or update the new list
|
||||
Privacy request = new Privacy();
|
||||
request.setPrivacyList(listName, privacyItems);
|
||||
|
|
@ -507,8 +524,9 @@ public class PrivacyListManager extends Manager {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void deletePrivacyList(String listName) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public void deletePrivacyList(String listName) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
// The request of the list is an privacy message with an empty list
|
||||
Privacy request = new Privacy();
|
||||
request.setPrivacyList(listName, new ArrayList<PrivacyItem>());
|
||||
|
|
@ -545,8 +563,9 @@ public class PrivacyListManager extends Manager {
|
|||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public boolean isSupported() throws NoResponseException, XMPPErrorException, NotConnectedException{
|
||||
public boolean isSupported() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException{
|
||||
return ServiceDiscoveryManager.getInstanceFor(connection()).serverSupportsFeature(NAMESPACE);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue