mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-10 02:39:42 +02:00
Enable trailing whitespace checkstyle check
for all source code regions, including javadoc.
This commit is contained in:
parent
9d61a6de7d
commit
e8923b9d16
545 changed files with 3713 additions and 3715 deletions
|
@ -24,8 +24,8 @@ import org.jivesoftware.smack.filter.PacketFilter;
|
|||
import org.jivesoftware.smack.filter.StanzaExtensionFilter;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @author Matt Tucker
|
||||
*/
|
||||
public class GroupChatInvitationTest extends SmackTestCase {
|
||||
|
|
|
@ -37,10 +37,10 @@ public class MessageEventManagerTest extends SmackTestCase {
|
|||
|
||||
/**
|
||||
* High level API test.
|
||||
* This is a simple test to use with an XMPP client and check if the client receives the
|
||||
* This is a simple test to use with an XMPP client and check if the client receives the
|
||||
* message
|
||||
* 1. User_1 will send a message to user_2 requesting to be notified when any of these events
|
||||
* occurs: offline, composing, displayed or delivered
|
||||
* occurs: offline, composing, displayed or delivered
|
||||
*/
|
||||
public void testSendMessageEventRequest() {
|
||||
// Create a chat for each connection
|
||||
|
@ -64,10 +64,10 @@ public class MessageEventManagerTest extends SmackTestCase {
|
|||
|
||||
/**
|
||||
* High level API test.
|
||||
* This is a simple test to use with an XMPP client, check if the client receives the
|
||||
* This is a simple test to use with an XMPP client, check if the client receives the
|
||||
* message and display in the console any notification
|
||||
* 1. User_1 will send a message to user_2 requesting to be notified when any of these events
|
||||
* occurs: offline, composing, displayed or delivered
|
||||
* occurs: offline, composing, displayed or delivered
|
||||
* 2. User_2 will use an XMPP client (like Exodus) to display the message and compose a reply
|
||||
* 3. User_1 will display any notification that receives
|
||||
*/
|
||||
|
@ -120,9 +120,9 @@ public class MessageEventManagerTest extends SmackTestCase {
|
|||
/**
|
||||
* High level API test.
|
||||
* 1. User_1 will send a message to user_2 requesting to be notified when any of these events
|
||||
* occurs: offline, composing, displayed or delivered
|
||||
* occurs: offline, composing, displayed or delivered
|
||||
* 2. User_2 will receive the message
|
||||
* 3. User_2 will simulate that the message was displayed
|
||||
* 3. User_2 will simulate that the message was displayed
|
||||
* 4. User_2 will simulate that he/she is composing a reply
|
||||
* 5. User_2 will simulate that he/she has cancelled the reply
|
||||
*/
|
||||
|
|
|
@ -43,7 +43,7 @@ public class RosterExchangeManagerTest extends SmackTestCase {
|
|||
|
||||
/**
|
||||
* High level API test.
|
||||
* This is a simple test to use with an XMPP client and check if the client receives user1's
|
||||
* This is a simple test to use with an XMPP client and check if the client receives user1's
|
||||
* roster
|
||||
* 1. User_1 will send his/her roster to user_2
|
||||
*/
|
||||
|
@ -62,7 +62,7 @@ public class RosterExchangeManagerTest extends SmackTestCase {
|
|||
|
||||
/**
|
||||
* High level API test.
|
||||
* This is a simple test to use with an XMPP client and check if the client receives user1's
|
||||
* This is a simple test to use with an XMPP client and check if the client receives user1's
|
||||
* roster groups
|
||||
* 1. User_1 will send his/her RosterGroups to user_2
|
||||
*/
|
||||
|
@ -84,7 +84,7 @@ public class RosterExchangeManagerTest extends SmackTestCase {
|
|||
* High level API test.
|
||||
* 1. User_1 will send his/her roster to user_2
|
||||
* 2. User_2 will receive the entries and iterate over them to check if everything is fine
|
||||
* 3. User_1 will wait several seconds for an ACK from user_2, if none is received then
|
||||
* 3. User_1 will wait several seconds for an ACK from user_2, if none is received then
|
||||
* something is wrong
|
||||
*/
|
||||
public void testSendAndReceiveRoster() {
|
||||
|
@ -132,9 +132,9 @@ public class RosterExchangeManagerTest extends SmackTestCase {
|
|||
/**
|
||||
* High level API test.
|
||||
* 1. User_1 will send his/her roster to user_2
|
||||
* 2. User_2 will automatically add the entries that receives to his/her roster in the
|
||||
* 2. User_2 will automatically add the entries that receives to his/her roster in the
|
||||
* corresponding group
|
||||
* 3. User_1 will wait several seconds for an ACK from user_2, if none is received then
|
||||
* 3. User_1 will wait several seconds for an ACK from user_2, if none is received then
|
||||
* something is wrong
|
||||
*/
|
||||
public void testSendAndAcceptRoster() {
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.jivesoftware.smackx.packet.DiscoverInfo.Identity;
|
|||
|
||||
/**
|
||||
* Tests the service discovery functionality.
|
||||
*
|
||||
*
|
||||
* @author Gaston Dombiak
|
||||
*/
|
||||
public class ServiceDiscoveryManagerTest extends SmackTestCase {
|
||||
|
@ -37,7 +37,7 @@ public class ServiceDiscoveryManagerTest extends SmackTestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests info discovery of a Smack client.
|
||||
* Tests info discovery of a Smack client.
|
||||
*/
|
||||
public void testSmackInfo() {
|
||||
|
||||
|
@ -86,7 +86,7 @@ public class ServiceDiscoveryManagerTest extends SmackTestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests service discovery of XHTML support.
|
||||
* Tests service discovery of XHTML support.
|
||||
*/
|
||||
public void testXHTMLFeature() {
|
||||
// Check for local XHTML service support
|
||||
|
@ -94,17 +94,17 @@ public class ServiceDiscoveryManagerTest extends SmackTestCase {
|
|||
assertTrue(XHTMLManager.isServiceEnabled(getConnection(0)));
|
||||
assertTrue(XHTMLManager.isServiceEnabled(getConnection(1)));
|
||||
// Check for XHTML support in connection1 from connection2
|
||||
// Must specify a full JID and not a bare JID. Ensure that the server is working ok.
|
||||
// Must specify a full JID and not a bare JID. Ensure that the server is working ok.
|
||||
assertFalse(XHTMLManager.isServiceEnabled(getConnection(1), getBareJID(0)));
|
||||
// Using a full JID check that the other client supports XHTML.
|
||||
// Using a full JID check that the other client supports XHTML.
|
||||
assertTrue(XHTMLManager.isServiceEnabled(getConnection(1), getFullJID(0)));
|
||||
|
||||
// Disable the XHTML Message support in connection1
|
||||
XHTMLManager.setServiceEnabled(getConnection(0), false);
|
||||
// Check for local XHTML service support
|
||||
// Check for local XHTML service support
|
||||
assertFalse(XHTMLManager.isServiceEnabled(getConnection(0)));
|
||||
assertTrue(XHTMLManager.isServiceEnabled(getConnection(1)));
|
||||
// Check for XHTML support in connection1 from connection2
|
||||
// Check for XHTML support in connection1 from connection2
|
||||
assertFalse(XHTMLManager.isServiceEnabled(getConnection(1), getFullJID(0)));
|
||||
}
|
||||
|
||||
|
|
|
@ -82,9 +82,9 @@ public class XHTMLManagerTest extends SmackTestCase {
|
|||
/**
|
||||
* High level API test.
|
||||
* 1. User_1 will send a message with XHTML to user_2
|
||||
* 2. User_2 will receive the message and iterate over the XHTML bodies to check if everything
|
||||
* 2. User_2 will receive the message and iterate over the XHTML bodies to check if everything
|
||||
* is fine
|
||||
* 3. User_1 will wait several seconds for an ACK from user_2, if none is received then
|
||||
* 3. User_1 will wait several seconds for an ACK from user_2, if none is received then
|
||||
* something is wrong
|
||||
*/
|
||||
public void testSendSimpleXHTMLMessageAndDisplayReceivedXHTMLMessage() {
|
||||
|
@ -142,9 +142,9 @@ public class XHTMLManagerTest extends SmackTestCase {
|
|||
/**
|
||||
* Low level API test. Test a message with two XHTML bodies and several XHTML tags.
|
||||
* 1. User_1 will send a message with XHTML to user_2
|
||||
* 2. User_2 will receive the message and iterate over the XHTML bodies to check if everything
|
||||
* 2. User_2 will receive the message and iterate over the XHTML bodies to check if everything
|
||||
* is fine
|
||||
* 3. User_1 will wait several seconds for an ACK from user_2, if none is received then
|
||||
* 3. User_1 will wait several seconds for an ACK from user_2, if none is received then
|
||||
* something is wrong
|
||||
*/
|
||||
public void testSendComplexXHTMLMessageAndDisplayReceivedXHTMLMessage() {
|
||||
|
|
|
@ -34,7 +34,7 @@ import org.jivesoftware.smackx.bytestreams.ibb.packet.Open;
|
|||
|
||||
/**
|
||||
* Test for In-Band Bytestreams with real XMPP servers.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class InBandBytestreamTest extends SmackTestCase {
|
||||
|
@ -49,7 +49,7 @@ public class InBandBytestreamTest extends SmackTestCase {
|
|||
/**
|
||||
* Target should respond with not-acceptable error if no listeners for incoming In-Band
|
||||
* Bytestream requests are registered.
|
||||
*
|
||||
*
|
||||
* @throws XMPPException should not happen
|
||||
*/
|
||||
public void testRespondWithErrorOnInBandBytestreamRequest() throws XMPPException {
|
||||
|
@ -73,7 +73,7 @@ public class InBandBytestreamTest extends SmackTestCase {
|
|||
|
||||
/**
|
||||
* An In-Band Bytestream should be successfully established using IQ stanzas.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
public void testInBandBytestreamWithIQStanzas() throws Exception {
|
||||
|
@ -127,7 +127,7 @@ public class InBandBytestreamTest extends SmackTestCase {
|
|||
|
||||
/**
|
||||
* An In-Band Bytestream should be successfully established using message stanzas.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
public void testInBandBytestreamWithMessageStanzas() throws Exception {
|
||||
|
@ -183,7 +183,7 @@ public class InBandBytestreamTest extends SmackTestCase {
|
|||
/**
|
||||
* An In-Band Bytestream should be successfully established using IQ stanzas. The established
|
||||
* session should transfer data bidirectional.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
public void testBiDirectionalInBandBytestream() throws Exception {
|
||||
|
|
|
@ -40,14 +40,14 @@ import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream;
|
|||
|
||||
/**
|
||||
* Test for Socks5 bytestreams with real XMPP servers.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class Socks5ByteStreamTest extends SmackTestCase {
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
*
|
||||
* @param arg0
|
||||
*/
|
||||
public Socks5ByteStreamTest(String arg0) {
|
||||
|
@ -56,7 +56,7 @@ public class Socks5ByteStreamTest extends SmackTestCase {
|
|||
|
||||
/**
|
||||
* Socks5 feature should be added to the service discovery on Smack startup.
|
||||
*
|
||||
*
|
||||
* @throws XMPPException should not happen
|
||||
*/
|
||||
public void testInitializationSocks5FeaturesAndListenerOnStartup() throws XMPPException {
|
||||
|
@ -70,7 +70,7 @@ public class Socks5ByteStreamTest extends SmackTestCase {
|
|||
/**
|
||||
* Target should respond with not-acceptable error if no listeners for incoming Socks5
|
||||
* bytestream requests are registered.
|
||||
*
|
||||
*
|
||||
* @throws XMPPException should not happen
|
||||
*/
|
||||
public void testRespondWithErrorOnSocks5BytestreamRequest() throws XMPPException {
|
||||
|
@ -94,7 +94,7 @@ public class Socks5ByteStreamTest extends SmackTestCase {
|
|||
|
||||
/**
|
||||
* Socks5 bytestream should be successfully established using the local Socks5 proxy.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
public void testSocks5BytestreamWithLocalSocks5Proxy() throws Exception {
|
||||
|
@ -162,7 +162,7 @@ public class Socks5ByteStreamTest extends SmackTestCase {
|
|||
* This test will fail if the XMPP server doesn't provide any Socks5 proxies or the Socks5 proxy
|
||||
* only allows Socks5 bytestreams in the context of a file transfer (like Openfire in default
|
||||
* configuration, see xmpp.proxy.transfer.required flag).
|
||||
*
|
||||
*
|
||||
* @throws Exception if no Socks5 proxies found or proxy is unwilling to activate Socks5
|
||||
* bytestream
|
||||
*/
|
||||
|
@ -237,7 +237,7 @@ public class Socks5ByteStreamTest extends SmackTestCase {
|
|||
* This test will fail if the XMPP server doesn't provide any Socks5 proxies or the Socks5 proxy
|
||||
* only allows Socks5 bytestreams in the context of a file transfer (like Openfire in default
|
||||
* configuration, see xmpp.proxy.transfer.required flag).
|
||||
*
|
||||
*
|
||||
* @throws Exception if no Socks5 proxies found or proxy is unwilling to activate Socks5
|
||||
* bytestream
|
||||
*/
|
||||
|
|
|
@ -48,7 +48,7 @@ import org.jivesoftware.smackx.packet.XHTMLExtension;
|
|||
|
||||
/**
|
||||
* Tests the new MUC functionalities.
|
||||
*
|
||||
*
|
||||
* @author Gaston Dombiak
|
||||
*/
|
||||
public class MultiUserChatTest extends SmackTestCase {
|
||||
|
@ -67,7 +67,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
*/
|
||||
public void testGroupchatCompatibility() {
|
||||
// TODO: this test needs to be re-written so that it manually emulates the old-style
|
||||
// TODO: group chat protocol. Tne GroupChat class was deleted for Smack 3.0.
|
||||
// TODO: group chat protocol. Tne GroupChat class was deleted for Smack 3.0.
|
||||
/*try {
|
||||
Message message;
|
||||
|
||||
|
@ -132,7 +132,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
System.out.println(UTC_FORMAT.format(delay.getStamp()));
|
||||
|
||||
assertEquals("Body of first message is incorrect", "Message 3", msg.getBody());
|
||||
// Try to get second historic message
|
||||
// Try to get second historic message
|
||||
msg = muc2.nextMessage(1000);
|
||||
assertNull("Second message is not null", msg);
|
||||
|
||||
|
@ -143,15 +143,15 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
history.setMaxStanzas(2);
|
||||
muc3.join("testbot3", null, history, SmackConfiguration.getPacketReplyTimeout());
|
||||
|
||||
// Get first historic message
|
||||
// Get first historic message
|
||||
msg = muc3.nextMessage(1000);
|
||||
assertNotNull("First message is null", msg);
|
||||
assertEquals("Body of first message is incorrect", "Message 2", msg.getBody());
|
||||
// Get second historic message
|
||||
// Get second historic message
|
||||
msg = muc3.nextMessage(1000);
|
||||
assertNotNull("Second message is null", msg);
|
||||
assertEquals("Body of second message is incorrect", "Message 3", msg.getBody());
|
||||
// Try to get third historic message
|
||||
// Try to get third historic message
|
||||
msg = muc3.nextMessage(1000);
|
||||
assertNull("Third message is not null", msg);
|
||||
|
||||
|
@ -451,7 +451,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
}
|
||||
});
|
||||
|
||||
// Start a private chat with another participant
|
||||
// Start a private chat with another participant
|
||||
Chat chat = muc2.createPrivateChat(room + "/testbot", null);
|
||||
StanzaCollector collector = chat.createCollector();
|
||||
chat.sendMessage("Hello there");
|
||||
|
@ -598,7 +598,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
}
|
||||
});
|
||||
|
||||
// Check that a 403 error is received when a not allowed user tries to change the
|
||||
// Check that a 403 error is received when a not allowed user tries to change the
|
||||
// subject in a room
|
||||
try {
|
||||
muc2.changeSubject("New Subject2");
|
||||
|
@ -615,7 +615,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
xmppError.getCode());
|
||||
}
|
||||
|
||||
// Check that every MUC updates its subject when an allowed user changes the subject
|
||||
// Check that every MUC updates its subject when an allowed user changes the subject
|
||||
// in a room
|
||||
muc.changeSubject("New Subject1");
|
||||
Thread.sleep(300);
|
||||
|
@ -651,7 +651,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User2 joins the new room
|
||||
MultiUserChat muc2 = new MultiUserChat(getConnection(1), room);
|
||||
muc2.join("testbot2");
|
||||
// User2 will lister for his own "kicking"
|
||||
// User2 will lister for his own "kicking"
|
||||
muc2.addUserStatusListener(new DefaultUserStatusListener() {
|
||||
public void kicked(String actor, String reason) {
|
||||
super.kicked(actor, reason);
|
||||
|
@ -663,7 +663,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User3 joins the new room
|
||||
MultiUserChat muc3 = new MultiUserChat(getConnection(2), room);
|
||||
muc3.join("testbot3");
|
||||
// User3 will lister for user2's "kicking"
|
||||
// User3 will lister for user2's "kicking"
|
||||
muc3.addParticipantStatusListener(new DefaultParticipantStatusListener() {
|
||||
public void kicked(String participant, String actor, String reason) {
|
||||
super.kicked(participant, actor, reason);
|
||||
|
@ -728,7 +728,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User2 joins the new room
|
||||
MultiUserChat muc2 = new MultiUserChat(getConnection(1), room);
|
||||
muc2.join("testbot2");
|
||||
// User2 will lister for his own "banning"
|
||||
// User2 will lister for his own "banning"
|
||||
muc2.addUserStatusListener(new DefaultUserStatusListener() {
|
||||
public void banned(String actor, String reason) {
|
||||
super.banned(actor, reason);
|
||||
|
@ -740,7 +740,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User3 joins the new room
|
||||
MultiUserChat muc3 = new MultiUserChat(getConnection(2), room);
|
||||
muc3.join("testbot3");
|
||||
// User3 will lister for user2's "banning"
|
||||
// User3 will lister for user2's "banning"
|
||||
muc3.addParticipantStatusListener(new DefaultParticipantStatusListener() {
|
||||
public void banned(String participant, String actor, String reason) {
|
||||
super.banned(participant, actor, reason);
|
||||
|
@ -808,7 +808,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User2 joins the new room (as a visitor)
|
||||
MultiUserChat muc2 = new MultiUserChat(getConnection(1), room);
|
||||
muc2.join("testbot2");
|
||||
// User2 will listen for his own "voice"
|
||||
// User2 will listen for his own "voice"
|
||||
muc2.addUserStatusListener(new DefaultUserStatusListener() {
|
||||
public void voiceGranted() {
|
||||
super.voiceGranted();
|
||||
|
@ -823,7 +823,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User3 joins the new room (as a visitor)
|
||||
MultiUserChat muc3 = new MultiUserChat(getConnection(2), room);
|
||||
muc3.join("testbot3");
|
||||
// User3 will lister for user2's "voice"
|
||||
// User3 will lister for user2's "voice"
|
||||
muc3.addParticipantStatusListener(new DefaultParticipantStatusListener() {
|
||||
public void voiceGranted(String participant) {
|
||||
super.voiceGranted(participant);
|
||||
|
@ -898,7 +898,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User2 joins the new room (as a visitor)
|
||||
MultiUserChat muc2 = new MultiUserChat(getConnection(1), room);
|
||||
muc2.join("testbot2");
|
||||
// User2 will listen for moderator privileges
|
||||
// User2 will listen for moderator privileges
|
||||
muc2.addUserStatusListener(new DefaultUserStatusListener() {
|
||||
public void voiceGranted() {
|
||||
super.voiceGranted();
|
||||
|
@ -921,7 +921,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User3 joins the new room (as a visitor)
|
||||
MultiUserChat muc3 = new MultiUserChat(getConnection(2), room);
|
||||
muc3.join("testbot3");
|
||||
// User3 will lister for user2's moderator privileges
|
||||
// User3 will lister for user2's moderator privileges
|
||||
muc3.addParticipantStatusListener(new DefaultParticipantStatusListener() {
|
||||
public void voiceGranted(String participant) {
|
||||
super.voiceGranted(participant);
|
||||
|
@ -1045,7 +1045,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User2 joins the new room (as a visitor)
|
||||
MultiUserChat muc2 = new MultiUserChat(getConnection(1), room);
|
||||
muc2.join("testbot2");
|
||||
// User2 will listen for membership privileges
|
||||
// User2 will listen for membership privileges
|
||||
muc2.addUserStatusListener(new DefaultUserStatusListener() {
|
||||
public void membershipGranted() {
|
||||
super.membershipGranted();
|
||||
|
@ -1060,7 +1060,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User3 joins the new room (as a visitor)
|
||||
MultiUserChat muc3 = new MultiUserChat(getConnection(2), room);
|
||||
muc3.join("testbot3");
|
||||
// User3 will lister for user2's membership privileges
|
||||
// User3 will lister for user2's membership privileges
|
||||
muc3.addParticipantStatusListener(new DefaultParticipantStatusListener() {
|
||||
public void membershipGranted(String participant) {
|
||||
super.membershipGranted(participant);
|
||||
|
@ -1139,7 +1139,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User2 joins the new room (as a visitor)
|
||||
MultiUserChat muc2 = new MultiUserChat(getConnection(1), room);
|
||||
muc2.join("testbot2");
|
||||
// User2 will listen for admin privileges
|
||||
// User2 will listen for admin privileges
|
||||
muc2.addUserStatusListener(new DefaultUserStatusListener() {
|
||||
public void membershipGranted() {
|
||||
super.membershipGranted();
|
||||
|
@ -1162,7 +1162,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User3 joins the new room (as a visitor)
|
||||
MultiUserChat muc3 = new MultiUserChat(getConnection(2), room);
|
||||
muc3.join("testbot3");
|
||||
// User3 will lister for user2's admin privileges
|
||||
// User3 will lister for user2's admin privileges
|
||||
muc3.addParticipantStatusListener(new DefaultParticipantStatusListener() {
|
||||
public void membershipGranted(String participant) {
|
||||
super.membershipGranted(participant);
|
||||
|
@ -1298,7 +1298,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User2 joins the new room (as a visitor)
|
||||
MultiUserChat muc2 = new MultiUserChat(getConnection(1), room);
|
||||
muc2.join("testbot2");
|
||||
// User2 will listen for ownership privileges
|
||||
// User2 will listen for ownership privileges
|
||||
muc2.addUserStatusListener(new DefaultUserStatusListener() {
|
||||
public void membershipGranted() {
|
||||
super.membershipGranted();
|
||||
|
@ -1329,7 +1329,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User3 joins the new room (as a visitor)
|
||||
MultiUserChat muc3 = new MultiUserChat(getConnection(2), room);
|
||||
muc3.join("testbot3");
|
||||
// User3 will lister for user2's ownership privileges
|
||||
// User3 will lister for user2's ownership privileges
|
||||
muc3.addParticipantStatusListener(new DefaultParticipantStatusListener() {
|
||||
public void membershipGranted(String participant) {
|
||||
super.membershipGranted(participant);
|
||||
|
@ -1624,7 +1624,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Check that ParticipantStatusListener is receiving joining and leaving events correctly.
|
||||
* Check that ParticipantStatusListener is receiving joining and leaving events correctly.
|
||||
*/
|
||||
public void testJoinLeftEvents() {
|
||||
final String[] answer = new String[8];
|
||||
|
|
|
@ -36,10 +36,10 @@ public class MessageEventTest extends SmackTestCase {
|
|||
|
||||
/**
|
||||
* Low level API test.
|
||||
* This is a simple test to use with an XMPP client and check if the client receives the
|
||||
* This is a simple test to use with an XMPP client and check if the client receives the
|
||||
* message
|
||||
* 1. User_1 will send a message to user_2 requesting to be notified when any of these events
|
||||
* occurs: offline, composing, displayed or delivered
|
||||
* occurs: offline, composing, displayed or delivered
|
||||
*/
|
||||
public void testSendMessageEventRequest() {
|
||||
// Create a chat for each connection
|
||||
|
@ -70,10 +70,10 @@ public class MessageEventTest extends SmackTestCase {
|
|||
|
||||
/**
|
||||
* Low level API test.
|
||||
* This is a simple test to use with an XMPP client, check if the client receives the
|
||||
* This is a simple test to use with an XMPP client, check if the client receives the
|
||||
* message and display in the console any notification
|
||||
* 1. User_1 will send a message to user_2 requesting to be notified when any of these events
|
||||
* occurs: offline, composing, displayed or delivered
|
||||
* occurs: offline, composing, displayed or delivered
|
||||
* 2. User_2 will use an XMPP client (like Exodus) to display the message and compose a reply
|
||||
* 3. User_1 will display any notification that receives
|
||||
*/
|
||||
|
|
|
@ -139,7 +139,7 @@ public class XHTMLExtensionTest extends SmackTestCase {
|
|||
final StanzaCollector chat2 = getConnection(1).createStanzaCollector(
|
||||
new ThreadFilter(chat1.getThreadID()));
|
||||
|
||||
// Create a Listener that listens for Messages with the extension
|
||||
// Create a Listener that listens for Messages with the extension
|
||||
//"http://jabber.org/protocol/xhtml-im"
|
||||
// This listener will listen on the conn2 and answer an ACK if everything is ok
|
||||
PacketFilter packetFilter =
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub;
|
|||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
@ -56,7 +56,7 @@ class CarExtension implements PacketExtension
|
|||
|
||||
public String toXML()
|
||||
{
|
||||
return "<" + getElementName() + " xmlns='" + getNamespace() + "'><paint color='" +
|
||||
return "<" + getElementName() + " xmlns='" + getNamespace() + "'><paint color='" +
|
||||
getColor() + "'/><tires num='" + getNumTires() + "'/></" + getElementName() + ">";
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.jivesoftware.smack.provider.PacketExtensionProvider;
|
|||
import org.xmlpull.v1.XmlPullParser;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.jivesoftware.smackx.packet.DiscoverInfo.Identity;
|
|||
import org.jivesoftware.smackx.pubsub.test.SingleUserTestCase;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
@ -76,7 +76,7 @@ public class EntityUseCases extends SingleUserTestCase
|
|||
|
||||
assertTrue(subscriptions.size() < 3);
|
||||
|
||||
for (Subscription subscription : subscriptions)
|
||||
for (Subscription subscription : subscriptions)
|
||||
{
|
||||
assertNull(subscription.getNode());
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.jivesoftware.smack.packet.XMPPError;
|
|||
import org.jivesoftware.smackx.pubsub.test.PubSubTestCase;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.jivesoftware.smack.XMPPException;
|
|||
import org.jivesoftware.smackx.pubsub.test.SingleUserTestCase;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace;
|
|||
import org.jivesoftware.smackx.pubsub.test.SingleUserTestCase;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
@ -69,9 +69,9 @@ public class PublisherUseCases extends SingleUserTestCase
|
|||
public void testSendNodeTrPay_WithPayload() throws XMPPException
|
||||
{
|
||||
LeafNode node = getPubnode(false, true);
|
||||
node.send(new PayloadItem<SimplePayload>(null,
|
||||
node.send(new PayloadItem<SimplePayload>(null,
|
||||
new SimplePayload("book", "pubsub:test:book", "<book xmlns='pubsub:test:book'><title>Lord of the Rings</title></book>")));
|
||||
node.send(new PayloadItem<SimplePayload>("test" + System.currentTimeMillis(),
|
||||
node.send(new PayloadItem<SimplePayload>("test" + System.currentTimeMillis(),
|
||||
new SimplePayload("book", "pubsub:test:book", "<book xmlns='pubsub:test:book'><title>Two Towers</title></book>")));
|
||||
}
|
||||
|
||||
|
@ -80,18 +80,18 @@ public class PublisherUseCases extends SingleUserTestCase
|
|||
LeafNode node = getPubnode(true, false);
|
||||
node.send(new Item());
|
||||
node.send(new Item("test" + System.currentTimeMillis()));
|
||||
node.send(new PayloadItem<SimplePayload>(null,
|
||||
node.send(new PayloadItem<SimplePayload>(null,
|
||||
new SimplePayload("book", "pubsub:test:book", "<book xmlns='pubsub:test:book'><title>Lord of the Rings</title></book>")));
|
||||
node.send(new PayloadItem<SimplePayload>("test" + System.currentTimeMillis(),
|
||||
node.send(new PayloadItem<SimplePayload>("test" + System.currentTimeMillis(),
|
||||
new SimplePayload("book", "pubsub:test:book", "<book xmlns='pubsub:test:book'><title>Two Towers</title></book>")));
|
||||
}
|
||||
|
||||
public void testSendPerPay_WithPayload() throws Exception
|
||||
{
|
||||
LeafNode node = getPubnode(true, true);
|
||||
node.send(new PayloadItem<SimplePayload>(null,
|
||||
node.send(new PayloadItem<SimplePayload>(null,
|
||||
new SimplePayload("book", "pubsub:test:book", "<book xmlns='pubsub:test:book'><title>Lord of the Rings</title></book>")));
|
||||
node.send(new PayloadItem<SimplePayload>("test" + System.currentTimeMillis(),
|
||||
node.send(new PayloadItem<SimplePayload>("test" + System.currentTimeMillis(),
|
||||
new SimplePayload("book", "pubsub:test:book", "<book xmlns='pubsub:test:book'><title>Two Towers</title></book>")));
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.jivesoftware.smackx.FormField;
|
|||
import org.jivesoftware.smackx.pubsub.test.SingleUserTestCase;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
@ -138,17 +138,17 @@ public class SubscriberUseCases extends SingleUserTestCase
|
|||
}
|
||||
|
||||
// public void testSubscribeWithConfig() throws Exception
|
||||
// {
|
||||
// {
|
||||
// LeafNode node = getPubnode(false, false);
|
||||
//
|
||||
// Subscription sub = node.subscribe(getBareJID(0));
|
||||
//
|
||||
//
|
||||
// assertEquals(getBareJID(0), sub.getJid());
|
||||
// assertNotNull(sub.getId());
|
||||
// assertEquals(node.getId(), sub.getNode());
|
||||
// assertEquals(true, sub.isConfigRequired());
|
||||
// }
|
||||
//
|
||||
//
|
||||
public void testGetItems() throws Exception
|
||||
{
|
||||
LeafNode node = getPubnode(true, false);
|
||||
|
@ -197,7 +197,7 @@ public class SubscriberUseCases extends SingleUserTestCase
|
|||
List<PayloadItem<SimplePayload>> payloadItems = payloadNode.getItems();
|
||||
Map<String, PayloadItem<SimplePayload>> idMap = new HashMap<String, PayloadItem<SimplePayload>>();
|
||||
|
||||
for (PayloadItem<SimplePayload> payloadItem : payloadItems)
|
||||
for (PayloadItem<SimplePayload> payloadItem : payloadItems)
|
||||
{
|
||||
idMap.put(payloadItem.getId(), payloadItem);
|
||||
}
|
||||
|
@ -262,9 +262,9 @@ public class SubscriberUseCases extends SingleUserTestCase
|
|||
assertTrue(listContainsId("5", items));
|
||||
}
|
||||
|
||||
private static boolean listContainsId(String id, List<Item> items)
|
||||
private static boolean listContainsId(String id, List<Item> items)
|
||||
{
|
||||
for (Item item : items)
|
||||
for (Item item : items)
|
||||
{
|
||||
if (item.getId().equals(id))
|
||||
return true;
|
||||
|
|
|
@ -20,7 +20,7 @@ import org.jivesoftware.smack.XMPPException;
|
|||
import org.jivesoftware.smackx.pubsub.test.SingleUserTestCase;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.jivesoftware.smackx.pubsub.listener.ItemEventListener;
|
|||
import org.jivesoftware.smackx.pubsub.listener.NodeConfigListener;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
@ -97,7 +97,7 @@ public class TestEvents extends SmackTestCase
|
|||
subNode.subscribe(getConnection(1).getUser());
|
||||
subNode.addConfigurationListener(sub1Handler);
|
||||
|
||||
ConfigureForm currentConfig = creatorNode.getNodeConfiguration();
|
||||
ConfigureForm currentConfig = creatorNode.getNodeConfiguration();
|
||||
ConfigureForm form = new ConfigureForm(currentConfig.createAnswerForm());
|
||||
form.setPersistentItems(true);
|
||||
form.setDeliverPayloads(false);
|
||||
|
@ -108,7 +108,7 @@ public class TestEvents extends SmackTestCase
|
|||
assertEquals(nodeId, event.getNode());
|
||||
assertNull(event.getConfiguration());
|
||||
|
||||
currentConfig = creatorNode.getNodeConfiguration();
|
||||
currentConfig = creatorNode.getNodeConfiguration();
|
||||
form = new ConfigureForm(currentConfig.createAnswerForm());
|
||||
form.setDeliverPayloads(true);
|
||||
creatorNode.sendConfigurationForm(form);
|
||||
|
@ -205,7 +205,7 @@ public class TestEvents extends SmackTestCase
|
|||
|
||||
/*
|
||||
* For this test, the following extension needs to be added to the meta-inf/smack.providers file
|
||||
*
|
||||
*
|
||||
* <extensionProvider>
|
||||
* <elementName>car</elementName>
|
||||
* <namespace>pubsub:test:vehicle</namespace>
|
||||
|
@ -585,7 +585,7 @@ public class TestEvents extends SmackTestCase
|
|||
}
|
||||
}
|
||||
|
||||
private static LeafNode getPubnode(PubSubManager manager, String id, boolean persistItems, boolean deliverPayload)
|
||||
private static LeafNode getPubnode(PubSubManager manager, String id, boolean persistItems, boolean deliverPayload)
|
||||
throws XMPPException
|
||||
{
|
||||
ConfigureForm form = new ConfigureForm(FormType.submit);
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub;
|
|||
import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
@ -27,7 +27,7 @@ public class TestMessageContent extends TestCase
|
|||
{
|
||||
String payloadXmlWithNS = "<book xmlns='pubsub:test:book'><author name='Stephen King'/></book>";
|
||||
|
||||
public void testItemWithId()
|
||||
public void testItemWithId()
|
||||
{
|
||||
Item item = new Item("123");
|
||||
assertEquals("<item id='123'/>", item.toXML());
|
||||
|
@ -35,7 +35,7 @@ public class TestMessageContent extends TestCase
|
|||
assertNull(item.getNamespace());
|
||||
}
|
||||
|
||||
public void testItemWithNoId()
|
||||
public void testItemWithNoId()
|
||||
{
|
||||
Item item = new Item();
|
||||
assertEquals("<item/>", item.toXML());
|
||||
|
@ -44,7 +44,7 @@ public class TestMessageContent extends TestCase
|
|||
assertEquals("<item/>", itemNull.toXML());
|
||||
}
|
||||
|
||||
public void testSimplePayload()
|
||||
public void testSimplePayload()
|
||||
{
|
||||
SimplePayload payloadNS = new SimplePayload("book", "pubsub:test:book", payloadXmlWithNS);
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.jivesoftware.smackx.pubsub.LeafNode;
|
|||
import org.jivesoftware.smackx.pubsub.PubSubManager;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.jivesoftware.smackx.pubsub.LeafNode;
|
|||
import org.jivesoftware.smackx.pubsub.PubSubManager;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -20,7 +20,7 @@ import org.jivesoftware.smack.initializer.UrlInitializer;
|
|||
|
||||
/**
|
||||
* Initializes the providers in the experimental code stream.
|
||||
*
|
||||
*
|
||||
* @author Florian Schmaus
|
||||
*/
|
||||
public class ExtensionsInitializer extends UrlInitializer {
|
||||
|
|
|
@ -75,7 +75,7 @@ public class MultipleRecipientInfo {
|
|||
/**
|
||||
* Returns true if the received stanza should not be replied. Use
|
||||
* {@link MultipleRecipientManager#reply(org.jivesoftware.smack.XMPPConnection, org.jivesoftware.smack.packet.Message, org.jivesoftware.smack.packet.Message)}
|
||||
* to send replies.
|
||||
* to send replies.
|
||||
*
|
||||
* @return true if the received stanza should not be replied.
|
||||
*/
|
||||
|
|
|
@ -68,8 +68,8 @@ public class MultipleRecipientManager {
|
|||
* @throws XMPPErrorException if server does not support XEP-33: Extended Stanza Addressing and
|
||||
* some XEP-33 specific features were requested.
|
||||
* @throws NoResponseException if there was no response from the server.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public static void send(XMPPConnection connection, Stanza packet, Collection<? extends Jid> to,
|
||||
Collection<? extends Jid> cc, Collection<? extends Jid> bcc) throws NoResponseException, XMPPErrorException,
|
||||
|
@ -82,7 +82,7 @@ public class MultipleRecipientManager {
|
|||
* connection. If the server has support for XEP-33 then only one stanza is going to be sent to
|
||||
* the server with the multiple recipient instructions. However, if XEP-33 is not supported by
|
||||
* the server then the client is going to send the stanza to each recipient.
|
||||
*
|
||||
*
|
||||
* @param connection the connection to use to send the packet.
|
||||
* @param packet the stanza to send to the list of recipients.
|
||||
* @param to the collection of JIDs to include in the TO list or <tt>null</tt> if no TO list exists.
|
||||
|
@ -99,8 +99,8 @@ public class MultipleRecipientManager {
|
|||
* @throws NoResponseException if there was no response from the server.
|
||||
* @throws FeatureNotSupportedException if special XEP-33 features where requested, but the
|
||||
* server does not support them.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public static void send(XMPPConnection connection, Stanza packet, Collection<? extends Jid> to, Collection<? extends Jid> cc, Collection<? extends Jid> bcc,
|
||||
Jid replyTo, Jid replyRoom, boolean noReply) throws NoResponseException, XMPPErrorException, FeatureNotSupportedException, NotConnectedException, InterruptedException {
|
||||
|
@ -140,9 +140,9 @@ public class MultipleRecipientManager {
|
|||
* @param connection the connection to use to send the reply.
|
||||
* @param original the previously received stanza that was sent to multiple recipients.
|
||||
* @param reply the new message to send as a reply.
|
||||
* @throws SmackException
|
||||
* @throws XMPPErrorException
|
||||
* @throws InterruptedException
|
||||
* @throws SmackException
|
||||
* @throws XMPPErrorException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public static void reply(XMPPConnection connection, Message original, Message reply)
|
||||
throws SmackException, XMPPErrorException, InterruptedException {
|
||||
|
@ -279,9 +279,9 @@ public class MultipleRecipientManager {
|
|||
* queried.
|
||||
* @return the address of the multiple recipients service or <tt>null</tt> if none was found.
|
||||
* @throws NoResponseException if there was no response from the server.
|
||||
* @throws XMPPErrorException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
private static DomainBareJid getMultipleRecipientServiceAddress(XMPPConnection connection) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(connection);
|
||||
|
|
|
@ -31,10 +31,10 @@ public class AMPDeliverCondition implements AMPExtension.Condition {
|
|||
* Check if server supports deliver condition.
|
||||
* @param connection Smack connection instance
|
||||
* @return true if deliver condition is supported.
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public static boolean isSupported(XMPPConnection connection) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
return AMPManager.isConditionSupported(connection, NAME);
|
||||
|
|
|
@ -36,10 +36,10 @@ public class AMPExpireAtCondition implements AMPExtension.Condition {
|
|||
* Check if server supports expire-at condition.
|
||||
* @param connection Smack connection instance
|
||||
* @return true if expire-at condition is supported.
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public static boolean isSupported(XMPPConnection connection) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
return AMPManager.isConditionSupported(connection, NAME);
|
||||
|
|
|
@ -85,10 +85,10 @@ public class AMPManager {
|
|||
* @param connection active xmpp connection
|
||||
* @param action action to check
|
||||
* @return true if this action is supported.
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public static boolean isActionSupported(XMPPConnection connection, AMPExtension.Action action) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
String featureName = AMPExtension.NAMESPACE + "?action=" + action.toString();
|
||||
|
@ -100,10 +100,10 @@ public class AMPManager {
|
|||
* @param connection active xmpp connection
|
||||
* @param conditionName name of condition to check
|
||||
* @return true if this condition is supported.
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @see AMPDeliverCondition
|
||||
* @see AMPExpireAtCondition
|
||||
* @see AMPMatchResourceCondition
|
||||
|
|
|
@ -31,10 +31,10 @@ public class AMPMatchResourceCondition implements AMPExtension.Condition {
|
|||
* Check if server supports match-resource condition.
|
||||
* @param connection Smack connection instance
|
||||
* @return true if match-resource condition is supported.
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public static boolean isSupported(XMPPConnection connection) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
return AMPManager.isConditionSupported(connection, NAME);
|
||||
|
|
|
@ -38,8 +38,8 @@ public class AMPExtensionProvider extends ExtensionElementProvider<AMPExtension>
|
|||
*
|
||||
* @param parser the XML parser, positioned at the starting element of the extension.
|
||||
* @return a PacketExtension.
|
||||
* @throws IOException
|
||||
* @throws XmlPullParserException
|
||||
* @throws IOException
|
||||
* @throws XmlPullParserException
|
||||
*/
|
||||
@Override
|
||||
public AMPExtension parse(XmlPullParser parser, int initialDepth)
|
||||
|
|
|
@ -23,10 +23,10 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
|
||||
/**
|
||||
* A PacketExtension that implements XEP-0224: Attention
|
||||
*
|
||||
*
|
||||
* This extension is expected to be added to message stanzas of type 'headline.'
|
||||
* Please refer to the XEP for more implementation guidelines.
|
||||
*
|
||||
*
|
||||
* @author Guus der Kinderen, guus.der.kinderen@gmail.com
|
||||
* @see <a
|
||||
* href="http://xmpp.org/extensions/xep-0224.html">XEP-0224: Attention</a>
|
||||
|
@ -45,7 +45,7 @@ public class AttentionExtension implements ExtensionElement {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see org.jivesoftware.smack.packet.PacketExtension#getElementName()
|
||||
*/
|
||||
@Override
|
||||
|
@ -55,7 +55,7 @@ public class AttentionExtension implements ExtensionElement {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see org.jivesoftware.smack.packet.PacketExtension#getNamespace()
|
||||
*/
|
||||
@Override
|
||||
|
@ -65,7 +65,7 @@ public class AttentionExtension implements ExtensionElement {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see org.jivesoftware.smack.packet.PacketExtension#toXML()
|
||||
*/
|
||||
@Override
|
||||
|
@ -81,7 +81,7 @@ public class AttentionExtension implements ExtensionElement {
|
|||
* Attention elements have no state/information other than the element name
|
||||
* and namespace, this implementation simply returns new instances of
|
||||
* {@link AttentionExtension}.
|
||||
*
|
||||
*
|
||||
* @author Guus der Kinderen, guus.der.kinderen@gmail.com
|
||||
s */
|
||||
public static class Provider extends ExtensionElementProvider<AttentionExtension> {
|
||||
|
|
|
@ -46,7 +46,7 @@ import org.jxmpp.jid.Jid;
|
|||
|
||||
/**
|
||||
* Blocking command manager class.
|
||||
*
|
||||
*
|
||||
* @author Fernando Ramirez
|
||||
* @author Florian Schmaus
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0191.html">XEP-0191: Blocking
|
||||
|
@ -159,7 +159,7 @@ public final class BlockingCommandManager extends Manager {
|
|||
|
||||
/**
|
||||
* Returns true if Blocking Command is supported by the server.
|
||||
*
|
||||
*
|
||||
* @return true if Blocking Command is supported by the server.
|
||||
* @throws NoResponseException
|
||||
* @throws XMPPErrorException
|
||||
|
@ -173,7 +173,7 @@ public final class BlockingCommandManager extends Manager {
|
|||
|
||||
/**
|
||||
* Returns the block list.
|
||||
*
|
||||
*
|
||||
* @return the blocking list
|
||||
* @throws NoResponseException
|
||||
* @throws XMPPErrorException
|
||||
|
@ -194,7 +194,7 @@ public final class BlockingCommandManager extends Manager {
|
|||
|
||||
/**
|
||||
* Block contacts.
|
||||
*
|
||||
*
|
||||
* @param jids
|
||||
* @throws NoResponseException
|
||||
* @throws XMPPErrorException
|
||||
|
@ -209,7 +209,7 @@ public final class BlockingCommandManager extends Manager {
|
|||
|
||||
/**
|
||||
* Unblock contacts.
|
||||
*
|
||||
*
|
||||
* @param jids
|
||||
* @throws NoResponseException
|
||||
* @throws XMPPErrorException
|
||||
|
@ -224,7 +224,7 @@ public final class BlockingCommandManager extends Manager {
|
|||
|
||||
/**
|
||||
* Unblock all.
|
||||
*
|
||||
*
|
||||
* @throws NoResponseException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NotConnectedException
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.jxmpp.jid.Jid;
|
|||
|
||||
/**
|
||||
* Block contact IQ class.
|
||||
*
|
||||
*
|
||||
* @author Fernando Ramirez
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0191.html">XEP-0191: Blocking
|
||||
* Command</a>
|
||||
|
@ -48,7 +48,7 @@ public class BlockContactsIQ extends IQ {
|
|||
|
||||
/**
|
||||
* Block list IQ constructor.
|
||||
*
|
||||
*
|
||||
* @param jids
|
||||
*/
|
||||
public BlockContactsIQ(List<Jid> jids) {
|
||||
|
@ -59,7 +59,7 @@ public class BlockContactsIQ extends IQ {
|
|||
|
||||
/**
|
||||
* Get the JID.
|
||||
*
|
||||
*
|
||||
* @return the list of JIDs
|
||||
*/
|
||||
public List<Jid> getJids() {
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.jxmpp.jid.Jid;
|
|||
|
||||
/**
|
||||
* Block list IQ class.
|
||||
*
|
||||
*
|
||||
* @author Fernando Ramirez
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0191.html">XEP-0191: Blocking
|
||||
* Command</a>
|
||||
|
@ -49,7 +49,7 @@ public class BlockListIQ extends IQ {
|
|||
|
||||
/**
|
||||
* Block list IQ constructor.
|
||||
*
|
||||
*
|
||||
* @param jids
|
||||
*/
|
||||
public BlockListIQ(List<Jid> jids) {
|
||||
|
@ -70,7 +70,7 @@ public class BlockListIQ extends IQ {
|
|||
|
||||
/**
|
||||
* Get the JIDs as unmodifiable list.
|
||||
*
|
||||
*
|
||||
* @return the blocked JIDs
|
||||
*/
|
||||
public List<Jid> getBlockedJids() {
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.jivesoftware.smackx.blocking.BlockingCommandManager;
|
|||
|
||||
/**
|
||||
* Blocked error extension class.
|
||||
*
|
||||
*
|
||||
* @author Fernando Ramirez
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0191.html">XEP-0191: Blocking
|
||||
* Command</a>
|
||||
|
@ -64,7 +64,7 @@ public class BlockedErrorExtension implements ExtensionElement {
|
|||
* Check if a message contains a BlockedErrorExtension, which means that a
|
||||
* message was blocked because the JID blocked the sender, and that was
|
||||
* reflected back as an error message.
|
||||
*
|
||||
*
|
||||
* @param message
|
||||
* @return true if the message contains a BlockedErrorExtension, false if
|
||||
* not
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.jxmpp.jid.Jid;
|
|||
|
||||
/**
|
||||
* Unblock contact IQ class.
|
||||
*
|
||||
*
|
||||
* @author Fernando Ramirez
|
||||
* @author Florian Schmaus
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0191.html">XEP-0191: Blocking
|
||||
|
@ -49,7 +49,7 @@ public class UnblockContactsIQ extends IQ {
|
|||
|
||||
/**
|
||||
* Unblock contacts IQ constructor.
|
||||
*
|
||||
*
|
||||
* @param jids
|
||||
*/
|
||||
public UnblockContactsIQ(List<Jid> jids) {
|
||||
|
@ -63,7 +63,7 @@ public class UnblockContactsIQ extends IQ {
|
|||
}
|
||||
|
||||
/**
|
||||
* Constructs a new unblock IQ which will unblock <b>all</b> JIDs.
|
||||
* Constructs a new unblock IQ which will unblock <b>all</b> JIDs.
|
||||
*/
|
||||
public UnblockContactsIQ() {
|
||||
this(null);
|
||||
|
@ -71,7 +71,7 @@ public class UnblockContactsIQ extends IQ {
|
|||
|
||||
/**
|
||||
* Get the JIDs. This may return null, which means that all JIDs should be or where unblocked.
|
||||
*
|
||||
*
|
||||
* @return the list of JIDs or <code>null</code>.
|
||||
*/
|
||||
public List<Jid> getJids() {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
/**
|
||||
* Blocking command elements.
|
||||
*
|
||||
*
|
||||
* @author Fernando Ramirez
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0191.html">XEP-0191: Blocking
|
||||
* Command</a>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
/**
|
||||
* Classes and interfaces of Blocking command.
|
||||
*
|
||||
*
|
||||
* @author Fernando Ramirez
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0191.html">XEP-0191: Blocking
|
||||
* Command</a>
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
|
||||
/**
|
||||
* Block contact IQ provider class.
|
||||
*
|
||||
*
|
||||
* @author Fernando Ramirez
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0191.html">XEP-0191: Blocking
|
||||
* Command</a>
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
|
||||
/**
|
||||
* Block list IQ provider class.
|
||||
*
|
||||
*
|
||||
* @author Fernando Ramirez
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0191.html">XEP-0191: Blocking
|
||||
* Command</a>
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
|
||||
/**
|
||||
* Blocked error extension class.
|
||||
*
|
||||
*
|
||||
* @author Fernando Ramirez
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0191.html">XEP-0191: Blocking
|
||||
* Command</a>
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
|
||||
/**
|
||||
* Unblock contact IQ provider class.
|
||||
*
|
||||
*
|
||||
* @author Fernando Ramirez
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0191.html">XEP-0191: Blocking
|
||||
* Command</a>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
/**
|
||||
* Blocking command providers.
|
||||
*
|
||||
*
|
||||
* @author Fernando Ramirez
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0191.html">XEP-0191: Blocking
|
||||
* Command</a>
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.jivesoftware.smack.util.stringencoder.Base64;
|
|||
|
||||
/**
|
||||
* Bits of Binary data class.
|
||||
*
|
||||
*
|
||||
* @author Fernando Ramirez
|
||||
* @author Florian Schmaus
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0231.html">XEP-0231: Bits of
|
||||
|
@ -41,7 +41,7 @@ public class BoBData {
|
|||
|
||||
/**
|
||||
* BoB data constructor.
|
||||
*
|
||||
*
|
||||
* @param type
|
||||
* @param content
|
||||
* @param maxAge
|
||||
|
@ -64,7 +64,7 @@ public class BoBData {
|
|||
|
||||
/**
|
||||
* Get the max age.
|
||||
*
|
||||
*
|
||||
* @return the max age
|
||||
*/
|
||||
public int getMaxAge() {
|
||||
|
@ -73,7 +73,7 @@ public class BoBData {
|
|||
|
||||
/**
|
||||
* Get the type.
|
||||
*
|
||||
*
|
||||
* @return the type
|
||||
*/
|
||||
public String getType() {
|
||||
|
@ -89,7 +89,7 @@ public class BoBData {
|
|||
|
||||
/**
|
||||
* Get the content.
|
||||
*
|
||||
*
|
||||
* @return the content
|
||||
*/
|
||||
public byte[] getContent() {
|
||||
|
@ -99,7 +99,7 @@ public class BoBData {
|
|||
|
||||
/**
|
||||
* Get the content in a Base64 encoded String.
|
||||
*
|
||||
*
|
||||
* @return the content in a Base64 encoded String
|
||||
*/
|
||||
public String getContentBase64Encoded() {
|
||||
|
|
|
@ -20,7 +20,7 @@ import org.jivesoftware.smack.util.StringUtils;
|
|||
|
||||
/**
|
||||
* Bits of Binary hash class.
|
||||
*
|
||||
*
|
||||
* @author Fernando Ramirez
|
||||
* @author Florian Schmaus
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0231.html">XEP-0231: Bits of
|
||||
|
@ -34,7 +34,7 @@ public class BoBHash {
|
|||
|
||||
/**
|
||||
* BoB hash constructor.
|
||||
*
|
||||
*
|
||||
* @param hash
|
||||
* @param hashType
|
||||
*/
|
||||
|
@ -46,7 +46,7 @@ public class BoBHash {
|
|||
|
||||
/**
|
||||
* Get the hash.
|
||||
*
|
||||
*
|
||||
* @return the hash
|
||||
*/
|
||||
public String getHash() {
|
||||
|
@ -55,7 +55,7 @@ public class BoBHash {
|
|||
|
||||
/**
|
||||
* Get the hash type.
|
||||
*
|
||||
*
|
||||
* @return the hash type
|
||||
*/
|
||||
public String getHashType() {
|
||||
|
@ -64,7 +64,7 @@ public class BoBHash {
|
|||
|
||||
/**
|
||||
* BoB hash to src attribute string.
|
||||
*
|
||||
*
|
||||
* @return src attribute string
|
||||
*/
|
||||
public String toSrc() {
|
||||
|
@ -73,7 +73,7 @@ public class BoBHash {
|
|||
|
||||
/**
|
||||
* BoB hash to cid attribute string.
|
||||
*
|
||||
*
|
||||
* @return cid attribute string
|
||||
*/
|
||||
public String getCid() {
|
||||
|
@ -96,7 +96,7 @@ public class BoBHash {
|
|||
|
||||
/**
|
||||
* Get BoB hash from src attribute string.
|
||||
*
|
||||
*
|
||||
* @param src
|
||||
* @return the BoB hash
|
||||
*/
|
||||
|
@ -108,7 +108,7 @@ public class BoBHash {
|
|||
|
||||
/**
|
||||
* Get BoB hash from cid attribute string.
|
||||
*
|
||||
*
|
||||
* @param cid
|
||||
* @return the BoB hash
|
||||
*/
|
||||
|
|
|
@ -44,7 +44,7 @@ import org.jxmpp.util.cache.LruCache;
|
|||
|
||||
/**
|
||||
* Bits of Binary manager class.
|
||||
*
|
||||
*
|
||||
* @author Fernando Ramirez
|
||||
* @author Florian Schmaus
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0231.html">XEP-0231: Bits of
|
||||
|
@ -67,7 +67,7 @@ public final class BoBManager extends Manager {
|
|||
|
||||
/**
|
||||
* Get the singleton instance of BoBManager.
|
||||
*
|
||||
*
|
||||
* @param connection
|
||||
* @return the instance of BoBManager
|
||||
*/
|
||||
|
@ -113,7 +113,7 @@ public final class BoBManager extends Manager {
|
|||
|
||||
/**
|
||||
* Returns true if Bits of Binary is supported by the server.
|
||||
*
|
||||
*
|
||||
* @return true if Bits of Binary is supported by the server.
|
||||
* @throws NoResponseException
|
||||
* @throws XMPPErrorException
|
||||
|
@ -127,7 +127,7 @@ public final class BoBManager extends Manager {
|
|||
|
||||
/**
|
||||
* Request BoB data.
|
||||
*
|
||||
*
|
||||
* @param to
|
||||
* @param bobHash
|
||||
* @return the BoB data
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.jivesoftware.smackx.xhtmlim.packet.XHTMLExtension;
|
|||
|
||||
/**
|
||||
* Bits of Binary extension element.
|
||||
*
|
||||
*
|
||||
* @author Fernando Ramirez
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0231.html">XEP-0231: Bits of
|
||||
* Binary</a>
|
||||
|
@ -38,7 +38,7 @@ public class BoBExtension extends XHTMLExtension {
|
|||
|
||||
/**
|
||||
* Bits of Binary extension constructor.
|
||||
*
|
||||
*
|
||||
* @param bobHash
|
||||
* @param alt
|
||||
* @param paragraph
|
||||
|
@ -51,7 +51,7 @@ public class BoBExtension extends XHTMLExtension {
|
|||
|
||||
/**
|
||||
* Get the BoB hash.
|
||||
*
|
||||
*
|
||||
* @return the BoB hash
|
||||
*/
|
||||
public BoBHash getBoBHash() {
|
||||
|
@ -60,7 +60,7 @@ public class BoBExtension extends XHTMLExtension {
|
|||
|
||||
/**
|
||||
* Get the alt field.
|
||||
*
|
||||
*
|
||||
* @return the alt field
|
||||
*/
|
||||
public String getAlt() {
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.jivesoftware.smackx.bob.BoBManager;
|
|||
|
||||
/**
|
||||
* Bits of Binary IQ class.
|
||||
*
|
||||
*
|
||||
* @author Fernando Ramirez
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0231.html">XEP-0231: Bits of
|
||||
* Binary</a>
|
||||
|
@ -46,7 +46,7 @@ public class BoBIQ extends IQ {
|
|||
|
||||
/**
|
||||
* Bits of Binary IQ constructor.
|
||||
*
|
||||
*
|
||||
* @param bobHash
|
||||
* @param bobData
|
||||
*/
|
||||
|
@ -58,7 +58,7 @@ public class BoBIQ extends IQ {
|
|||
|
||||
/**
|
||||
* Bits of Binary IQ constructor.
|
||||
*
|
||||
*
|
||||
* @param bobHash
|
||||
*/
|
||||
public BoBIQ(BoBHash bobHash) {
|
||||
|
@ -67,7 +67,7 @@ public class BoBIQ extends IQ {
|
|||
|
||||
/**
|
||||
* Get the BoB hash.
|
||||
*
|
||||
*
|
||||
* @return the BoB hash
|
||||
*/
|
||||
public BoBHash getBoBHash() {
|
||||
|
@ -76,7 +76,7 @@ public class BoBIQ extends IQ {
|
|||
|
||||
/**
|
||||
* Get the BoB data.
|
||||
*
|
||||
*
|
||||
* @return the BoB data
|
||||
*/
|
||||
public BoBData getBoBData() {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
/**
|
||||
* Bits of Binary elements.
|
||||
*
|
||||
*
|
||||
* @author Fernando Ramirez
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0231.html">XEP-0231: Bits of
|
||||
* Binary</a>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
/**
|
||||
* Classes and interfaces of XEP-0231: Bits of Binary.
|
||||
*
|
||||
*
|
||||
* @author Fernando Ramirez
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0231.html">XEP-0231: Bits of
|
||||
* Binary</a>
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
|
||||
/**
|
||||
* Bits of Binary IQ provider class.
|
||||
*
|
||||
*
|
||||
* @author Florian Schmaus
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0231.html">XEP-0231: Bits of
|
||||
* Binary</a>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
/**
|
||||
* Bits of Binary providers.
|
||||
*
|
||||
*
|
||||
* @author Fernando Ramirez
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0231.html">XEP-0231: Bits of
|
||||
* Binary</a>
|
||||
|
|
|
@ -87,10 +87,10 @@ public final class BookmarkManager {
|
|||
* Returns all currently bookmarked conferences.
|
||||
*
|
||||
* @return returns all currently bookmarked conferences
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @see BookmarkedConference
|
||||
*/
|
||||
public List<BookmarkedConference> getBookmarkedConferences() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
|
@ -109,8 +109,8 @@ public final class BookmarkManager {
|
|||
* @throws XMPPErrorException thrown when there is an issue retrieving the current bookmarks from
|
||||
* the server.
|
||||
* @throws NoResponseException if there was no response from the server.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void addBookmarkedConference(String name, EntityBareJid jid, boolean isAutoJoin,
|
||||
Resourcepart nickname, String password) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
|
@ -141,8 +141,8 @@ public final class BookmarkManager {
|
|||
* @throws XMPPErrorException thrown when there is a problem with the connection attempting to
|
||||
* retrieve the bookmarks or persist the bookmarks.
|
||||
* @throws NoResponseException if there was no response from the server.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws IllegalArgumentException thrown when the conference being removed is a shared
|
||||
* conference
|
||||
*/
|
||||
|
@ -168,8 +168,8 @@ public final class BookmarkManager {
|
|||
* @return returns an unmodifiable collection of all bookmarked urls.
|
||||
* @throws XMPPErrorException thrown when there is a problem retriving bookmarks from the server.
|
||||
* @throws NoResponseException if there was no response from the server.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public List<BookmarkedURL> getBookmarkedURLs() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
retrieveBookmarks();
|
||||
|
@ -185,8 +185,8 @@ public final class BookmarkManager {
|
|||
* @throws XMPPErrorException thrown when there is an error retriving or saving bookmarks from or to
|
||||
* the server
|
||||
* @throws NoResponseException if there was no response from the server.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void addBookmarkedURL(String URL, String name, boolean isRSS) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
retrieveBookmarks();
|
||||
|
@ -213,8 +213,8 @@ public final class BookmarkManager {
|
|||
* @throws XMPPErrorException thrown if there is an error retriving or saving bookmarks from or to
|
||||
* the server.
|
||||
* @throws NoResponseException if there was no response from the server.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void removeBookmarkedURL(String bookmarkURL) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
retrieveBookmarks();
|
||||
|
|
|
@ -35,14 +35,14 @@ import org.jivesoftware.smackx.bytestreams.socks5.Socks5BytestreamManager;
|
|||
* <p>
|
||||
* {@link Socks5BytestreamListener} or {@link InBandBytestreamListener} provide a more specific
|
||||
* interface of the BytestreamListener.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public interface BytestreamListener {
|
||||
|
||||
/**
|
||||
* This listener is notified if a bytestream request from another user has been received.
|
||||
*
|
||||
*
|
||||
* @param request the incoming bytestream request
|
||||
*/
|
||||
void incomingBytestreamRequest(BytestreamRequest request);
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.jxmpp.jid.Jid;
|
|||
* <p>
|
||||
* There are two implementations of the interface. See {@link Socks5BytestreamManager} and
|
||||
* {@link InBandBytestreamManager}.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public interface BytestreamManager {
|
||||
|
@ -43,14 +43,14 @@ public interface BytestreamManager {
|
|||
* See {@link Socks5BytestreamManager#addIncomingBytestreamListener(BytestreamListener)} and
|
||||
* {@link InBandBytestreamManager#addIncomingBytestreamListener(BytestreamListener)} for further
|
||||
* details.
|
||||
*
|
||||
*
|
||||
* @param listener the listener to register
|
||||
*/
|
||||
void addIncomingBytestreamListener(BytestreamListener listener);
|
||||
|
||||
/**
|
||||
* Removes the given listener from the list of listeners for all incoming bytestream requests.
|
||||
*
|
||||
*
|
||||
* @param listener the listener to remove
|
||||
*/
|
||||
void removeIncomingBytestreamListener(BytestreamListener listener);
|
||||
|
@ -64,7 +64,7 @@ public interface BytestreamManager {
|
|||
* See {@link Socks5BytestreamManager#addIncomingBytestreamListener(BytestreamListener, Jid)}
|
||||
* and {@link InBandBytestreamManager#addIncomingBytestreamListener(BytestreamListener, Jid)}
|
||||
* for further details.
|
||||
*
|
||||
*
|
||||
* @param listener the listener to register
|
||||
* @param initiatorJID the JID of the user that wants to establish a bytestream
|
||||
*/
|
||||
|
@ -72,7 +72,7 @@ public interface BytestreamManager {
|
|||
|
||||
/**
|
||||
* Removes the listener for the given user.
|
||||
*
|
||||
*
|
||||
* @param initiatorJID the JID of the user the listener should be removed
|
||||
*/
|
||||
void removeIncomingBytestreamListener(Jid initiatorJID);
|
||||
|
@ -89,7 +89,7 @@ public interface BytestreamManager {
|
|||
* <p>
|
||||
* See {@link Socks5BytestreamManager#establishSession(Jid)} and
|
||||
* {@link InBandBytestreamManager#establishSession(Jid)} for further details.
|
||||
*
|
||||
*
|
||||
* @param targetJID the JID of the user a bytestream should be established
|
||||
* @return the session to send/receive data to/from the user
|
||||
* @throws XMPPException if an error occurred while establishing the session
|
||||
|
@ -107,7 +107,7 @@ public interface BytestreamManager {
|
|||
* <p>
|
||||
* See {@link Socks5BytestreamManager#establishSession(Jid)} and
|
||||
* {@link InBandBytestreamManager#establishSession(Jid)} for further details.
|
||||
*
|
||||
*
|
||||
* @param targetJID the JID of the user a bytestream should be established
|
||||
* @param sessionID the session ID for the bytestream request
|
||||
* @return the session to send/receive data to/from the user
|
||||
|
|
|
@ -31,41 +31,41 @@ import org.jxmpp.jid.Jid;
|
|||
* <p>
|
||||
* There are two implementations of the interface. See {@link Socks5BytestreamRequest} and
|
||||
* {@link InBandBytestreamRequest}.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public interface BytestreamRequest {
|
||||
|
||||
/**
|
||||
* Returns the sender of the bytestream open request.
|
||||
*
|
||||
*
|
||||
* @return the sender of the bytestream open request
|
||||
*/
|
||||
Jid getFrom();
|
||||
|
||||
/**
|
||||
* Returns the session ID of the bytestream open request.
|
||||
*
|
||||
*
|
||||
* @return the session ID of the bytestream open request
|
||||
*/
|
||||
String getSessionID();
|
||||
|
||||
/**
|
||||
* Accepts the bytestream open request and returns the session to send/receive data.
|
||||
*
|
||||
*
|
||||
* @return the session to send/receive data
|
||||
* @throws XMPPErrorException if an error occurred while accepting the bytestream request
|
||||
* @throws InterruptedException if the thread was interrupted while waiting in a blocking
|
||||
* operation
|
||||
* @throws NoResponseException
|
||||
* @throws SmackException
|
||||
* @throws NoResponseException
|
||||
* @throws SmackException
|
||||
*/
|
||||
BytestreamSession accept() throws InterruptedException, XMPPErrorException, SmackException;
|
||||
|
||||
/**
|
||||
* Rejects the bytestream request by sending a reject error to the initiator.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
void reject() throws NotConnectedException, InterruptedException;
|
||||
|
||||
|
|
|
@ -28,14 +28,14 @@ import org.jivesoftware.smackx.bytestreams.socks5.Socks5BytestreamSession;
|
|||
* <p>
|
||||
* There are two implementations of the interface. See {@link Socks5BytestreamSession} and
|
||||
* {@link InBandBytestreamSession}.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public interface BytestreamSession {
|
||||
|
||||
/**
|
||||
* Returns the InputStream associated with this session to send data.
|
||||
*
|
||||
*
|
||||
* @return the InputStream associated with this session to send data
|
||||
* @throws IOException if an error occurs while retrieving the input stream
|
||||
*/
|
||||
|
@ -43,7 +43,7 @@ public interface BytestreamSession {
|
|||
|
||||
/**
|
||||
* Returns the OutputStream associated with this session to receive data.
|
||||
*
|
||||
*
|
||||
* @return the OutputStream associated with this session to receive data
|
||||
* @throws IOException if an error occurs while retrieving the output stream
|
||||
*/
|
||||
|
@ -54,7 +54,7 @@ public interface BytestreamSession {
|
|||
* <p>
|
||||
* Closing the session will also close the input stream and the output stream associated to this
|
||||
* session.
|
||||
*
|
||||
*
|
||||
* @throws IOException if an error occurs while closing the session
|
||||
*/
|
||||
void close() throws IOException;
|
||||
|
@ -62,7 +62,7 @@ public interface BytestreamSession {
|
|||
/**
|
||||
* Returns the timeout for read operations of the input stream associated with this session. 0
|
||||
* returns implies that the option is disabled (i.e., timeout of infinity). Default is 0.
|
||||
*
|
||||
*
|
||||
* @return the timeout for read operations
|
||||
* @throws IOException if there is an error in the underlying protocol
|
||||
*/
|
||||
|
@ -75,7 +75,7 @@ public interface BytestreamSession {
|
|||
* session is still valid. The option must be enabled prior to entering the blocking operation
|
||||
* to have effect. The timeout must be > 0. A timeout of zero is interpreted as an infinite
|
||||
* timeout. Default is 0.
|
||||
*
|
||||
*
|
||||
* @param timeout the specified timeout, in milliseconds
|
||||
* @throws IOException if there is an error in the underlying protocol
|
||||
*/
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.jivesoftware.smackx.bytestreams.ibb.packet.Close;
|
|||
* If a close request is received it looks if a stored In-Band Bytestream
|
||||
* session exists and closes it. If no session with the given session ID exists
|
||||
* an <item-not-found/> error is returned to the sender.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
class CloseListener extends AbstractIqRequestHandler {
|
||||
|
@ -38,7 +38,7 @@ class CloseListener extends AbstractIqRequestHandler {
|
|||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
*
|
||||
* @param manager the In-Band Bytestream manager
|
||||
*/
|
||||
protected CloseListener(InBandBytestreamManager manager) {
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.jivesoftware.smackx.bytestreams.ibb.packet.DataPacketExtension;
|
|||
* Data packets belonging to a running In-Band Bytestream session are processed
|
||||
* by more specific listeners registered when an {@link InBandBytestreamSession}
|
||||
* is created.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
class DataListener extends AbstractIqRequestHandler {
|
||||
|
@ -45,7 +45,7 @@ class DataListener extends AbstractIqRequestHandler {
|
|||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
*
|
||||
* @param manager the In-Band Bytestream manager
|
||||
*/
|
||||
DataListener(InBandBytestreamManager manager) {
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.jivesoftware.smackx.bytestreams.BytestreamRequest;
|
|||
* {@link InBandBytestreamManager#addIncomingBytestreamListener(BytestreamListener)} and
|
||||
* {@link InBandBytestreamManager#addIncomingBytestreamListener(BytestreamListener, org.jxmpp.jid.Jid)} for
|
||||
* further details.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public abstract class InBandBytestreamListener implements BytestreamListener {
|
||||
|
@ -42,7 +42,7 @@ public abstract class InBandBytestreamListener implements BytestreamListener {
|
|||
/**
|
||||
* This listener is notified if an In-Band Bytestream request from another user has been
|
||||
* received.
|
||||
*
|
||||
*
|
||||
* @param request the incoming In-Band Bytestream request
|
||||
*/
|
||||
public abstract void incomingBytestreamRequest(InBandBytestreamRequest request);
|
||||
|
|
|
@ -79,7 +79,7 @@ import org.jxmpp.jid.Jid;
|
|||
* <p>
|
||||
* If no {@link InBandBytestreamListener}s are registered, all incoming In-Band bytestream requests
|
||||
* will be rejected by returning a <not-acceptable/> error to the initiator.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public final class InBandBytestreamManager extends Manager implements BytestreamManager {
|
||||
|
@ -186,7 +186,7 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
/**
|
||||
* Returns the InBandBytestreamManager to handle In-Band Bytestreams for a given
|
||||
* {@link XMPPConnection}.
|
||||
*
|
||||
*
|
||||
* @param connection the XMPP connection
|
||||
* @return the InBandBytestreamManager for the given XMPP connection
|
||||
*/
|
||||
|
@ -203,7 +203,7 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
*
|
||||
* @param connection the XMPP connection
|
||||
*/
|
||||
private InBandBytestreamManager(XMPPConnection connection) {
|
||||
|
@ -233,7 +233,7 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
* Socks5 bytestream requests sent in the context of <a
|
||||
* href="http://xmpp.org/extensions/xep-0096.html">XEP-0096</a> file transfer. (See
|
||||
* {@link FileTransferManager})
|
||||
*
|
||||
*
|
||||
* @param listener the listener to register
|
||||
*/
|
||||
@Override
|
||||
|
@ -244,7 +244,7 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
/**
|
||||
* Removes the given listener from the list of listeners for all incoming In-Band Bytestream
|
||||
* requests.
|
||||
*
|
||||
*
|
||||
* @param listener the listener to remove
|
||||
*/
|
||||
@Override
|
||||
|
@ -266,7 +266,7 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
* Socks5 bytestream requests sent in the context of <a
|
||||
* href="http://xmpp.org/extensions/xep-0096.html">XEP-0096</a> file transfer. (See
|
||||
* {@link FileTransferManager})
|
||||
*
|
||||
*
|
||||
* @param listener the listener to register
|
||||
* @param initiatorJID the JID of the user that wants to establish an In-Band Bytestream
|
||||
*/
|
||||
|
@ -277,7 +277,7 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
|
||||
/**
|
||||
* Removes the listener for the given user.
|
||||
*
|
||||
*
|
||||
* @param initiatorJID the JID of the user the listener should be removed
|
||||
*/
|
||||
@Override
|
||||
|
@ -292,7 +292,7 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
* <p>
|
||||
* This method should be used if you are awaiting an In-Band Bytestream request as a reply to
|
||||
* another stanza (e.g. file transfer).
|
||||
*
|
||||
*
|
||||
* @param sessionID to be ignored
|
||||
*/
|
||||
public void ignoreBytestreamRequestOnce(String sessionID) {
|
||||
|
@ -305,7 +305,7 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
* <p>
|
||||
* The recommended default block size is 4096 bytes. See <a
|
||||
* href="http://xmpp.org/extensions/xep-0047.html#usage">XEP-0047</a> Section 5.
|
||||
*
|
||||
*
|
||||
* @return the default block size
|
||||
*/
|
||||
public int getDefaultBlockSize() {
|
||||
|
@ -319,7 +319,7 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
* The default block size must be between 1 and 65535 bytes. The recommended default block size
|
||||
* is 4096 bytes. See <a href="http://xmpp.org/extensions/xep-0047.html#usage">XEP-0047</a>
|
||||
* Section 5.
|
||||
*
|
||||
*
|
||||
* @param defaultBlockSize the default block size to set
|
||||
*/
|
||||
public void setDefaultBlockSize(int defaultBlockSize) {
|
||||
|
@ -338,7 +338,7 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
* block size.
|
||||
* <p>
|
||||
* The default maximum block size is 65535 bytes.
|
||||
*
|
||||
*
|
||||
* @return the maximum block size
|
||||
*/
|
||||
public int getMaximumBlockSize() {
|
||||
|
@ -353,7 +353,7 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
* Incoming In-Band Bytestream open request will be rejected with an
|
||||
* <resource-constraint/> error if the block size is greater then the maximum allowed
|
||||
* block size.
|
||||
*
|
||||
*
|
||||
* @param maximumBlockSize the maximum block size to set
|
||||
*/
|
||||
public void setMaximumBlockSize(int maximumBlockSize) {
|
||||
|
@ -369,7 +369,7 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
* <p>
|
||||
* Default is {@link StanzaType#IQ}. See <a
|
||||
* href="http://xmpp.org/extensions/xep-0047.html#message">XEP-0047</a> Section 4.
|
||||
*
|
||||
*
|
||||
* @return the stanza used to send data packets
|
||||
*/
|
||||
public StanzaType getStanza() {
|
||||
|
@ -381,7 +381,7 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
* <p>
|
||||
* The use of {@link StanzaType#IQ} is recommended. See <a
|
||||
* href="http://xmpp.org/extensions/xep-0047.html#message">XEP-0047</a> Section 4.
|
||||
*
|
||||
*
|
||||
* @param stanza the stanza to set
|
||||
*/
|
||||
public void setStanza(StanzaType stanza) {
|
||||
|
@ -398,13 +398,13 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
* <p>
|
||||
* To establish an In-Band Bytestream after negotiation the kind of data to be sent (e.g. file
|
||||
* transfer) use {@link #establishSession(Jid, String)}.
|
||||
*
|
||||
*
|
||||
* @param targetJID the JID of the user an In-Band Bytestream should be established
|
||||
* @return the session to send/receive data to/from the user
|
||||
* @throws XMPPException if the user doesn't support or accept in-band bytestreams, or if the
|
||||
* user prefers smaller block sizes
|
||||
* @throws SmackException if there was no response from the server.
|
||||
* @throws InterruptedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Override
|
||||
public InBandBytestreamSession establishSession(Jid targetJID) throws XMPPException, SmackException, InterruptedException {
|
||||
|
@ -415,15 +415,15 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
/**
|
||||
* Establishes an In-Band Bytestream with the given user using the given session ID and returns
|
||||
* the session to send/receive data to/from the user.
|
||||
*
|
||||
*
|
||||
* @param targetJID the JID of the user an In-Band Bytestream should be established
|
||||
* @param sessionID the session ID for the In-Band Bytestream request
|
||||
* @return the session to send/receive data to/from the user
|
||||
* @throws XMPPErrorException if the user doesn't support or accept in-band bytestreams, or if the
|
||||
* user prefers smaller block sizes
|
||||
* @throws NoResponseException if there was no response from the server.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Override
|
||||
public InBandBytestreamSession establishSession(Jid targetJID, String sessionID)
|
||||
|
@ -446,10 +446,10 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
/**
|
||||
* Responses to the given IQ packet's sender with an XMPP error that an In-Band Bytestream is
|
||||
* not accepted.
|
||||
*
|
||||
*
|
||||
* @param request IQ stanza that should be answered with a not-acceptable error
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
protected void replyRejectPacket(IQ request) throws NotConnectedException, InterruptedException {
|
||||
IQ error = IQ.createErrorResponse(request, StanzaError.Condition.not_acceptable);
|
||||
|
@ -459,10 +459,10 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
/**
|
||||
* Responses to the given IQ packet's sender with an XMPP error that an In-Band Bytestream open
|
||||
* request is rejected because its block size is greater than the maximum allowed block size.
|
||||
*
|
||||
*
|
||||
* @param request IQ stanza that should be answered with a resource-constraint error
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
protected void replyResourceConstraintPacket(IQ request) throws NotConnectedException, InterruptedException {
|
||||
IQ error = IQ.createErrorResponse(request, StanzaError.Condition.resource_constraint);
|
||||
|
@ -472,10 +472,10 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
/**
|
||||
* Responses to the given IQ packet's sender with an XMPP error that an In-Band Bytestream
|
||||
* session could not be found.
|
||||
*
|
||||
*
|
||||
* @param request IQ stanza that should be answered with a item-not-found error
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
protected void replyItemNotFoundPacket(IQ request) throws NotConnectedException, InterruptedException {
|
||||
IQ error = IQ.createErrorResponse(request, StanzaError.Condition.item_not_found);
|
||||
|
@ -484,7 +484,7 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
|
||||
/**
|
||||
* Returns a new unique session ID.
|
||||
*
|
||||
*
|
||||
* @return a new unique session ID
|
||||
*/
|
||||
private static String getNextSessionID() {
|
||||
|
@ -496,7 +496,7 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
|
||||
/**
|
||||
* Returns the XMPP connection.
|
||||
*
|
||||
*
|
||||
* @return the XMPP connection
|
||||
*/
|
||||
protected XMPPConnection getConnection() {
|
||||
|
@ -506,7 +506,7 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
/**
|
||||
* Returns the {@link InBandBytestreamListener} that should be informed if a In-Band Bytestream
|
||||
* request from the given initiator JID is received.
|
||||
*
|
||||
*
|
||||
* @param initiator the initiator's JID
|
||||
* @return the listener
|
||||
*/
|
||||
|
@ -517,7 +517,7 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
/**
|
||||
* Returns a list of {@link InBandBytestreamListener} that are informed if there are no
|
||||
* listeners for a specific initiator.
|
||||
*
|
||||
*
|
||||
* @return list of listeners
|
||||
*/
|
||||
protected List<BytestreamListener> getAllRequestListeners() {
|
||||
|
@ -526,7 +526,7 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
|
||||
/**
|
||||
* Returns the sessions map.
|
||||
*
|
||||
*
|
||||
* @return the sessions map
|
||||
*/
|
||||
protected Map<String, InBandBytestreamSession> getSessions() {
|
||||
|
@ -535,7 +535,7 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
|||
|
||||
/**
|
||||
* Returns the list of session IDs that should be ignored by the InitialtionListener
|
||||
*
|
||||
*
|
||||
* @return list of session IDs
|
||||
*/
|
||||
protected List<String> getIgnoredBytestreamRequests() {
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.jxmpp.jid.Jid;
|
|||
|
||||
/**
|
||||
* InBandBytestreamRequest class handles incoming In-Band Bytestream requests.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class InBandBytestreamRequest implements BytestreamRequest {
|
||||
|
@ -49,7 +49,7 @@ public class InBandBytestreamRequest implements BytestreamRequest {
|
|||
|
||||
/**
|
||||
* Returns the sender of the In-Band Bytestream open request.
|
||||
*
|
||||
*
|
||||
* @return the sender of the In-Band Bytestream open request
|
||||
*/
|
||||
@Override
|
||||
|
@ -59,7 +59,7 @@ public class InBandBytestreamRequest implements BytestreamRequest {
|
|||
|
||||
/**
|
||||
* Returns the session ID of the In-Band Bytestream open request.
|
||||
*
|
||||
*
|
||||
* @return the session ID of the In-Band Bytestream open request
|
||||
*/
|
||||
@Override
|
||||
|
@ -70,10 +70,10 @@ public class InBandBytestreamRequest implements BytestreamRequest {
|
|||
/**
|
||||
* Accepts the In-Band Bytestream open request and returns the session to
|
||||
* send/receive data.
|
||||
*
|
||||
*
|
||||
* @return the session to send/receive data
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Override
|
||||
public InBandBytestreamSession accept() throws NotConnectedException, InterruptedException {
|
||||
|
@ -94,8 +94,8 @@ public class InBandBytestreamRequest implements BytestreamRequest {
|
|||
/**
|
||||
* Rejects the In-Band Bytestream request by sending a reject error to the
|
||||
* initiator.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Override
|
||||
public void reject() throws NotConnectedException, InterruptedException {
|
||||
|
|
|
@ -55,7 +55,7 @@ import org.jxmpp.jid.Jid;
|
|||
* closed individually the session will be closed automatically once the second stream is closed.
|
||||
* Use the {@link #setCloseBothStreamsEnabled(boolean)} method if both streams should be closed
|
||||
* automatically if one of them is closed.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class InBandBytestreamSession implements BytestreamSession {
|
||||
|
@ -87,7 +87,7 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
*
|
||||
* @param connection the XMPP connection
|
||||
* @param byteStreamRequest the In-Band Bytestream open request for this session
|
||||
* @param remoteJID JID of the remote peer
|
||||
|
@ -138,7 +138,7 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
/**
|
||||
* Returns whether both streams should be closed automatically if one of the streams is closed.
|
||||
* Default is <code>false</code>.
|
||||
*
|
||||
*
|
||||
* @return <code>true</code> if both streams will be closed if one of the streams is closed,
|
||||
* <code>false</code> if both streams can be closed independently.
|
||||
*/
|
||||
|
@ -149,7 +149,7 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
/**
|
||||
* Sets whether both streams should be closed automatically if one of the streams is closed.
|
||||
* Default is <code>false</code>.
|
||||
*
|
||||
*
|
||||
* @param closeBothStreamsEnabled <code>true</code> if both streams should be closed if one of
|
||||
* the streams is closed, <code>false</code> if both streams should be closed
|
||||
* independently
|
||||
|
@ -166,10 +166,10 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
|
||||
/**
|
||||
* This method is invoked if a request to close the In-Band Bytestream has been received.
|
||||
*
|
||||
*
|
||||
* @param closeRequest the close request from the remote peer
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
protected void closeByPeer(Close closeRequest) throws NotConnectedException, InterruptedException {
|
||||
|
||||
|
@ -282,14 +282,14 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
|
||||
/**
|
||||
* Returns the stanza listener that processes In-Band Bytestream data packets.
|
||||
*
|
||||
*
|
||||
* @return the data stanza listener
|
||||
*/
|
||||
protected abstract StanzaListener getDataPacketListener();
|
||||
|
||||
/**
|
||||
* Returns the stanza filter that accepts In-Band Bytestream data packets.
|
||||
*
|
||||
*
|
||||
* @return the data stanza filter
|
||||
*/
|
||||
protected abstract StanzaFilter getDataPacketFilter();
|
||||
|
@ -352,7 +352,7 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
/**
|
||||
* This method blocks until a data stanza is received, the stream is closed or the current
|
||||
* thread is interrupted.
|
||||
*
|
||||
*
|
||||
* @return <code>true</code> if data was received, otherwise <code>false</code>
|
||||
* @throws IOException if data packets are out of sequence
|
||||
*/
|
||||
|
@ -406,7 +406,7 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
|
||||
/**
|
||||
* Checks if this stream is closed and throws an IOException if necessary
|
||||
*
|
||||
*
|
||||
* @throws IOException if stream is closed and no data should be read anymore
|
||||
*/
|
||||
private void checkClosed() throws IOException {
|
||||
|
@ -633,11 +633,11 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
|
||||
/**
|
||||
* Writes the given data stanza to the XMPP stream.
|
||||
*
|
||||
*
|
||||
* @param data the data packet
|
||||
* @throws IOException if an I/O error occurred while sending or if the stream is closed
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
protected abstract void writeToXML(DataPacketExtension data) throws IOException, NotConnectedException, InterruptedException;
|
||||
|
||||
|
@ -695,7 +695,7 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
* Fills the buffer with the given data and sends it over the XMPP stream if the buffers
|
||||
* capacity has been reached. This method is only called from this class so it is assured
|
||||
* that the amount of data to send is <= buffer capacity
|
||||
*
|
||||
*
|
||||
* @param b the data
|
||||
* @param off the data
|
||||
* @param len the number of bytes to write
|
||||
|
@ -771,7 +771,7 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
|
||||
/**
|
||||
* Sets the close flag and optionally flushes the stream.
|
||||
*
|
||||
*
|
||||
* @param flush if <code>true</code> flushes the stream
|
||||
*/
|
||||
protected void closeInternal(boolean flush) {
|
||||
|
@ -848,8 +848,8 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
* Process IQ stanza.
|
||||
* @param data
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotLoggedInException
|
||||
* @throws InterruptedException
|
||||
* @throws NotLoggedInException
|
||||
*/
|
||||
public void processIQPacket(Data data) throws NotConnectedException, InterruptedException, NotLoggedInException {
|
||||
inputStream.dataPacketListener.processStanza(data);
|
||||
|
|
|
@ -40,7 +40,7 @@ import org.jivesoftware.smackx.filetransfer.StreamNegotiator;
|
|||
* All In-Band Bytestream request having a block size greater than the maximum allowed block size
|
||||
* for this connection are rejected with an <resource-constraint/> error. The maximum block
|
||||
* size can be set by invoking {@link InBandBytestreamManager#setMaximumBlockSize(int)}.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
class InitiationListener extends AbstractIqRequestHandler {
|
||||
|
@ -54,7 +54,7 @@ class InitiationListener extends AbstractIqRequestHandler {
|
|||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
*
|
||||
* @param manager the In-Band Bytestream manager
|
||||
*/
|
||||
protected InitiationListener(InBandBytestreamManager manager) {
|
||||
|
|
|
@ -20,7 +20,7 @@ import org.jivesoftware.smack.packet.IQ;
|
|||
|
||||
/**
|
||||
* Represents a request to close an In-Band Bytestream.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class Close extends IQ {
|
||||
|
@ -33,7 +33,7 @@ public class Close extends IQ {
|
|||
|
||||
/**
|
||||
* Creates a new In-Band Bytestream close request packet.
|
||||
*
|
||||
*
|
||||
* @param sessionID unique session ID identifying this In-Band Bytestream
|
||||
*/
|
||||
public Close(String sessionID) {
|
||||
|
@ -47,7 +47,7 @@ public class Close extends IQ {
|
|||
|
||||
/**
|
||||
* Returns the unique session ID identifying this In-Band Bytestream.
|
||||
*
|
||||
*
|
||||
* @return the unique session ID identifying this In-Band Bytestream
|
||||
*/
|
||||
public String getSessionID() {
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.jivesoftware.smack.packet.IQ;
|
|||
/**
|
||||
* Represents a chunk of data sent over an In-Band Bytestream encapsulated in an
|
||||
* IQ stanza.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class Data extends IQ {
|
||||
|
@ -31,7 +31,7 @@ public class Data extends IQ {
|
|||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
*
|
||||
* @param data data stanza extension containing the encoded data
|
||||
*/
|
||||
public Data(DataPacketExtension data) {
|
||||
|
@ -46,7 +46,7 @@ public class Data extends IQ {
|
|||
|
||||
/**
|
||||
* Returns the data stanza extension.
|
||||
*
|
||||
*
|
||||
* @return the data stanza extension
|
||||
*/
|
||||
public DataPacketExtension getDataPacketExtension() {
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.jivesoftware.smack.util.stringencoder.Base64;
|
|||
/**
|
||||
* Represents a chunk of data of an In-Band Bytestream within an IQ stanza or a
|
||||
* message stanza.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class DataPacketExtension implements ExtensionElement {
|
||||
|
@ -52,7 +52,7 @@ public class DataPacketExtension implements ExtensionElement {
|
|||
|
||||
/**
|
||||
* Creates a new In-Band Bytestream data packet.
|
||||
*
|
||||
*
|
||||
* @param sessionID unique session ID identifying this In-Band Bytestream
|
||||
* @param seq sequence of this stanza in regard to the other data packets
|
||||
* @param data the base64 encoded data contained in this packet
|
||||
|
@ -74,7 +74,7 @@ public class DataPacketExtension implements ExtensionElement {
|
|||
|
||||
/**
|
||||
* Returns the unique session ID identifying this In-Band Bytestream.
|
||||
*
|
||||
*
|
||||
* @return the unique session ID identifying this In-Band Bytestream
|
||||
*/
|
||||
public String getSessionID() {
|
||||
|
@ -83,7 +83,7 @@ public class DataPacketExtension implements ExtensionElement {
|
|||
|
||||
/**
|
||||
* Returns the sequence of this stanza in regard to the other data packets.
|
||||
*
|
||||
*
|
||||
* @return the sequence of this stanza in regard to the other data packets.
|
||||
*/
|
||||
public long getSeq() {
|
||||
|
@ -92,7 +92,7 @@ public class DataPacketExtension implements ExtensionElement {
|
|||
|
||||
/**
|
||||
* Returns the data contained in this packet.
|
||||
*
|
||||
*
|
||||
* @return the data contained in this packet.
|
||||
*/
|
||||
public String getData() {
|
||||
|
@ -107,7 +107,7 @@ public class DataPacketExtension implements ExtensionElement {
|
|||
* character(s) of the data. See <a
|
||||
* href="http://xmpp.org/extensions/xep-0047.html#sec">XEP-0047</a> Section
|
||||
* 6.
|
||||
*
|
||||
*
|
||||
* @return the decoded data
|
||||
*/
|
||||
public byte[] getDecodedData() {
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.jivesoftware.smackx.bytestreams.ibb.InBandBytestreamManager.StanzaTyp
|
|||
|
||||
/**
|
||||
* Represents a request to open an In-Band Bytestream.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class Open extends IQ {
|
||||
|
@ -49,7 +49,7 @@ public class Open extends IQ {
|
|||
* 65535. A recommended default value is 4096.
|
||||
* <p>
|
||||
* The data can be sent using IQ stanzas or message stanzas.
|
||||
*
|
||||
*
|
||||
* @param sessionID unique session ID identifying this In-Band Bytestream
|
||||
* @param blockSize block size in which the data will be fragmented
|
||||
* @param stanza stanza type used to encapsulate the data
|
||||
|
@ -77,7 +77,7 @@ public class Open extends IQ {
|
|||
* 65535. A recommended default value is 4096.
|
||||
* <p>
|
||||
* The data will be sent using IQ stanzas.
|
||||
*
|
||||
*
|
||||
* @param sessionID unique session ID identifying this In-Band Bytestream
|
||||
* @param blockSize block size in which the data will be fragmented
|
||||
*/
|
||||
|
@ -87,7 +87,7 @@ public class Open extends IQ {
|
|||
|
||||
/**
|
||||
* Returns the unique session ID identifying this In-Band Bytestream.
|
||||
*
|
||||
*
|
||||
* @return the unique session ID identifying this In-Band Bytestream
|
||||
*/
|
||||
public String getSessionID() {
|
||||
|
@ -96,7 +96,7 @@ public class Open extends IQ {
|
|||
|
||||
/**
|
||||
* Returns the block size in which the data will be fragmented.
|
||||
*
|
||||
*
|
||||
* @return the block size in which the data will be fragmented
|
||||
*/
|
||||
public int getBlockSize() {
|
||||
|
@ -105,7 +105,7 @@ public class Open extends IQ {
|
|||
|
||||
/**
|
||||
* Returns the stanza type used to encapsulate the data.
|
||||
*
|
||||
*
|
||||
* @return the stanza type used to encapsulate the data
|
||||
*/
|
||||
public StanzaType getStanza() {
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
|
||||
/**
|
||||
* Parses a close In-Band Bytestream packet.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class CloseIQProvider extends IQProvider<Close> {
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.xmlpull.v1.XmlPullParserException;
|
|||
/**
|
||||
* Parses an In-Band Bytestream data stanza which can be a stanza extension of
|
||||
* either an IQ stanza or a message stanza.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class DataPacketProvider {
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.xmlpull.v1.XmlPullParserException;
|
|||
|
||||
/**
|
||||
* Parses an In-Band Bytestream open packet.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class OpenIQProvider extends IQProvider<Open> {
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.jivesoftware.smackx.filetransfer.StreamNegotiator;
|
|||
* listeners for a SOCKS5 bytestream request InitiationListener will always refuse the request and
|
||||
* reply with a <not-acceptable/> error (<a
|
||||
* href="http://xmpp.org/extensions/xep-0065.html#usecase-alternate">XEP-0065</a> Section 5.2.A2).
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
final class InitiationListener extends AbstractIqRequestHandler {
|
||||
|
@ -49,7 +49,7 @@ final class InitiationListener extends AbstractIqRequestHandler {
|
|||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
*
|
||||
* @param manager the SOCKS5 Bytestream manager
|
||||
*/
|
||||
protected InitiationListener(Socks5BytestreamManager manager) {
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.jivesoftware.smackx.bytestreams.BytestreamRequest;
|
|||
* {@link Socks5BytestreamManager#addIncomingBytestreamListener(BytestreamListener)} and
|
||||
* {@link Socks5BytestreamManager#addIncomingBytestreamListener(BytestreamListener, org.jxmpp.jid.Jid)} for
|
||||
* further details.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public abstract class Socks5BytestreamListener implements BytestreamListener {
|
||||
|
@ -39,7 +39,7 @@ public abstract class Socks5BytestreamListener implements BytestreamListener {
|
|||
|
||||
/**
|
||||
* This listener is notified if a SOCKS5 Bytestream request from another user has been received.
|
||||
*
|
||||
*
|
||||
* @param request the incoming SOCKS5 Bytestream request
|
||||
*/
|
||||
public abstract void incomingBytestreamRequest(Socks5BytestreamRequest request);
|
||||
|
|
|
@ -88,7 +88,7 @@ import org.jxmpp.jid.Jid;
|
|||
* <p>
|
||||
* If no {@link Socks5BytestreamListener}s are registered, all incoming SOCKS5 Bytestream requests
|
||||
* will be rejected by returning a <not-acceptable/> error to the initiator.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public final class Socks5BytestreamManager extends Manager implements BytestreamManager {
|
||||
|
@ -159,7 +159,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
* {@link XMPPConnection}.
|
||||
* <p>
|
||||
* If no manager exists a new is created and initialized.
|
||||
*
|
||||
*
|
||||
* @param connection the XMPP connection or <code>null</code> if given connection is
|
||||
* <code>null</code>
|
||||
* @return the Socks5BytestreamManager for the given XMPP connection
|
||||
|
@ -178,7 +178,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
|
||||
/**
|
||||
* Private constructor.
|
||||
*
|
||||
*
|
||||
* @param connection the XMPP connection
|
||||
*/
|
||||
private Socks5BytestreamManager(XMPPConnection connection) {
|
||||
|
@ -198,7 +198,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
* bytestream requests sent in the context of <a
|
||||
* href="http://xmpp.org/extensions/xep-0096.html">XEP-0096</a> file transfer. (See
|
||||
* {@link FileTransferManager})
|
||||
*
|
||||
*
|
||||
* @param listener the listener to register
|
||||
*/
|
||||
@Override
|
||||
|
@ -209,7 +209,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
/**
|
||||
* Removes the given listener from the list of listeners for all incoming SOCKS5 Bytestream
|
||||
* requests.
|
||||
*
|
||||
*
|
||||
* @param listener the listener to remove
|
||||
*/
|
||||
@Override
|
||||
|
@ -231,7 +231,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
* bytestream requests sent in the context of <a
|
||||
* href="http://xmpp.org/extensions/xep-0096.html">XEP-0096</a> file transfer. (See
|
||||
* {@link FileTransferManager})
|
||||
*
|
||||
*
|
||||
* @param listener the listener to register
|
||||
* @param initiatorJID the JID of the user that wants to establish a SOCKS5 Bytestream
|
||||
*/
|
||||
|
@ -242,7 +242,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
|
||||
/**
|
||||
* Removes the listener for the given user.
|
||||
*
|
||||
*
|
||||
* @param initiatorJID the JID of the user the listener should be removed
|
||||
*/
|
||||
@Override
|
||||
|
@ -257,7 +257,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
* <p>
|
||||
* This method should be used if you are awaiting a SOCKS5 Bytestream request as a reply to
|
||||
* another stanza (e.g. file transfer).
|
||||
*
|
||||
*
|
||||
* @param sessionID to be ignored
|
||||
*/
|
||||
public void ignoreBytestreamRequestOnce(String sessionID) {
|
||||
|
@ -310,7 +310,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
/**
|
||||
* Returns the timeout to wait for the response to the SOCKS5 Bytestream initialization request.
|
||||
* Default is 10000ms.
|
||||
*
|
||||
*
|
||||
* @return the timeout to wait for the response to the SOCKS5 Bytestream initialization request
|
||||
*/
|
||||
public int getTargetResponseTimeout() {
|
||||
|
@ -323,7 +323,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
/**
|
||||
* Sets the timeout to wait for the response to the SOCKS5 Bytestream initialization request.
|
||||
* Default is 10000ms.
|
||||
*
|
||||
*
|
||||
* @param targetResponseTimeout the timeout to set
|
||||
*/
|
||||
public void setTargetResponseTimeout(int targetResponseTimeout) {
|
||||
|
@ -333,7 +333,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
/**
|
||||
* Returns the timeout for connecting to the SOCKS5 proxy selected by the target. Default is
|
||||
* 10000ms.
|
||||
*
|
||||
*
|
||||
* @return the timeout for connecting to the SOCKS5 proxy selected by the target
|
||||
*/
|
||||
public int getProxyConnectionTimeout() {
|
||||
|
@ -346,7 +346,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
/**
|
||||
* Sets the timeout for connecting to the SOCKS5 proxy selected by the target. Default is
|
||||
* 10000ms.
|
||||
*
|
||||
*
|
||||
* @param proxyConnectionTimeout the timeout to set
|
||||
*/
|
||||
public void setProxyConnectionTimeout(int proxyConnectionTimeout) {
|
||||
|
@ -356,7 +356,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
/**
|
||||
* Returns if the prioritization of the last working SOCKS5 proxy on successive SOCKS5
|
||||
* Bytestream connections is enabled. Default is <code>true</code>.
|
||||
*
|
||||
*
|
||||
* @return <code>true</code> if prioritization is enabled, <code>false</code> otherwise
|
||||
*/
|
||||
public boolean isProxyPrioritizationEnabled() {
|
||||
|
@ -366,7 +366,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
/**
|
||||
* Enable/disable the prioritization of the last working SOCKS5 proxy on successive SOCKS5
|
||||
* Bytestream connections.
|
||||
*
|
||||
*
|
||||
* @param proxyPrioritizationEnabled enable/disable the prioritization of the last working
|
||||
* SOCKS5 proxy
|
||||
*/
|
||||
|
@ -384,7 +384,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
* <p>
|
||||
* To establish a SOCKS5 Bytestream after negotiation the kind of data to be sent (e.g. file
|
||||
* transfer) use {@link #establishSession(Jid, String)}.
|
||||
*
|
||||
*
|
||||
* @param targetJID the JID of the user a SOCKS5 Bytestream should be established
|
||||
* @return the Socket to send/receive data to/from the user
|
||||
* @throws XMPPException if the user doesn't support or accept SOCKS5 Bytestreams, if no Socks5
|
||||
|
@ -403,14 +403,14 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
/**
|
||||
* Establishes a SOCKS5 Bytestream with the given user using the given session ID and returns
|
||||
* the Socket to send/receive data to/from the user.
|
||||
*
|
||||
*
|
||||
* @param targetJID the JID of the user a SOCKS5 Bytestream should be established
|
||||
* @param sessionID the session ID for the SOCKS5 Bytestream request
|
||||
* @return the Socket to send/receive data to/from the user
|
||||
* @throws IOException if the bytestream could not be established
|
||||
* @throws InterruptedException if the current thread was interrupted while waiting
|
||||
* @throws SmackException if the target does not support SOCKS5.
|
||||
* @throws XMPPException
|
||||
* @throws XMPPException
|
||||
*/
|
||||
@Override
|
||||
public Socks5BytestreamSession establishSession(Jid targetJID, String sessionID)
|
||||
|
@ -512,14 +512,14 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
|
||||
/**
|
||||
* Returns <code>true</code> if the given target JID supports feature SOCKS5 Bytestream.
|
||||
*
|
||||
*
|
||||
* @param targetJID the target JID
|
||||
* @return <code>true</code> if the given target JID supports feature SOCKS5 Bytestream
|
||||
* otherwise <code>false</code>
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
private boolean supportsSocks5(Jid targetJID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
return ServiceDiscoveryManager.getInstanceFor(connection()).supportsFeature(targetJID, Bytestream.NAMESPACE);
|
||||
|
@ -528,12 +528,12 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
/**
|
||||
* Returns a list of JIDs of SOCKS5 proxies by querying the XMPP server. The SOCKS5 proxies are
|
||||
* in the same order as returned by the XMPP server.
|
||||
*
|
||||
*
|
||||
* @return list of JIDs of SOCKS5 proxies
|
||||
* @throws XMPPErrorException if there was an error querying the XMPP server for SOCKS5 proxies
|
||||
* @throws NoResponseException if there was no response from the server.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public List<Jid> determineProxies() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
XMPPConnection connection = connection();
|
||||
|
@ -580,7 +580,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
* SOCKS5 proxy JIDs. The order of the returned list is the same as the given list of JIDs
|
||||
* excluding all SOCKS5 proxies who's network settings could not be determined. If a local
|
||||
* SOCKS5 proxy is running it will be the first item in the list returned.
|
||||
*
|
||||
*
|
||||
* @param proxies a list of SOCKS5 proxy JIDs
|
||||
* @return a list of stream hosts containing the IP address an the port
|
||||
*/
|
||||
|
@ -613,7 +613,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
|
||||
/**
|
||||
* Returns a IQ stanza to query a SOCKS5 proxy its network settings.
|
||||
*
|
||||
*
|
||||
* @param proxy the proxy to query
|
||||
* @return IQ stanza to query a SOCKS5 proxy its network settings
|
||||
*/
|
||||
|
@ -627,7 +627,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
/**
|
||||
* Returns the stream host information of the local SOCKS5 proxy containing the IP address and
|
||||
* the port or null if local SOCKS5 proxy is not running.
|
||||
*
|
||||
*
|
||||
* @return the stream host information of the local SOCKS5 proxy or null if local SOCKS5 proxy
|
||||
* is not running
|
||||
*/
|
||||
|
@ -666,7 +666,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
/**
|
||||
* Returns a SOCKS5 Bytestream initialization request stanza with the given session ID
|
||||
* containing the given stream hosts for the given target JID.
|
||||
*
|
||||
*
|
||||
* @param sessionID the session ID for the SOCKS5 Bytestream
|
||||
* @param targetJID the target JID of SOCKS5 Bytestream request
|
||||
* @param streamHosts a list of SOCKS5 proxies the target should connect to
|
||||
|
@ -693,10 +693,10 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
* <p>
|
||||
* Specified in XEP-65 5.3.1 (Example 13)
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @param packet Stanza that should be answered with a not-acceptable error
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
protected void replyRejectPacket(IQ packet) throws NotConnectedException, InterruptedException {
|
||||
StanzaError.Builder xmppError = StanzaError.getBuilder(StanzaError.Condition.not_acceptable);
|
||||
|
@ -726,7 +726,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
|
||||
/**
|
||||
* Returns a new unique session ID.
|
||||
*
|
||||
*
|
||||
* @return a new unique session ID
|
||||
*/
|
||||
private static String getNextSessionID() {
|
||||
|
@ -738,7 +738,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
|
||||
/**
|
||||
* Returns the XMPP connection.
|
||||
*
|
||||
*
|
||||
* @return the XMPP connection
|
||||
*/
|
||||
protected XMPPConnection getConnection() {
|
||||
|
@ -748,7 +748,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
/**
|
||||
* Returns the {@link BytestreamListener} that should be informed if a SOCKS5 Bytestream request
|
||||
* from the given initiator JID is received.
|
||||
*
|
||||
*
|
||||
* @param initiator the initiator's JID
|
||||
* @return the listener
|
||||
*/
|
||||
|
@ -759,7 +759,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
/**
|
||||
* Returns a list of {@link BytestreamListener} that are informed if there are no listeners for
|
||||
* a specific initiator.
|
||||
*
|
||||
*
|
||||
* @return list of listeners
|
||||
*/
|
||||
protected List<BytestreamListener> getAllRequestListeners() {
|
||||
|
@ -768,7 +768,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
|
||||
/**
|
||||
* Returns the list of session IDs that should be ignored by the InitialtionListener
|
||||
*
|
||||
*
|
||||
* @return list of session IDs
|
||||
*/
|
||||
protected List<String> getIgnoredBytestreamRequests() {
|
||||
|
|
|
@ -38,7 +38,7 @@ import org.jxmpp.util.cache.ExpirationCache;
|
|||
|
||||
/**
|
||||
* Socks5BytestreamRequest class handles incoming SOCKS5 Bytestream requests.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class Socks5BytestreamRequest implements BytestreamRequest {
|
||||
|
@ -76,7 +76,7 @@ public class Socks5BytestreamRequest implements BytestreamRequest {
|
|||
* Returns the number of connection failures it takes for a particular SOCKS5 proxy to be
|
||||
* blacklisted. When a proxy is blacklisted no more connection attempts will be made to it for a
|
||||
* period of 2 hours. Default is 2.
|
||||
*
|
||||
*
|
||||
* @return the number of connection failures it takes for a particular SOCKS5 proxy to be
|
||||
* blacklisted
|
||||
*/
|
||||
|
@ -90,7 +90,7 @@ public class Socks5BytestreamRequest implements BytestreamRequest {
|
|||
* period of 2 hours. Default is 2.
|
||||
* <p>
|
||||
* Setting the connection failure threshold to zero disables the blacklisting.
|
||||
*
|
||||
*
|
||||
* @param connectFailureThreshold the number of connection failures it takes for a particular
|
||||
* SOCKS5 proxy to be blacklisted
|
||||
*/
|
||||
|
@ -100,7 +100,7 @@ public class Socks5BytestreamRequest implements BytestreamRequest {
|
|||
|
||||
/**
|
||||
* Creates a new Socks5BytestreamRequest.
|
||||
*
|
||||
*
|
||||
* @param manager the SOCKS5 Bytestream manager
|
||||
* @param bytestreamRequest the SOCKS5 Bytestream initialization packet
|
||||
*/
|
||||
|
@ -118,7 +118,7 @@ public class Socks5BytestreamRequest implements BytestreamRequest {
|
|||
* <p>
|
||||
* You can set the minimum timeout for establishing a connection to one SOCKS5 proxy by invoking
|
||||
* {@link #setMinimumConnectTimeout(int)}.
|
||||
*
|
||||
*
|
||||
* @return the maximum timeout to connect to SOCKS5 proxies
|
||||
*/
|
||||
public int getTotalConnectTimeout() {
|
||||
|
@ -137,7 +137,7 @@ public class Socks5BytestreamRequest implements BytestreamRequest {
|
|||
* <p>
|
||||
* You can set the minimum timeout for establishing a connection to one SOCKS5 proxy by invoking
|
||||
* {@link #setMinimumConnectTimeout(int)}.
|
||||
*
|
||||
*
|
||||
* @param totalConnectTimeout the maximum timeout to connect to SOCKS5 proxies
|
||||
*/
|
||||
public void setTotalConnectTimeout(int totalConnectTimeout) {
|
||||
|
@ -147,7 +147,7 @@ public class Socks5BytestreamRequest implements BytestreamRequest {
|
|||
/**
|
||||
* Returns the timeout to connect to one SOCKS5 proxy while accepting the SOCKS5 Bytestream
|
||||
* request. Default is 2000ms.
|
||||
*
|
||||
*
|
||||
* @return the timeout to connect to one SOCKS5 proxy
|
||||
*/
|
||||
public int getMinimumConnectTimeout() {
|
||||
|
@ -160,7 +160,7 @@ public class Socks5BytestreamRequest implements BytestreamRequest {
|
|||
/**
|
||||
* Sets the timeout to connect to one SOCKS5 proxy while accepting the SOCKS5 Bytestream
|
||||
* request. Default is 2000ms.
|
||||
*
|
||||
*
|
||||
* @param minimumConnectTimeout the timeout to connect to one SOCKS5 proxy
|
||||
*/
|
||||
public void setMinimumConnectTimeout(int minimumConnectTimeout) {
|
||||
|
@ -169,7 +169,7 @@ public class Socks5BytestreamRequest implements BytestreamRequest {
|
|||
|
||||
/**
|
||||
* Returns the sender of the SOCKS5 Bytestream initialization request.
|
||||
*
|
||||
*
|
||||
* @return the sender of the SOCKS5 Bytestream initialization request.
|
||||
*/
|
||||
@Override
|
||||
|
@ -179,7 +179,7 @@ public class Socks5BytestreamRequest implements BytestreamRequest {
|
|||
|
||||
/**
|
||||
* Returns the session ID of the SOCKS5 Bytestream initialization request.
|
||||
*
|
||||
*
|
||||
* @return the session ID of the SOCKS5 Bytestream initialization request.
|
||||
*/
|
||||
@Override
|
||||
|
@ -193,11 +193,11 @@ public class Socks5BytestreamRequest implements BytestreamRequest {
|
|||
* <p>
|
||||
* Before accepting the SOCKS5 Bytestream request you can set timeouts by invoking
|
||||
* {@link #setTotalConnectTimeout(int)} and {@link #setMinimumConnectTimeout(int)}.
|
||||
*
|
||||
*
|
||||
* @return the socket to send/receive data
|
||||
* @throws InterruptedException if the current thread was interrupted while waiting
|
||||
* @throws XMPPErrorException
|
||||
* @throws SmackException
|
||||
* @throws XMPPErrorException
|
||||
* @throws SmackException
|
||||
*/
|
||||
@Override
|
||||
public Socks5BytestreamSession accept() throws InterruptedException, XMPPErrorException, SmackException {
|
||||
|
@ -266,8 +266,8 @@ public class Socks5BytestreamRequest implements BytestreamRequest {
|
|||
|
||||
/**
|
||||
* Rejects the SOCKS5 Bytestream request by sending a reject error to the initiator.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Override
|
||||
public void reject() throws NotConnectedException, InterruptedException {
|
||||
|
@ -277,9 +277,9 @@ public class Socks5BytestreamRequest implements BytestreamRequest {
|
|||
/**
|
||||
* Cancels the SOCKS5 Bytestream request by sending an error to the initiator and building a
|
||||
* XMPP exception.
|
||||
* @throws XMPPErrorException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
private void cancelRequest() throws XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
String errorMessage = "Could not establish socket with any provided host";
|
||||
|
@ -291,7 +291,7 @@ public class Socks5BytestreamRequest implements BytestreamRequest {
|
|||
|
||||
/**
|
||||
* Returns the response to the SOCKS5 Bytestream request containing the SOCKS5 proxy used.
|
||||
*
|
||||
*
|
||||
* @param selectedHost the used SOCKS5 proxy
|
||||
* @return the response to the SOCKS5 Bytestream request
|
||||
*/
|
||||
|
@ -306,7 +306,7 @@ public class Socks5BytestreamRequest implements BytestreamRequest {
|
|||
|
||||
/**
|
||||
* Increments the connection failure counter by one for the given address.
|
||||
*
|
||||
*
|
||||
* @param address the address the connection failure counter should be increased
|
||||
*/
|
||||
private static void incrementConnectionFailures(String address) {
|
||||
|
@ -316,7 +316,7 @@ public class Socks5BytestreamRequest implements BytestreamRequest {
|
|||
|
||||
/**
|
||||
* Returns how often the connection to the given address failed.
|
||||
*
|
||||
*
|
||||
* @param address the address
|
||||
* @return number of connection failures
|
||||
*/
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.jivesoftware.smackx.bytestreams.BytestreamSession;
|
|||
|
||||
/**
|
||||
* Socks5BytestreamSession class represents a SOCKS5 Bytestream session.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class Socks5BytestreamSession implements BytestreamSession {
|
||||
|
@ -45,7 +45,7 @@ public class Socks5BytestreamSession implements BytestreamSession {
|
|||
/**
|
||||
* Returns <code>true</code> if the session is established through a direct connection between
|
||||
* the initiator and target, <code>false</code> if the session is mediated over a SOCKS proxy.
|
||||
*
|
||||
*
|
||||
* @return <code>true</code> if session is a direct connection, <code>false</code> if session is
|
||||
* mediated over a SOCKS5 proxy
|
||||
*/
|
||||
|
@ -56,7 +56,7 @@ public class Socks5BytestreamSession implements BytestreamSession {
|
|||
/**
|
||||
* Returns <code>true</code> if the session is mediated over a SOCKS proxy, <code>false</code>
|
||||
* if this session is established through a direct connection between the initiator and target.
|
||||
*
|
||||
*
|
||||
* @return <code>true</code> if session is mediated over a SOCKS5 proxy, <code>false</code> if
|
||||
* session is a direct connection
|
||||
*/
|
||||
|
|
|
@ -41,7 +41,7 @@ import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream.StreamHost;
|
|||
* The SOCKS5 client class handles establishing a connection to a SOCKS5 proxy. Connecting to a
|
||||
* SOCKS5 proxy requires authentication. This implementation only supports the no-authentication
|
||||
* authentication method.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class Socks5Client {
|
||||
|
@ -56,7 +56,7 @@ public class Socks5Client {
|
|||
|
||||
/**
|
||||
* Constructor for a SOCKS5 client.
|
||||
*
|
||||
*
|
||||
* @param streamHost containing network settings of the SOCKS5 proxy
|
||||
* @param digest identifying the SOCKS5 Bytestream
|
||||
*/
|
||||
|
@ -68,14 +68,14 @@ public class Socks5Client {
|
|||
/**
|
||||
* Returns the initialized socket that can be used to transfer data between peers via the SOCKS5
|
||||
* proxy.
|
||||
*
|
||||
*
|
||||
* @param timeout timeout to connect to SOCKS5 proxy in milliseconds
|
||||
* @return socket the initialized socket
|
||||
* @throws IOException if initializing the socket failed due to a network error
|
||||
* @throws TimeoutException if connecting to SOCKS5 proxy timed out
|
||||
* @throws InterruptedException if the current thread was interrupted while waiting
|
||||
* @throws SmackException if the connection to the SOCKS5 proxy failed
|
||||
* @throws XMPPException
|
||||
* @throws XMPPException
|
||||
*/
|
||||
public Socket getSocket(int timeout) throws IOException, InterruptedException,
|
||||
TimeoutException, SmackException, XMPPException {
|
||||
|
@ -139,10 +139,10 @@ public class Socks5Client {
|
|||
* Initializes the connection to the SOCKS5 proxy by negotiating authentication method and
|
||||
* requesting a stream for the given digest. Currently only the no-authentication method is
|
||||
* supported by the Socks5Client.
|
||||
*
|
||||
*
|
||||
* @param socket connected to a SOCKS5 proxy
|
||||
* @throws SmackException
|
||||
* @throws IOException
|
||||
* @throws SmackException
|
||||
* @throws IOException
|
||||
*/
|
||||
protected void establish(Socket socket) throws SmackException, IOException {
|
||||
|
||||
|
@ -196,7 +196,7 @@ public class Socks5Client {
|
|||
* type "domain" and the digest as address.
|
||||
* <p>
|
||||
* (see <a href="http://tools.ietf.org/html/rfc1928">RFC1928</a>)
|
||||
*
|
||||
*
|
||||
* @return SOCKS5 connection request message
|
||||
*/
|
||||
private byte[] createSocks5ConnectRequest() {
|
||||
|
|
|
@ -39,7 +39,7 @@ import org.jxmpp.jid.Jid;
|
|||
* to the local SOCKS5 proxy differs form the regular way to connect to a SOCKS5 proxy. Additionally
|
||||
* a remote SOCKS5 proxy has to be activated by the initiator before data can be transferred between
|
||||
* the peers.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class Socks5ClientForInitiator extends Socks5Client {
|
||||
|
@ -56,7 +56,7 @@ public class Socks5ClientForInitiator extends Socks5Client {
|
|||
|
||||
/**
|
||||
* Creates a new SOCKS5 client for the initiators side.
|
||||
*
|
||||
*
|
||||
* @param streamHost containing network settings of the SOCKS5 proxy
|
||||
* @param digest identifying the SOCKS5 Bytestream
|
||||
* @param connection the XMPP connection
|
||||
|
@ -107,10 +107,10 @@ public class Socks5ClientForInitiator extends Socks5Client {
|
|||
/**
|
||||
* Activates the SOCKS5 Bytestream by sending an XMPP SOCKS5 Bytestream activation stanza to the
|
||||
* SOCKS5 proxy.
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws SmackException if there was no response from the server.
|
||||
*/
|
||||
private void activate() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
|
@ -121,7 +121,7 @@ public class Socks5ClientForInitiator extends Socks5Client {
|
|||
|
||||
/**
|
||||
* Returns a SOCKS5 Bytestream activation packet.
|
||||
*
|
||||
*
|
||||
* @return SOCKS5 Bytestream activation packet
|
||||
*/
|
||||
private Bytestream createStreamHostActivation() {
|
||||
|
|
|
@ -66,7 +66,7 @@ import org.jivesoftware.smack.util.StringUtils;
|
|||
* with other address types</li>
|
||||
* </ul>
|
||||
* (see <a href="http://tools.ietf.org/html/rfc1928">RFC 1928</a>)
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public final class Socks5Proxy {
|
||||
|
@ -131,7 +131,7 @@ public final class Socks5Proxy {
|
|||
|
||||
/**
|
||||
* Returns true if the local Socks5 proxy should be started. Default is true.
|
||||
*
|
||||
*
|
||||
* @return if the local Socks5 proxy should be started
|
||||
*/
|
||||
public static boolean isLocalSocks5ProxyEnabled() {
|
||||
|
@ -140,7 +140,7 @@ public final class Socks5Proxy {
|
|||
|
||||
/**
|
||||
* Sets if the local Socks5 proxy should be started. Default is true.
|
||||
*
|
||||
*
|
||||
* @param localSocks5ProxyEnabled if the local Socks5 proxy should be started
|
||||
*/
|
||||
public static void setLocalSocks5ProxyEnabled(boolean localSocks5ProxyEnabled) {
|
||||
|
@ -149,7 +149,7 @@ public final class Socks5Proxy {
|
|||
|
||||
/**
|
||||
* Return the port of the local Socks5 proxy. Default is 7777.
|
||||
*
|
||||
*
|
||||
* @return the port of the local Socks5 proxy
|
||||
*/
|
||||
public static int getLocalSocks5ProxyPort() {
|
||||
|
@ -159,7 +159,7 @@ public final class Socks5Proxy {
|
|||
/**
|
||||
* Sets the port of the local Socks5 proxy. Default is 7777. If you set the port to a negative
|
||||
* value Smack tries the absolute value and all following until it finds an open port.
|
||||
*
|
||||
*
|
||||
* @param localSocks5ProxyPort the port of the local Socks5 proxy to set
|
||||
*/
|
||||
public static void setLocalSocks5ProxyPort(int localSocks5ProxyPort) {
|
||||
|
@ -171,7 +171,7 @@ public final class Socks5Proxy {
|
|||
|
||||
/**
|
||||
* Returns the local SOCKS5 proxy server.
|
||||
*
|
||||
*
|
||||
* @return the local SOCKS5 proxy server
|
||||
*/
|
||||
public static synchronized Socks5Proxy getSocks5Proxy() {
|
||||
|
@ -260,7 +260,7 @@ public final class Socks5Proxy {
|
|||
* Note that the list of addresses initially contains the address returned by
|
||||
* <code>InetAddress.getLocalHost().getHostAddress()</code>. You can replace the list of
|
||||
* addresses by invoking {@link #replaceLocalAddresses(Collection)}.
|
||||
*
|
||||
*
|
||||
* @param address the local network address to add
|
||||
*/
|
||||
public void addLocalAddress(String address) {
|
||||
|
@ -275,7 +275,7 @@ public final class Socks5Proxy {
|
|||
/**
|
||||
* Removes the given address from the list of local network addresses. This address will then no
|
||||
* longer be used of outgoing SOCKS5 Bytestream requests.
|
||||
*
|
||||
*
|
||||
* @param address the local network address to remove
|
||||
* @return true if the address was removed.
|
||||
*/
|
||||
|
@ -288,7 +288,7 @@ public final class Socks5Proxy {
|
|||
/**
|
||||
* Returns an set of the local network addresses that will be used for streamhost
|
||||
* candidates of outgoing SOCKS5 Bytestream requests.
|
||||
*
|
||||
*
|
||||
* @return set of the local network addresses
|
||||
*/
|
||||
public List<String> getLocalAddresses() {
|
||||
|
@ -304,7 +304,7 @@ public final class Socks5Proxy {
|
|||
* want to define their order. This may be necessary if your application is running on a machine
|
||||
* with multiple network interfaces or if you want to provide your public address in case you
|
||||
* are behind a NAT router.
|
||||
*
|
||||
*
|
||||
* @param addresses the new list of local network addresses
|
||||
*/
|
||||
public void replaceLocalAddresses(Collection<String> addresses) {
|
||||
|
@ -319,7 +319,7 @@ public final class Socks5Proxy {
|
|||
|
||||
/**
|
||||
* Returns the port of the local SOCKS5 proxy server. If it is not running -1 will be returned.
|
||||
*
|
||||
*
|
||||
* @return the port of the local SOCKS5 proxy server or -1 if proxy is not running
|
||||
*/
|
||||
public int getPort() {
|
||||
|
@ -333,7 +333,7 @@ public final class Socks5Proxy {
|
|||
* Returns the socket for the given digest. A socket will be returned if the given digest has
|
||||
* been in the list of allowed transfers (see {@link #addTransfer(String)}) while the peer
|
||||
* connected to the SOCKS5 proxy.
|
||||
*
|
||||
*
|
||||
* @param digest identifying the connection
|
||||
* @return socket or null if there is no socket for the given digest
|
||||
*/
|
||||
|
@ -345,7 +345,7 @@ public final class Socks5Proxy {
|
|||
* Add the given digest to the list of allowed transfers. Only connections for allowed transfers
|
||||
* are stored and can be retrieved by invoking {@link #getSocket(String)}. All connections to
|
||||
* the local SOCKS5 proxy that don't contain an allowed digest are discarded.
|
||||
*
|
||||
*
|
||||
* @param digest to be added to the list of allowed transfers
|
||||
*/
|
||||
public void addTransfer(String digest) {
|
||||
|
@ -358,7 +358,7 @@ public final class Socks5Proxy {
|
|||
* <p>
|
||||
* The digest should be removed after establishing the SOCKS5 Bytestream is finished, an error
|
||||
* occurred while establishing the connection or if the connection is not allowed anymore.
|
||||
*
|
||||
*
|
||||
* @param digest to be removed from the list of allowed transfers
|
||||
*/
|
||||
protected void removeTransfer(String digest) {
|
||||
|
@ -369,7 +369,7 @@ public final class Socks5Proxy {
|
|||
/**
|
||||
* Returns <code>true</code> if the local SOCKS5 proxy server is running, otherwise
|
||||
* <code>false</code>.
|
||||
*
|
||||
*
|
||||
* @return <code>true</code> if the local SOCKS5 proxy server is running, otherwise
|
||||
* <code>false</code>
|
||||
*/
|
||||
|
@ -423,7 +423,7 @@ public final class Socks5Proxy {
|
|||
|
||||
/**
|
||||
* Negotiates a SOCKS5 connection and stores it on success.
|
||||
*
|
||||
*
|
||||
* @param socket connection to the client
|
||||
* @throws SmackException if client requests a connection in an unsupported way
|
||||
* @throws IOException if a network error occurred
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.jxmpp.jid.Jid;
|
|||
|
||||
/**
|
||||
* A collection of utility methods for SOcKS5 messages.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class Socks5Utils {
|
||||
|
@ -34,7 +34,7 @@ public class Socks5Utils {
|
|||
/**
|
||||
* Returns a SHA-1 digest of the given parameters as specified in <a
|
||||
* href="http://xmpp.org/extensions/xep-0065.html#impl-socks5">XEP-0065</a>.
|
||||
*
|
||||
*
|
||||
* @param sessionID for the SOCKS5 Bytestream
|
||||
* @param initiatorJID JID of the initiator of a SOCKS5 Bytestream
|
||||
* @param targetJID JID of the target of a SOCKS5 Bytestream
|
||||
|
@ -51,7 +51,7 @@ public class Socks5Utils {
|
|||
* message or a SOCKS5 response message.
|
||||
* <p>
|
||||
* (see <a href="http://tools.ietf.org/html/rfc1928">RFC1928</a>)
|
||||
*
|
||||
*
|
||||
* @param in the DataInputStream to read the message from
|
||||
* @return the SOCKS5 message
|
||||
* @throws IOException if a network error occurred
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.jxmpp.jid.Jid;
|
|||
|
||||
/**
|
||||
* A stanza representing part of a SOCKS5 Bytestream negotiation.
|
||||
*
|
||||
*
|
||||
* @author Alexander Wenckus
|
||||
*/
|
||||
public class Bytestream extends IQ {
|
||||
|
@ -61,7 +61,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
/**
|
||||
* A constructor where the session ID can be specified.
|
||||
*
|
||||
*
|
||||
* @param SID The session ID related to the negotiation.
|
||||
* @see #setSessionID(String)
|
||||
*/
|
||||
|
@ -73,7 +73,7 @@ public class Bytestream extends IQ {
|
|||
/**
|
||||
* Set the session ID related to the bytestream. The session ID is a unique identifier used to
|
||||
* differentiate between stream negotiations.
|
||||
*
|
||||
*
|
||||
* @param sessionID the unique session ID that identifies the transfer.
|
||||
*/
|
||||
public void setSessionID(final String sessionID) {
|
||||
|
@ -82,7 +82,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
/**
|
||||
* Returns the session ID related to the bytestream negotiation.
|
||||
*
|
||||
*
|
||||
* @return Returns the session ID related to the bytestream negotiation.
|
||||
* @see #setSessionID(String)
|
||||
*/
|
||||
|
@ -92,7 +92,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
/**
|
||||
* Set the transport mode. This should be put in the initiation of the interaction.
|
||||
*
|
||||
*
|
||||
* @param mode the transport mode, either UDP or TCP
|
||||
* @see Mode
|
||||
*/
|
||||
|
@ -102,7 +102,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
/**
|
||||
* Returns the transport mode.
|
||||
*
|
||||
*
|
||||
* @return Returns the transport mode.
|
||||
* @see #setMode(Mode)
|
||||
*/
|
||||
|
@ -112,7 +112,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
/**
|
||||
* Adds a potential stream host that the remote user can connect to to receive the file.
|
||||
*
|
||||
*
|
||||
* @param JID The JID of the stream host.
|
||||
* @param address The internet address of the stream host.
|
||||
* @return The added stream host.
|
||||
|
@ -123,7 +123,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
/**
|
||||
* Adds a potential stream host that the remote user can connect to to receive the file.
|
||||
*
|
||||
*
|
||||
* @param JID The JID of the stream host.
|
||||
* @param address The internet address of the stream host.
|
||||
* @param port The port on which the remote host is seeking connections.
|
||||
|
@ -138,7 +138,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
/**
|
||||
* Adds a potential stream host that the remote user can transfer the file through.
|
||||
*
|
||||
*
|
||||
* @param host The potential stream host.
|
||||
*/
|
||||
public void addStreamHost(final StreamHost host) {
|
||||
|
@ -147,7 +147,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
/**
|
||||
* Returns the list of stream hosts contained in the packet.
|
||||
*
|
||||
*
|
||||
* @return Returns the list of stream hosts contained in the packet.
|
||||
*/
|
||||
public List<StreamHost> getStreamHosts() {
|
||||
|
@ -156,7 +156,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
/**
|
||||
* Returns the stream host related to the given JID, or null if there is none.
|
||||
*
|
||||
*
|
||||
* @param JID The JID of the desired stream host.
|
||||
* @return Returns the stream host related to the given JID, or null if there is none.
|
||||
*/
|
||||
|
@ -175,7 +175,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
/**
|
||||
* Returns the count of stream hosts contained in this packet.
|
||||
*
|
||||
*
|
||||
* @return Returns the count of stream hosts contained in this packet.
|
||||
*/
|
||||
public int countStreamHosts() {
|
||||
|
@ -185,7 +185,7 @@ public class Bytestream extends IQ {
|
|||
/**
|
||||
* Upon connecting to the stream host the target of the stream replies to the initiator with the
|
||||
* JID of the SOCKS5 host that they used.
|
||||
*
|
||||
*
|
||||
* @param JID The JID of the used host.
|
||||
*/
|
||||
public void setUsedHost(final Jid JID) {
|
||||
|
@ -194,7 +194,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
/**
|
||||
* Returns the SOCKS5 host connected to by the remote user.
|
||||
*
|
||||
*
|
||||
* @return Returns the SOCKS5 host connected to by the remote user.
|
||||
*/
|
||||
public StreamHostUsed getUsedHost() {
|
||||
|
@ -204,7 +204,7 @@ public class Bytestream extends IQ {
|
|||
/**
|
||||
* Returns the activate element of the stanza sent to the proxy host to verify the identity of
|
||||
* the initiator and match them to the appropriate stream.
|
||||
*
|
||||
*
|
||||
* @return Returns the activate element of the stanza sent to the proxy host to verify the
|
||||
* identity of the initiator and match them to the appropriate stream.
|
||||
*/
|
||||
|
@ -216,7 +216,7 @@ public class Bytestream extends IQ {
|
|||
* Upon the response from the target of the used host the activate stanza is sent to the SOCKS5
|
||||
* proxy. The proxy will activate the stream or return an error after verifying the identity of
|
||||
* the initiator, using the activate packet.
|
||||
*
|
||||
*
|
||||
* @param targetID The JID of the target of the file transfer.
|
||||
*/
|
||||
public void setToActivate(final Jid targetID) {
|
||||
|
@ -262,7 +262,7 @@ public class Bytestream extends IQ {
|
|||
/**
|
||||
* Stanza extension that represents a potential SOCKS5 proxy for the file transfer. Stream hosts
|
||||
* are forwarded to the target of the file transfer who then chooses and connects to one.
|
||||
*
|
||||
*
|
||||
* @author Alexander Wenckus
|
||||
*/
|
||||
public static class StreamHost implements NamedElement {
|
||||
|
@ -281,7 +281,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
/**
|
||||
* Default constructor.
|
||||
*
|
||||
*
|
||||
* @param JID The JID of the stream host.
|
||||
* @param address The internet address of the stream host.
|
||||
* @param port port of the stream host.
|
||||
|
@ -294,7 +294,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
/**
|
||||
* Returns the JID of the stream host.
|
||||
*
|
||||
*
|
||||
* @return Returns the JID of the stream host.
|
||||
*/
|
||||
public Jid getJID() {
|
||||
|
@ -303,7 +303,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
/**
|
||||
* Returns the internet address of the stream host.
|
||||
*
|
||||
*
|
||||
* @return Returns the internet address of the stream host.
|
||||
*/
|
||||
public String getAddress() {
|
||||
|
@ -312,7 +312,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
/**
|
||||
* Returns the port on which the potential stream host would accept the connection.
|
||||
*
|
||||
*
|
||||
* @return Returns the port on which the potential stream host would accept the connection.
|
||||
*/
|
||||
public int getPort() {
|
||||
|
@ -342,7 +342,7 @@ public class Bytestream extends IQ {
|
|||
/**
|
||||
* After selected a SOCKS5 stream host and successfully connecting, the target of the file
|
||||
* transfer returns a byte stream stanza with the stream host used extension.
|
||||
*
|
||||
*
|
||||
* @author Alexander Wenckus
|
||||
*/
|
||||
public static class StreamHostUsed implements NamedElement {
|
||||
|
@ -353,7 +353,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
/**
|
||||
* Default constructor.
|
||||
*
|
||||
*
|
||||
* @param JID The JID of the selected stream host.
|
||||
*/
|
||||
public StreamHostUsed(final Jid JID) {
|
||||
|
@ -362,7 +362,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
/**
|
||||
* Returns the JID of the selected stream host.
|
||||
*
|
||||
*
|
||||
* @return Returns the JID of the selected stream host.
|
||||
*/
|
||||
public Jid getJID() {
|
||||
|
@ -385,7 +385,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
/**
|
||||
* The stanza sent by the stream initiator to the stream proxy to activate the connection.
|
||||
*
|
||||
*
|
||||
* @author Alexander Wenckus
|
||||
*/
|
||||
public static class Activate implements NamedElement {
|
||||
|
@ -396,7 +396,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
/**
|
||||
* Default constructor specifying the target of the stream.
|
||||
*
|
||||
*
|
||||
* @param target The target of the stream.
|
||||
*/
|
||||
public Activate(final Jid target) {
|
||||
|
@ -405,7 +405,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
/**
|
||||
* Returns the target of the activation.
|
||||
*
|
||||
*
|
||||
* @return Returns the target of the activation.
|
||||
*/
|
||||
public Jid getTarget() {
|
||||
|
@ -429,7 +429,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
/**
|
||||
* The stream can be either a TCP stream or a UDP stream.
|
||||
*
|
||||
*
|
||||
* @author Alexander Wenckus
|
||||
*/
|
||||
public enum Mode {
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.xmlpull.v1.XmlPullParserException;
|
|||
|
||||
/**
|
||||
* Parses a bytestream packet.
|
||||
*
|
||||
*
|
||||
* @author Alexander Wenckus
|
||||
*/
|
||||
public class BytestreamsProvider extends IQProvider<Bytestream> {
|
||||
|
|
|
@ -73,7 +73,7 @@ import org.jxmpp.util.cache.LruCache;
|
|||
|
||||
/**
|
||||
* Keeps track of entity capabilities.
|
||||
*
|
||||
*
|
||||
* @author Florian Schmaus
|
||||
* @see <a href="http://www.xmpp.org/extensions/xep-0115.html">XEP-0115: Entity Capabilities</a>
|
||||
*/
|
||||
|
@ -141,7 +141,7 @@ public final class EntityCapsManager extends Manager {
|
|||
|
||||
/**
|
||||
* Add DiscoverInfo to the database.
|
||||
*
|
||||
*
|
||||
* @param nodeVer
|
||||
* The node and verification String (e.g.
|
||||
* "http://psi-im.org#q07IKJEyjvHSyhy//CH0CxmKi8w=").
|
||||
|
@ -158,7 +158,7 @@ public final class EntityCapsManager extends Manager {
|
|||
/**
|
||||
* Get the Node version (node#ver) of a JID. Returns a String or null if
|
||||
* EntiyCapsManager does not have any information.
|
||||
*
|
||||
*
|
||||
* @param jid
|
||||
* the user (Full JID)
|
||||
* @return the node version (node#ver) or null
|
||||
|
@ -180,7 +180,7 @@ public final class EntityCapsManager extends Manager {
|
|||
* Get the discover info given a user name. The discover info is returned if
|
||||
* the user has a node#ver associated with it and the node#ver has a
|
||||
* discover info associated with it.
|
||||
*
|
||||
*
|
||||
* @param user
|
||||
* user name (Full JID)
|
||||
* @return the discovered info
|
||||
|
@ -195,7 +195,7 @@ public final class EntityCapsManager extends Manager {
|
|||
|
||||
/**
|
||||
* Retrieve DiscoverInfo for a specific node.
|
||||
*
|
||||
*
|
||||
* @param nodeVer
|
||||
* The node name (e.g.
|
||||
* "http://psi-im.org#q07IKJEyjvHSyhy//CH0CxmKi8w=").
|
||||
|
@ -222,7 +222,7 @@ public final class EntityCapsManager extends Manager {
|
|||
|
||||
/**
|
||||
* Set the persistent cache implementation.
|
||||
*
|
||||
*
|
||||
* @param cache
|
||||
*/
|
||||
public static void setPersistentCache(EntityCapsPersistentCache cache) {
|
||||
|
@ -404,7 +404,7 @@ public final class EntityCapsManager extends Manager {
|
|||
|
||||
/**
|
||||
* Remove a record telling what entity caps node a user has.
|
||||
*
|
||||
*
|
||||
* @param user
|
||||
* the user (Full JID)
|
||||
*/
|
||||
|
@ -417,7 +417,7 @@ public final class EntityCapsManager extends Manager {
|
|||
/**
|
||||
* Get our own caps version. The version depends on the enabled features.
|
||||
* A caps version looks like '66/0NaeaBKkwk85efJTGmU47vXI='
|
||||
*
|
||||
*
|
||||
* @return our own caps version
|
||||
*/
|
||||
public CapsVersionAndHash getCapsVersionAndHash() {
|
||||
|
@ -428,7 +428,7 @@ public final class EntityCapsManager extends Manager {
|
|||
* Returns the local entity's NodeVer (e.g.
|
||||
* "http://www.igniterealtime.org/projects/smack/#66/0NaeaBKkwk85efJTGmU47vXI=
|
||||
* )
|
||||
*
|
||||
*
|
||||
* @return the local NodeVer
|
||||
*/
|
||||
public String getLocalNodeVer() {
|
||||
|
@ -441,13 +441,13 @@ public final class EntityCapsManager extends Manager {
|
|||
|
||||
/**
|
||||
* Returns true if Entity Caps are supported by a given JID.
|
||||
*
|
||||
*
|
||||
* @param jid
|
||||
* @return true if the entity supports Entity Capabilities.
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public boolean areEntityCapsSupported(Jid jid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
return sdm.supportsFeature(jid, NAMESPACE);
|
||||
|
@ -455,12 +455,12 @@ public final class EntityCapsManager extends Manager {
|
|||
|
||||
/**
|
||||
* Returns true if Entity Caps are supported by the local service/server.
|
||||
*
|
||||
*
|
||||
* @return true if the user's server supports Entity Capabilities.
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public boolean areEntityCapsSupportedByServer() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
return areEntityCapsSupported(connection().getXMPPServiceDomain());
|
||||
|
@ -531,10 +531,10 @@ public final class EntityCapsManager extends Manager {
|
|||
/**
|
||||
* Verify DiscoverInfo and Caps Node as defined in XEP-0115 5.4 Processing
|
||||
* Method.
|
||||
*
|
||||
*
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0115.html#ver-proc">XEP-0115
|
||||
* 5.4 Processing Method</a>
|
||||
*
|
||||
*
|
||||
* @param ver
|
||||
* @param hash
|
||||
* @param info
|
||||
|
@ -562,7 +562,7 @@ public final class EntityCapsManager extends Manager {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param info
|
||||
* @return true if the stanza extensions is ill-formed
|
||||
*/
|
||||
|
@ -591,10 +591,10 @@ public final class EntityCapsManager extends Manager {
|
|||
|
||||
/**
|
||||
* Generates a XEP-115 Verification String
|
||||
*
|
||||
*
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0115.html#ver">XEP-115
|
||||
* Verification String</a>
|
||||
*
|
||||
*
|
||||
* @param discoverInfo
|
||||
* @param hash
|
||||
* the used hash function, if null, default hash will be used
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
|
|||
public interface EntityCapsPersistentCache {
|
||||
/**
|
||||
* Add an DiscoverInfo to the persistent Cache.
|
||||
*
|
||||
*
|
||||
* @param nodeVer
|
||||
* @param info
|
||||
*/
|
||||
|
|
|
@ -35,9 +35,9 @@ import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
|
|||
* Simple implementation of an EntityCapsPersistentCache that uses a directory
|
||||
* to store the Caps information for every known node. Every node is represented
|
||||
* by a file.
|
||||
*
|
||||
*
|
||||
* @author Florian Schmaus
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SimpleDirectoryPersistentCache implements EntityCapsPersistentCache {
|
||||
private static final Logger LOGGER = Logger.getLogger(SimpleDirectoryPersistentCache.class.getName());
|
||||
|
@ -49,10 +49,10 @@ public class SimpleDirectoryPersistentCache implements EntityCapsPersistentCache
|
|||
* Creates a new SimpleDirectoryPersistentCache Object. Make sure that the
|
||||
* cacheDir exists and that it's an directory.
|
||||
* <p>
|
||||
* Default filename encoder {@link Base32}, as this will work on all
|
||||
* file systems, both case sensitive and case insensitive. It does however
|
||||
* Default filename encoder {@link Base32}, as this will work on all
|
||||
* file systems, both case sensitive and case insensitive. It does however
|
||||
* produce longer filenames.
|
||||
*
|
||||
*
|
||||
* @param cacheDir
|
||||
*/
|
||||
public SimpleDirectoryPersistentCache(File cacheDir) {
|
||||
|
@ -62,10 +62,10 @@ public class SimpleDirectoryPersistentCache implements EntityCapsPersistentCache
|
|||
/**
|
||||
* Creates a new SimpleDirectoryPersistentCache Object. Make sure that the
|
||||
* cacheDir exists and that it's an directory.
|
||||
*
|
||||
*
|
||||
* If your cacheDir is case insensitive then make sure to set the
|
||||
* StringEncoder to {@link Base32} (which is the default).
|
||||
*
|
||||
*
|
||||
* @param cacheDir The directory where the cache will be stored.
|
||||
* @param filenameEncoder Encodes the node string into a filename.
|
||||
*/
|
||||
|
@ -124,7 +124,7 @@ public class SimpleDirectoryPersistentCache implements EntityCapsPersistentCache
|
|||
|
||||
/**
|
||||
* Writes the DiscoverInfo stanza to an file
|
||||
*
|
||||
*
|
||||
* @param file
|
||||
* @param info
|
||||
* @throws IOException
|
||||
|
@ -140,7 +140,7 @@ public class SimpleDirectoryPersistentCache implements EntityCapsPersistentCache
|
|||
|
||||
/**
|
||||
* Tries to restore an DiscoverInfo stanza from a file.
|
||||
*
|
||||
*
|
||||
* @param file
|
||||
* @return the restored DiscoverInfo
|
||||
* @throws Exception
|
||||
|
|
|
@ -68,9 +68,9 @@ import org.jxmpp.jid.Jid;
|
|||
* </p>
|
||||
* Use the <code>getSpecificErrorConditionFrom</code> to obtain the specific
|
||||
* information from an <code>XMPPError</code>.
|
||||
*
|
||||
*
|
||||
* @author Gabriel Guardincerri
|
||||
*
|
||||
*
|
||||
*/
|
||||
public abstract class AdHocCommand {
|
||||
// TODO: Analyze the redesign of command by having an ExecutionResponse as a
|
||||
|
@ -89,7 +89,7 @@ public abstract class AdHocCommand {
|
|||
/**
|
||||
* Returns the specific condition of the <code>error</code> or <tt>null</tt> if the
|
||||
* error doesn't have any.
|
||||
*
|
||||
*
|
||||
* @param error the error the get the specific condition from.
|
||||
* @return the specific condition of this error, or null if it doesn't have
|
||||
* any.
|
||||
|
@ -109,7 +109,7 @@ public abstract class AdHocCommand {
|
|||
/**
|
||||
* Set the the human readable name of the command, usually used for
|
||||
* displaying in a UI.
|
||||
*
|
||||
*
|
||||
* @param name the name.
|
||||
*/
|
||||
public void setName(String name) {
|
||||
|
@ -118,7 +118,7 @@ public abstract class AdHocCommand {
|
|||
|
||||
/**
|
||||
* Returns the human readable name of the command.
|
||||
*
|
||||
*
|
||||
* @return the human readable name of the command
|
||||
*/
|
||||
public String getName() {
|
||||
|
@ -128,7 +128,7 @@ public abstract class AdHocCommand {
|
|||
/**
|
||||
* Sets the unique identifier of the command. This value must be unique for
|
||||
* the <code>OwnerJID</code>.
|
||||
*
|
||||
*
|
||||
* @param node the unique identifier of the command.
|
||||
*/
|
||||
public void setNode(String node) {
|
||||
|
@ -138,7 +138,7 @@ public abstract class AdHocCommand {
|
|||
/**
|
||||
* Returns the unique identifier of the command. It is unique for the
|
||||
* <code>OwnerJID</code>.
|
||||
*
|
||||
*
|
||||
* @return the unique identifier of the command.
|
||||
*/
|
||||
public String getNode() {
|
||||
|
@ -148,14 +148,14 @@ public abstract class AdHocCommand {
|
|||
/**
|
||||
* Returns the full JID of the owner of this command. This JID is the "to" of a
|
||||
* execution request.
|
||||
*
|
||||
*
|
||||
* @return the owner JID.
|
||||
*/
|
||||
public abstract Jid getOwnerJID();
|
||||
|
||||
/**
|
||||
* Returns the notes that the command has at the current stage.
|
||||
*
|
||||
*
|
||||
* @return a list of notes.
|
||||
*/
|
||||
public List<AdHocCommandNote> getNotes() {
|
||||
|
@ -167,7 +167,7 @@ public abstract class AdHocCommand {
|
|||
* response to the execution of an action. All the notes added here are
|
||||
* returned by the {@link #getNotes} method during the current stage.
|
||||
* Once the stage changes all the notes are discarded.
|
||||
*
|
||||
*
|
||||
* @param note the note.
|
||||
*/
|
||||
protected void addNote(AdHocCommandNote note) {
|
||||
|
@ -184,7 +184,7 @@ public abstract class AdHocCommand {
|
|||
* used by the requester to fill all the information that the executor needs
|
||||
* to continue to the next stage. It can also be the result of the
|
||||
* execution.
|
||||
*
|
||||
*
|
||||
* @return the form of the current stage to fill out or the result of the
|
||||
* execution.
|
||||
*/
|
||||
|
@ -201,7 +201,7 @@ public abstract class AdHocCommand {
|
|||
* Sets the form of the current stage. This should be used when setting a
|
||||
* response. It could be a form to fill out the information needed to go to
|
||||
* the next stage or the result of an execution.
|
||||
*
|
||||
*
|
||||
* @param form the form of the current stage to fill out or the result of the
|
||||
* execution.
|
||||
*/
|
||||
|
@ -216,8 +216,8 @@ public abstract class AdHocCommand {
|
|||
*
|
||||
* @throws NoResponseException
|
||||
* @throws XMPPErrorException if there is an error executing the command.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public abstract void execute() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException;
|
||||
|
||||
|
@ -227,12 +227,12 @@ public abstract class AdHocCommand {
|
|||
* previous stage. This method will be only invoked for commands that have one
|
||||
* or more stages. If there is a problem executing the command it throws an
|
||||
* XMPPException.
|
||||
*
|
||||
*
|
||||
* @param response the form answer of the previous stage.
|
||||
* @throws NoResponseException
|
||||
* @throws XMPPErrorException if there is a problem executing the command.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public abstract void next(Form response) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException;
|
||||
|
||||
|
@ -242,13 +242,13 @@ public abstract class AdHocCommand {
|
|||
* previous stage. This method will be only invoked for commands that have one
|
||||
* or more stages. If there is a problem executing the command it throws an
|
||||
* XMPPException.
|
||||
*
|
||||
*
|
||||
* @param response the form answer of the previous stage.
|
||||
*
|
||||
* @throws NoResponseException
|
||||
* @throws XMPPErrorException if there is a problem executing the command.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public abstract void complete(Form response) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException;
|
||||
|
||||
|
@ -260,8 +260,8 @@ public abstract class AdHocCommand {
|
|||
*
|
||||
* @throws NoResponseException
|
||||
* @throws XMPPErrorException if there is a problem executing the command.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public abstract void prev() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException;
|
||||
|
||||
|
@ -272,8 +272,8 @@ public abstract class AdHocCommand {
|
|||
*
|
||||
* @throws NoResponseException
|
||||
* @throws XMPPErrorException if there is a problem executing the command.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public abstract void cancel() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException;
|
||||
|
||||
|
@ -282,7 +282,7 @@ public abstract class AdHocCommand {
|
|||
* Possible actions are: {@link Action#prev prev}, {@link Action#next next} and
|
||||
* {@link Action#complete complete}. This method will be only invoked for commands that
|
||||
* have one or more stages.
|
||||
*
|
||||
*
|
||||
* @return a collection with the allowed actions based on the current stage
|
||||
* as defined in the SessionData.
|
||||
*/
|
||||
|
@ -293,7 +293,7 @@ public abstract class AdHocCommand {
|
|||
/**
|
||||
* Add an action to the current stage available actions. This should be used
|
||||
* when creating a response.
|
||||
*
|
||||
*
|
||||
* @param action the action.
|
||||
*/
|
||||
protected void addActionAvailable(Action action) {
|
||||
|
@ -306,7 +306,7 @@ public abstract class AdHocCommand {
|
|||
* reply, if no action was defined in the command then the action will be
|
||||
* assumed "execute" thus assuming the action returned by this method. This
|
||||
* method will never be invoked for commands that have no stages.
|
||||
*
|
||||
*
|
||||
* @return the action available for the current stage which is considered
|
||||
* the equivalent to "execute".
|
||||
*/
|
||||
|
@ -320,7 +320,7 @@ public abstract class AdHocCommand {
|
|||
* a response. When the requester sends his reply, if no action was defined
|
||||
* in the command then the action will be assumed "execute" thus assuming
|
||||
* the action returned by this method.
|
||||
*
|
||||
*
|
||||
* @param action the action.
|
||||
*/
|
||||
protected void setExecuteAction(Action action) {
|
||||
|
@ -329,7 +329,7 @@ public abstract class AdHocCommand {
|
|||
|
||||
/**
|
||||
* Returns the status of the current stage.
|
||||
*
|
||||
*
|
||||
* @return the current status.
|
||||
*/
|
||||
public Status getStatus() {
|
||||
|
@ -338,7 +338,7 @@ public abstract class AdHocCommand {
|
|||
|
||||
/**
|
||||
* Check if this command has been completed successfully.
|
||||
*
|
||||
*
|
||||
* @return <code>true</code> if this command is completed.
|
||||
* @since 4.2
|
||||
*/
|
||||
|
@ -348,7 +348,7 @@ public abstract class AdHocCommand {
|
|||
|
||||
/**
|
||||
* Sets the data of the current stage. This should not used.
|
||||
*
|
||||
*
|
||||
* @param data the data.
|
||||
*/
|
||||
void setData(AdHocCommandData data) {
|
||||
|
@ -368,7 +368,7 @@ public abstract class AdHocCommand {
|
|||
* Returns true if the <code>action</code> is available in the current stage.
|
||||
* The {@link Action#cancel cancel} action is always allowed. To define the
|
||||
* available actions use the <code>addActionAvailable</code> method.
|
||||
*
|
||||
*
|
||||
* @param action
|
||||
* The action to check if it is available.
|
||||
* @return True if the action is available for the current stage.
|
||||
|
|
|
@ -59,8 +59,8 @@ import org.jxmpp.jid.Jid;
|
|||
*
|
||||
* Pass in an XMPPConnection instance to
|
||||
* {@link #getAddHocCommandsManager(XMPPConnection)} in order to
|
||||
* get an instance of this class.
|
||||
*
|
||||
* get an instance of this class.
|
||||
*
|
||||
* @author Gabriel Guardincerri
|
||||
*/
|
||||
public final class AdHocCommandManager extends Manager {
|
||||
|
@ -258,7 +258,7 @@ public final 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
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public DiscoverItems discoverCommands(Jid jid) throws XMPPException, SmackException, InterruptedException {
|
||||
return serviceDiscoveryManager.discoverItems(jid, NAMESPACE);
|
||||
|
@ -270,7 +270,7 @@ public final 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
|
||||
* @throws InterruptedException
|
||||
* @deprecated This method uses no longer existent XEP-0030 features and will be removed.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
|
@ -315,7 +315,7 @@ public final class AdHocCommandManager extends Manager {
|
|||
* <li>The command has more than one stage, if so, it saves the command and
|
||||
* session ID for further use</li>
|
||||
* </ul>
|
||||
*
|
||||
*
|
||||
* <br>
|
||||
* <br>
|
||||
* If this is not the first request, this method checks, before executing
|
||||
|
@ -330,7 +330,7 @@ public final class AdHocCommandManager extends Manager {
|
|||
* the stanza to process.
|
||||
* @throws NotConnectedException
|
||||
* @throws NoResponseException
|
||||
* @throws InterruptedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
private IQ processAdHocCommand(AdHocCommandData requestData) throws NoResponseException, NotConnectedException, InterruptedException {
|
||||
// Creates the response with the corresponding data
|
||||
|
@ -587,10 +587,10 @@ public final class AdHocCommandManager extends Manager {
|
|||
|
||||
/**
|
||||
* Responds an error with an specific condition.
|
||||
*
|
||||
*
|
||||
* @param response the response to send.
|
||||
* @param condition the condition of the error.
|
||||
* @throws NotConnectedException
|
||||
* @throws NotConnectedException
|
||||
*/
|
||||
private static IQ respondError(AdHocCommandData response,
|
||||
StanzaError.Condition condition) {
|
||||
|
@ -599,11 +599,11 @@ public final class AdHocCommandManager extends Manager {
|
|||
|
||||
/**
|
||||
* Responds an error with an specific condition.
|
||||
*
|
||||
*
|
||||
* @param response the response to send.
|
||||
* @param condition the condition of the error.
|
||||
* @param specificCondition the adhoc command error condition.
|
||||
* @throws NotConnectedException
|
||||
* @throws NotConnectedException
|
||||
*/
|
||||
private static IQ respondError(AdHocCommandData response, StanzaError.Condition condition,
|
||||
AdHocCommand.SpecificErrorCondition specificCondition) {
|
||||
|
@ -613,10 +613,10 @@ public final class AdHocCommandManager extends Manager {
|
|||
|
||||
/**
|
||||
* Responds an error with an specific error.
|
||||
*
|
||||
*
|
||||
* @param response the response to send.
|
||||
* @param error the error to send.
|
||||
* @throws NotConnectedException
|
||||
* @throws NotConnectedException
|
||||
*/
|
||||
private static IQ respondError(AdHocCommandData response, StanzaError.Builder error) {
|
||||
response.setType(IQ.Type.error);
|
||||
|
@ -626,17 +626,17 @@ public final class AdHocCommandManager extends Manager {
|
|||
|
||||
/**
|
||||
* Creates a new instance of a command to be used by a new execution request
|
||||
*
|
||||
*
|
||||
* @param commandNode the command node that identifies it.
|
||||
* @param sessionID the session id of this execution.
|
||||
* @return the command instance to execute.
|
||||
* @throws XMPPErrorException if there is problem creating the new instance.
|
||||
* @throws SecurityException
|
||||
* @throws NoSuchMethodException
|
||||
* @throws InvocationTargetException
|
||||
* @throws IllegalArgumentException
|
||||
* @throws IllegalAccessException
|
||||
* @throws InstantiationException
|
||||
* @throws SecurityException
|
||||
* @throws NoSuchMethodException
|
||||
* @throws InvocationTargetException
|
||||
* @throws IllegalArgumentException
|
||||
* @throws IllegalAccessException
|
||||
* @throws InstantiationException
|
||||
*/
|
||||
private LocalCommand newInstanceOfCmd(String commandNode, String sessionID)
|
||||
throws XMPPErrorException, InstantiationException, IllegalAccessException, IllegalArgumentException,
|
||||
|
@ -653,7 +653,7 @@ public final class AdHocCommandManager extends Manager {
|
|||
/**
|
||||
* Returns the registered commands of this command manager, which is related
|
||||
* to a connection.
|
||||
*
|
||||
*
|
||||
* @return the registered commands.
|
||||
*/
|
||||
private Collection<AdHocCommandInfo> getRegisteredCommands() {
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.commands;
|
|||
|
||||
/**
|
||||
* Notes can be added to a command execution response. A note has a type and value.
|
||||
*
|
||||
*
|
||||
* @author Gabriel Guardincerri
|
||||
*/
|
||||
public class AdHocCommandNote {
|
||||
|
@ -40,7 +40,7 @@ public class AdHocCommandNote {
|
|||
|
||||
/**
|
||||
* Returns the value or message of the note.
|
||||
*
|
||||
*
|
||||
* @return the value or message of the note.
|
||||
*/
|
||||
public String getValue() {
|
||||
|
@ -49,7 +49,7 @@ public class AdHocCommandNote {
|
|||
|
||||
/**
|
||||
* Return the type of the note.
|
||||
*
|
||||
*
|
||||
* @return the type of the note.
|
||||
*/
|
||||
public Type getType() {
|
||||
|
|
|
@ -36,7 +36,7 @@ import org.jxmpp.jid.Jid;
|
|||
* methods. When implementing the actions remember that they could be invoked
|
||||
* several times, and that you must use the current stage number to know what to
|
||||
* do.
|
||||
*
|
||||
*
|
||||
* @author Gabriel Guardincerri
|
||||
*/
|
||||
public abstract class LocalCommand extends AdHocCommand {
|
||||
|
@ -70,7 +70,7 @@ public abstract class LocalCommand extends AdHocCommand {
|
|||
/**
|
||||
* The sessionID is an unique identifier of an execution request. This is
|
||||
* automatically handled and should not be called.
|
||||
*
|
||||
*
|
||||
* @param sessionID the unique session id of this execution
|
||||
*/
|
||||
public void setSessionID(String sessionID) {
|
||||
|
@ -80,7 +80,7 @@ public abstract class LocalCommand extends AdHocCommand {
|
|||
|
||||
/**
|
||||
* Returns the session ID of this execution.
|
||||
*
|
||||
*
|
||||
* @return the unique session id of this execution
|
||||
*/
|
||||
public String getSessionID() {
|
||||
|
@ -90,7 +90,7 @@ public abstract class LocalCommand extends AdHocCommand {
|
|||
/**
|
||||
* Sets the JID of the command host. This is automatically handled and should
|
||||
* not be called.
|
||||
*
|
||||
*
|
||||
* @param ownerJID the JID of the owner.
|
||||
*/
|
||||
public void setOwnerJID(Jid ownerJID) {
|
||||
|
@ -104,7 +104,7 @@ public abstract class LocalCommand extends AdHocCommand {
|
|||
|
||||
/**
|
||||
* Returns the date the command was created.
|
||||
*
|
||||
*
|
||||
* @return the date the command was created.
|
||||
*/
|
||||
public long getCreationDate() {
|
||||
|
@ -115,7 +115,7 @@ public abstract class LocalCommand extends AdHocCommand {
|
|||
* Returns true if the current stage is the last one. If it is then the
|
||||
* execution of some action will complete the execution of the command.
|
||||
* Commands that don't have multiple stages can always return <tt>true</tt>.
|
||||
*
|
||||
*
|
||||
* @return true if the command is in the last stage.
|
||||
*/
|
||||
public abstract boolean isLastStage();
|
||||
|
@ -151,7 +151,7 @@ public abstract class LocalCommand extends AdHocCommand {
|
|||
/**
|
||||
* Increase the current stage number. This is automatically handled and should
|
||||
* not be called.
|
||||
*
|
||||
*
|
||||
*/
|
||||
void incrementStage() {
|
||||
currentStage++;
|
||||
|
@ -160,7 +160,7 @@ public abstract class LocalCommand extends AdHocCommand {
|
|||
/**
|
||||
* Decrease the current stage number. This is automatically handled and should
|
||||
* not be called.
|
||||
*
|
||||
*
|
||||
*/
|
||||
void decrementStage() {
|
||||
currentStage--;
|
||||
|
|
|
@ -24,7 +24,7 @@ import java.lang.reflect.InvocationTargetException;
|
|||
* when arguments must be passed into the constructor or when using a dependency injection
|
||||
* framework. When a LocalCommandFactory isn't used, you can provide the AdHocCommandManager
|
||||
* a Class object instead. For more details, see
|
||||
* {@link AdHocCommandManager#registerCommand(String, String, LocalCommandFactory)}.
|
||||
* {@link AdHocCommandManager#registerCommand(String, String, LocalCommandFactory)}.
|
||||
*
|
||||
* @author Matt Tucker
|
||||
*/
|
||||
|
@ -36,10 +36,10 @@ public interface LocalCommandFactory {
|
|||
* @return a LocalCommand instance.
|
||||
* @throws InstantiationException if creating an instance failed.
|
||||
* @throws IllegalAccessException if creating an instance is not allowed.
|
||||
* @throws SecurityException
|
||||
* @throws NoSuchMethodException
|
||||
* @throws InvocationTargetException
|
||||
* @throws IllegalArgumentException
|
||||
* @throws SecurityException
|
||||
* @throws NoSuchMethodException
|
||||
* @throws InvocationTargetException
|
||||
* @throws IllegalArgumentException
|
||||
*/
|
||||
LocalCommand getInstance() throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException;
|
||||
|
||||
|
|
|
@ -97,8 +97,8 @@ public class RemoteCommand extends AdHocCommand {
|
|||
* @param form the form answer of the previous stage.
|
||||
* @throws XMPPErrorException if an error occurs.
|
||||
* @throws NoResponseException if there was no response from the server.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void execute(Form form) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
executeAction(Action.execute, form);
|
||||
|
@ -127,8 +127,8 @@ public class RemoteCommand extends AdHocCommand {
|
|||
* @param form the form with the information.
|
||||
* @throws XMPPErrorException if there is a problem executing the command.
|
||||
* @throws NoResponseException if there was no response from the server.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
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
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.jxmpp.jid.Jid;
|
|||
|
||||
/**
|
||||
* Represents the state and the request of the execution of an adhoc command.
|
||||
*
|
||||
*
|
||||
* @author Gabriel Guardincerri
|
||||
*/
|
||||
public class AdHocCommandData extends IQ {
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
|
||||
/**
|
||||
* The AdHocCommandDataProvider parses AdHocCommandData packets.
|
||||
*
|
||||
*
|
||||
* @author Gabriel Guardincerri
|
||||
*/
|
||||
public class AdHocCommandDataProvider extends IQProvider<AdHocCommandData> {
|
||||
|
|
|
@ -25,14 +25,14 @@ import org.jivesoftware.smack.util.XmlStringBuilder;
|
|||
import org.jxmpp.util.XmppDateTime;
|
||||
|
||||
/**
|
||||
* Represents timestamp information about data stored for later delivery. A DelayInformation will
|
||||
* always includes the timestamp when the stanza was originally sent and may include more
|
||||
* Represents timestamp information about data stored for later delivery. A DelayInformation will
|
||||
* always includes the timestamp when the stanza was originally sent and may include more
|
||||
* information such as the JID of the entity that originally sent the stanza as well as the reason
|
||||
* for the delay.<p>
|
||||
*
|
||||
*
|
||||
* For more information see <a href="http://xmpp.org/extensions/xep-0091.html">XEP-0091</a>
|
||||
* and <a href="http://xmpp.org/extensions/xep-0203.html">XEP-0203</a>.
|
||||
*
|
||||
*
|
||||
* @author Gaston Dombiak
|
||||
* @author Florian Schmaus
|
||||
*/
|
||||
|
@ -45,7 +45,7 @@ public class DelayInformation implements ExtensionElement {
|
|||
private final String reason;
|
||||
|
||||
/**
|
||||
* Creates a new instance with the specified timestamp.
|
||||
* Creates a new instance with the specified timestamp.
|
||||
* @param stamp the timestamp
|
||||
* @param from sender
|
||||
* @param reason reason of delay.
|
||||
|
@ -61,10 +61,10 @@ public class DelayInformation implements ExtensionElement {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the JID of the entity that originally sent the stanza or that delayed the
|
||||
* Returns the JID of the entity that originally sent the stanza or that delayed the
|
||||
* delivery of the stanza or <tt>null</tt> if this information is not available.
|
||||
*
|
||||
* @return the JID of the entity that originally sent the stanza or that delayed the
|
||||
*
|
||||
* @return the JID of the entity that originally sent the stanza or that delayed the
|
||||
* delivery of the packet.
|
||||
*/
|
||||
public String getFrom() {
|
||||
|
@ -72,9 +72,9 @@ public class DelayInformation implements ExtensionElement {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the timestamp when the stanza was originally sent. The returned Date is
|
||||
* Returns the timestamp when the stanza was originally sent. The returned Date is
|
||||
* be understood as UTC.
|
||||
*
|
||||
*
|
||||
* @return the timestamp when the stanza was originally sent.
|
||||
*/
|
||||
public Date getStamp() {
|
||||
|
@ -82,9 +82,9 @@ public class DelayInformation implements ExtensionElement {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a natural-language description of the reason for the delay or <tt>null</tt> if
|
||||
* Returns a natural-language description of the reason for the delay or <tt>null</tt> if
|
||||
* this information is not available.
|
||||
*
|
||||
*
|
||||
* @return a natural-language description of the reason for the delay or <tt>null</tt>.
|
||||
*/
|
||||
public String getReason() {
|
||||
|
|
|
@ -23,7 +23,7 @@ import org.jxmpp.util.XmppDateTime;
|
|||
|
||||
/**
|
||||
* The DelayInformationProvider parses DelayInformation packets.
|
||||
*
|
||||
*
|
||||
* @author Florian Schmaus
|
||||
*/
|
||||
public class DelayInformationProvider extends AbstractDelayInformationProvider {
|
||||
|
|
|
@ -38,9 +38,9 @@ public interface NodeInformationProvider {
|
|||
|
||||
/**
|
||||
* Returns a list of the Items {@link org.jivesoftware.smackx.disco.packet.DiscoverItems.Item}
|
||||
* defined in the node. For example, the MUC protocol specifies that an XMPP client should
|
||||
* defined in the node. For example, the MUC protocol specifies that an XMPP client should
|
||||
* answer an Item for each joined room when asked for the rooms where the use has joined.
|
||||
*
|
||||
*
|
||||
* @return a list of the Items defined in the node.
|
||||
*/
|
||||
List<DiscoverItems.Item> getNodeItems();
|
||||
|
|
|
@ -63,8 +63,8 @@ import org.jxmpp.util.cache.ExpirationCache;
|
|||
* <li>Automatic response when this XMPP entity is queried for information.
|
||||
* <li>Ability to discover items and information of remote XMPP entities.
|
||||
* <li>Ability to publish publicly available items.
|
||||
* </ol>
|
||||
*
|
||||
* </ol>
|
||||
*
|
||||
* @author Gaston Dombiak
|
||||
* @author Florian Schmaus
|
||||
*/
|
||||
|
@ -101,7 +101,7 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
/**
|
||||
* Set the default identity all new connections will have. If unchanged the default identity is an
|
||||
* identity where category is set to 'client', type is set to 'pc' and name is set to 'Smack'.
|
||||
*
|
||||
*
|
||||
* @param identity
|
||||
*/
|
||||
public static void setDefaultIdentity(DiscoverInfo.Identity identity) {
|
||||
|
@ -109,10 +109,10 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a new ServiceDiscoveryManager for a given XMPPConnection. This means that the
|
||||
* Creates a new ServiceDiscoveryManager for a given XMPPConnection. This means that the
|
||||
* service manager will respond to any service discovery request that the connection may
|
||||
* receive.
|
||||
*
|
||||
* receive.
|
||||
*
|
||||
* @param connection the connection to which a ServiceDiscoveryManager is going to be created.
|
||||
*/
|
||||
private ServiceDiscoveryManager(XMPPConnection connection) {
|
||||
|
@ -121,7 +121,7 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
addFeature(DiscoverInfo.NAMESPACE);
|
||||
addFeature(DiscoverItems.NAMESPACE);
|
||||
|
||||
// Listen for disco#items requests and answer with an empty result
|
||||
// Listen for disco#items requests and answer with an empty result
|
||||
connection.registerIQRequestHandler(new AbstractIqRequestHandler(DiscoverItems.ELEMENT, DiscoverItems.NAMESPACE, IQ.Type.get, Mode.async) {
|
||||
@Override
|
||||
public IQ handleIQRequest(IQ iqRequest) {
|
||||
|
@ -150,8 +150,8 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
}
|
||||
});
|
||||
|
||||
// Listen for disco#info requests and answer the client's supported features
|
||||
// To add a new feature as supported use the #addFeature message
|
||||
// Listen for disco#info requests and answer the client's supported features
|
||||
// To add a new feature as supported use the #addFeature message
|
||||
connection.registerIQRequestHandler(new AbstractIqRequestHandler(DiscoverInfo.ELEMENT, DiscoverInfo.NAMESPACE, IQ.Type.get, Mode.async) {
|
||||
@Override
|
||||
public IQ handleIQRequest(IQ iqRequest) {
|
||||
|
@ -193,7 +193,7 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
/**
|
||||
* Returns the name of the client that will be returned when asked for the client identity
|
||||
* in a disco request. The name could be any value you need to identity this client.
|
||||
*
|
||||
*
|
||||
* @return the name of the client that will be returned when asked for the client identity
|
||||
* in a disco request.
|
||||
*/
|
||||
|
@ -223,11 +223,11 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the type of client that will be returned when asked for the client identity in a
|
||||
* disco request. The valid types are defined by the category client. Follow this link to learn
|
||||
* Returns the type of client that will be returned when asked for the client identity in a
|
||||
* disco request. The valid types are defined by the category client. Follow this link to learn
|
||||
* the possible types: <a href="http://xmpp.org/registrar/disco-categories.html#client">Jabber::Registrar</a>.
|
||||
*
|
||||
* @return the type of client that will be returned when asked for the client identity in a
|
||||
*
|
||||
* @return the type of client that will be returned when asked for the client identity in a
|
||||
* disco request.
|
||||
*/
|
||||
public String getIdentityType() {
|
||||
|
@ -236,7 +236,7 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
|
||||
/**
|
||||
* Add an further identity to the client.
|
||||
*
|
||||
*
|
||||
* @param identity
|
||||
*/
|
||||
public synchronized void addIdentity(DiscoverInfo.Identity identity) {
|
||||
|
@ -249,7 +249,7 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
/**
|
||||
* Remove an identity from the client. Note that the client needs at least one identity, the default identity, which
|
||||
* can not be removed.
|
||||
*
|
||||
*
|
||||
* @param identity
|
||||
* @return true, if successful. Otherwise the default identity was given.
|
||||
*/
|
||||
|
@ -264,7 +264,7 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
|
||||
/**
|
||||
* Returns all identities of this client as unmodifiable Collection.
|
||||
*
|
||||
*
|
||||
* @return all identies as set
|
||||
*/
|
||||
public Set<DiscoverInfo.Identity> getIdentities() {
|
||||
|
@ -276,7 +276,7 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
|
||||
/**
|
||||
* Returns the ServiceDiscoveryManager instance associated with a given XMPPConnection.
|
||||
*
|
||||
*
|
||||
* @param connection the connection used to look for the proper ServiceDiscoveryManager.
|
||||
* @return the ServiceDiscoveryManager associated with a given XMPPConnection.
|
||||
*/
|
||||
|
@ -292,7 +292,7 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
|
||||
/**
|
||||
* Add discover info response data.
|
||||
*
|
||||
*
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0030.html#info-basic">XEP-30 Basic Protocol; Example 2</a>
|
||||
*
|
||||
* @param response the discover info response packet
|
||||
|
@ -309,14 +309,14 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the NodeInformationProvider responsible for providing information
|
||||
* Returns the NodeInformationProvider responsible for providing information
|
||||
* (ie items) related to a given node or <tt>null</null> if none.<p>
|
||||
*
|
||||
*
|
||||
* In MUC, a node could be 'http://jabber.org/protocol/muc#rooms' which means that the
|
||||
* NodeInformationProvider will provide information about the rooms where the user has joined.
|
||||
*
|
||||
*
|
||||
* @param node the node that contains items associated with an entity not addressable as a JID.
|
||||
* @return the NodeInformationProvider responsible for providing information related
|
||||
* @return the NodeInformationProvider responsible for providing information related
|
||||
* to a given node.
|
||||
*/
|
||||
private NodeInformationProvider getNodeInformationProvider(String node) {
|
||||
|
@ -327,14 +327,14 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the NodeInformationProvider responsible for providing information
|
||||
* Sets the NodeInformationProvider responsible for providing information
|
||||
* (ie items) related to a given node. Every time this client receives a disco request
|
||||
* regarding the items of a given node, the provider associated to that node will be the
|
||||
* regarding the items of a given node, the provider associated to that node will be the
|
||||
* responsible for providing the requested information.<p>
|
||||
*
|
||||
*
|
||||
* In MUC, a node could be 'http://jabber.org/protocol/muc#rooms' which means that the
|
||||
* NodeInformationProvider will provide information about the rooms where the user has joined.
|
||||
*
|
||||
* NodeInformationProvider will provide information about the rooms where the user has joined.
|
||||
*
|
||||
* @param node the node whose items will be provided by the NodeInformationProvider.
|
||||
* @param listener the NodeInformationProvider responsible for providing items related
|
||||
* to the node.
|
||||
|
@ -344,13 +344,13 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Removes the NodeInformationProvider responsible for providing information
|
||||
* Removes the NodeInformationProvider responsible for providing information
|
||||
* (ie items) related to a given node. This means that no more information will be
|
||||
* available for the specified node.
|
||||
*
|
||||
*
|
||||
* In MUC, a node could be 'http://jabber.org/protocol/muc#rooms' which means that the
|
||||
* NodeInformationProvider will provide information about the rooms where the user has joined.
|
||||
*
|
||||
* NodeInformationProvider will provide information about the rooms where the user has joined.
|
||||
*
|
||||
* @param node the node to remove the associated NodeInformationProvider.
|
||||
*/
|
||||
public void removeNodeInformationProvider(String node) {
|
||||
|
@ -362,7 +362,7 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
* <p>
|
||||
* The result is a copied modifiable list of the original features.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @return a List of the supported features by this XMPP entity.
|
||||
*/
|
||||
public synchronized List<String> getFeatures() {
|
||||
|
@ -370,7 +370,7 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Registers that a new feature is supported by this XMPP entity. When this client is
|
||||
* Registers that a new feature is supported by this XMPP entity. When this client is
|
||||
* queried for its information the registered features will be answered.<p>
|
||||
*
|
||||
* Since no stanza is actually sent to the server it is safe to perform this operation
|
||||
|
@ -436,7 +436,7 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
|
||||
/**
|
||||
* Returns the data form that is set as extended information for this Service Discovery instance (XEP-0128).
|
||||
*
|
||||
*
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0128.html">XEP-128: Service Discovery Extensions</a>
|
||||
* @return the data form
|
||||
*/
|
||||
|
@ -447,7 +447,7 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
/**
|
||||
* Returns the data form as List of PacketExtensions, or null if no data form is set.
|
||||
* This representation is needed by some classes (e.g. EntityCapsManager, NodeInformationProvider)
|
||||
*
|
||||
*
|
||||
* @return the data form as List of PacketExtensions
|
||||
*/
|
||||
public List<ExtensionElement> getExtendedInfoAsList() {
|
||||
|
@ -476,13 +476,13 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
/**
|
||||
* Returns the discovered information of a given XMPP entity addressed by its JID.
|
||||
* Use null as entityID to query the server
|
||||
*
|
||||
*
|
||||
* @param entityID the address of the XMPP entity or null.
|
||||
* @return the discovered information.
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public DiscoverInfo discoverInfo(Jid entityID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
if (entityID == null)
|
||||
|
@ -516,19 +516,19 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
|
||||
/**
|
||||
* Returns the discovered information of a given XMPP entity addressed by its JID and
|
||||
* note attribute. Use this message only when trying to query information which is not
|
||||
* note attribute. Use this message only when trying to query information which is not
|
||||
* directly addressable.
|
||||
*
|
||||
*
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0030.html#info-basic">XEP-30 Basic Protocol</a>
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0030.html#info-nodes">XEP-30 Info Nodes</a>
|
||||
*
|
||||
*
|
||||
* @param entityID the address of the XMPP entity.
|
||||
* @param node the optional attribute that supplements the 'jid' attribute.
|
||||
* @return the discovered information.
|
||||
* @throws XMPPErrorException if the operation failed for some reason.
|
||||
* @throws NoResponseException if there was no response from the server.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public DiscoverInfo discoverInfo(Jid entityID, String node) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
// Discover the entity's info
|
||||
|
@ -544,13 +544,13 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
|
||||
/**
|
||||
* Returns the discovered items of a given XMPP entity addressed by its JID.
|
||||
*
|
||||
*
|
||||
* @param entityID the address of the XMPP entity.
|
||||
* @return the discovered information.
|
||||
* @throws XMPPErrorException if the operation failed for some reason.
|
||||
* @throws NoResponseException if there was no response from the server.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public DiscoverItems discoverItems(Jid entityID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
return discoverItems(entityID, null);
|
||||
|
@ -558,16 +558,16 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
|
||||
/**
|
||||
* Returns the discovered items of a given XMPP entity addressed by its JID and
|
||||
* note attribute. Use this message only when trying to query information which is not
|
||||
* note attribute. Use this message only when trying to query information which is not
|
||||
* directly addressable.
|
||||
*
|
||||
*
|
||||
* @param entityID the address of the XMPP entity.
|
||||
* @param node the optional attribute that supplements the 'jid' attribute.
|
||||
* @return the discovered items.
|
||||
* @throws XMPPErrorException if the operation failed for some reason.
|
||||
* @throws NoResponseException if there was no response from the server.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public DiscoverItems discoverItems(Jid entityID, String node) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
// Discover the entity's items
|
||||
|
@ -585,13 +585,13 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
* to the server so that the server can provide items associated to the client. These items will
|
||||
* be returned by the server whenever the server receives a disco request targeted to the bare
|
||||
* address of the client (i.e. user@host.com).
|
||||
*
|
||||
*
|
||||
* @param entityID the address of the XMPP entity.
|
||||
* @return true if the server supports publishing of items.
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @deprecated The disco-publish feature was removed from XEP-0030 in 2008 in favor of XEP-0060: Publish-Subscribe.
|
||||
*/
|
||||
@Deprecated
|
||||
|
@ -606,7 +606,7 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
* to the server so that the server can provide items associated to the client. These items will
|
||||
* be returned by the server whenever the server receives a disco request targeted to the bare
|
||||
* address of the client (i.e. user@host.com).
|
||||
*
|
||||
*
|
||||
* @param info the discover info stanza to check.
|
||||
* @return true if the server supports publishing of items.
|
||||
* @deprecated The disco-publish feature was removed from XEP-0030 in 2008 in favor of XEP-0060: Publish-Subscribe.
|
||||
|
@ -618,17 +618,17 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Publishes new items to a parent entity. The item elements to publish MUST have at least
|
||||
* a 'jid' attribute specifying the Entity ID of the item, and an action attribute which
|
||||
* specifies the action being taken for that item. Possible action values are: "update" and
|
||||
* Publishes new items to a parent entity. The item elements to publish MUST have at least
|
||||
* a 'jid' attribute specifying the Entity ID of the item, and an action attribute which
|
||||
* specifies the action being taken for that item. Possible action values are: "update" and
|
||||
* "remove".
|
||||
*
|
||||
*
|
||||
* @param entityID the address of the XMPP entity.
|
||||
* @param discoverItems the DiscoveryItems to publish.
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @deprecated The disco-publish feature was removed from XEP-0030 in 2008 in favor of XEP-0060: Publish-Subscribe.
|
||||
*/
|
||||
@Deprecated
|
||||
|
@ -638,18 +638,18 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Publishes new items to a parent entity and node. The item elements to publish MUST have at
|
||||
* least a 'jid' attribute specifying the Entity ID of the item, and an action attribute which
|
||||
* specifies the action being taken for that item. Possible action values are: "update" and
|
||||
* Publishes new items to a parent entity and node. The item elements to publish MUST have at
|
||||
* least a 'jid' attribute specifying the Entity ID of the item, and an action attribute which
|
||||
* specifies the action being taken for that item. Possible action values are: "update" and
|
||||
* "remove".
|
||||
*
|
||||
*
|
||||
* @param entityID the address of the XMPP entity.
|
||||
* @param node the attribute that supplements the 'jid' attribute.
|
||||
* @param discoverItems the DiscoveryItems to publish.
|
||||
* @throws XMPPErrorException if the operation failed for some reason.
|
||||
* @throws NoResponseException if there was no response from the server.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @deprecated The disco-publish feature was removed from XEP-0030 in 2008 in favor of XEP-0060: Publish-Subscribe.
|
||||
*/
|
||||
@Deprecated
|
||||
|
@ -670,7 +670,7 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
* @throws NoResponseException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws InterruptedException
|
||||
* @since 4.1
|
||||
*/
|
||||
public boolean serverSupportsFeature(CharSequence feature) throws NoResponseException, XMPPErrorException,
|
||||
|
@ -730,10 +730,10 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
* @param jid the JID of the remote entity
|
||||
* @param feature
|
||||
* @return true if the entity supports the feature, false otherwise
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public boolean supportsFeature(Jid jid, CharSequence feature) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
return supportsFeatures(jid, feature);
|
||||
|
@ -762,7 +762,7 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
|
||||
/**
|
||||
* Find all services under the users service that provide a given feature.
|
||||
*
|
||||
*
|
||||
* @param feature the feature to search for
|
||||
* @param stopOnFirst if true, stop searching after the first service was found
|
||||
* @param useCache if true, query a cache first to avoid network I/O
|
||||
|
@ -770,7 +770,7 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
* @throws NoResponseException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public List<DiscoverInfo> findServicesDiscoverInfo(String feature, boolean stopOnFirst, boolean useCache)
|
||||
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
|
@ -884,7 +884,7 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
|
||||
/**
|
||||
* Find all services under the users service that provide a given feature.
|
||||
*
|
||||
*
|
||||
* @param feature the feature to search for
|
||||
* @param stopOnFirst if true, stop searching after the first service was found
|
||||
* @param useCache if true, query a cache first to avoid network I/O
|
||||
|
@ -892,7 +892,7 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
* @throws NoResponseException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public List<DomainBareJid> findServices(String feature, boolean stopOnFirst, boolean useCache) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
List<DiscoverInfo> services = findServicesDiscoverInfo(feature, stopOnFirst, useCache);
|
||||
|
@ -939,7 +939,7 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
|
||||
/**
|
||||
* Loads the ServiceDiscoveryManager with an EntityCapsManger that speeds up certain lookups.
|
||||
*
|
||||
*
|
||||
* @param manager
|
||||
*/
|
||||
public void setEntityCapsManager(EntityCapsManager manager) {
|
||||
|
|
|
@ -32,10 +32,10 @@ import org.jivesoftware.smack.util.XmlStringBuilder;
|
|||
import org.jxmpp.util.XmppStringUtils;
|
||||
|
||||
/**
|
||||
* A DiscoverInfo IQ packet, which is used by XMPP clients to request and receive information
|
||||
* to/from other XMPP entities.<p>
|
||||
*
|
||||
* The received information may contain one or more identities of the requested XMPP entity, and
|
||||
* A DiscoverInfo IQ packet, which is used by XMPP clients to request and receive information
|
||||
* to/from other XMPP entities.<p>
|
||||
*
|
||||
* The received information may contain one or more identities of the requested XMPP entity, and
|
||||
* a list of supported features by the requested XMPP entity.
|
||||
*
|
||||
* @author Gaston Dombiak
|
||||
|
@ -58,7 +58,7 @@ public class DiscoverInfo extends IQ implements TypedCloneable<DiscoverInfo> {
|
|||
|
||||
/**
|
||||
* Copy constructor.
|
||||
*
|
||||
*
|
||||
* @param d
|
||||
*/
|
||||
public DiscoverInfo(DiscoverInfo d) {
|
||||
|
@ -120,7 +120,7 @@ public class DiscoverInfo extends IQ implements TypedCloneable<DiscoverInfo> {
|
|||
|
||||
/**
|
||||
* Adds a new identity of the requested entity to the discovered information.
|
||||
*
|
||||
*
|
||||
* @param identity the discovered entity's identity
|
||||
*/
|
||||
public void addIdentity(Identity identity) {
|
||||
|
@ -130,7 +130,7 @@ public class DiscoverInfo extends IQ implements TypedCloneable<DiscoverInfo> {
|
|||
|
||||
/**
|
||||
* Adds identities to the DiscoverInfo stanza.
|
||||
*
|
||||
*
|
||||
* @param identitiesToAdd
|
||||
*/
|
||||
public void addIdentities(Collection<Identity> identitiesToAdd) {
|
||||
|
@ -142,7 +142,7 @@ public class DiscoverInfo extends IQ implements TypedCloneable<DiscoverInfo> {
|
|||
|
||||
/**
|
||||
* Returns the discovered identities of an XMPP entity.
|
||||
*
|
||||
*
|
||||
* @return an unmodifiable list of the discovered identities
|
||||
*/
|
||||
public List<Identity> getIdentities() {
|
||||
|
@ -179,10 +179,10 @@ public class DiscoverInfo extends IQ implements TypedCloneable<DiscoverInfo> {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the node attribute that supplements the 'jid' attribute. A node is merely
|
||||
* something that is associated with a JID and for which the JID can provide information.<p>
|
||||
*
|
||||
* Node attributes SHOULD be used only when trying to provide or query information which
|
||||
* Returns the node attribute that supplements the 'jid' attribute. A node is merely
|
||||
* something that is associated with a JID and for which the JID can provide information.<p>
|
||||
*
|
||||
* Node attributes SHOULD be used only when trying to provide or query information which
|
||||
* is not directly addressable.
|
||||
*
|
||||
* @return the node attribute that supplements the 'jid' attribute
|
||||
|
@ -192,12 +192,12 @@ public class DiscoverInfo extends IQ implements TypedCloneable<DiscoverInfo> {
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the node attribute that supplements the 'jid' attribute. A node is merely
|
||||
* something that is associated with a JID and for which the JID can provide information.<p>
|
||||
*
|
||||
* Node attributes SHOULD be used only when trying to provide or query information which
|
||||
* Sets the node attribute that supplements the 'jid' attribute. A node is merely
|
||||
* something that is associated with a JID and for which the JID can provide information.<p>
|
||||
*
|
||||
* Node attributes SHOULD be used only when trying to provide or query information which
|
||||
* is not directly addressable.
|
||||
*
|
||||
*
|
||||
* @param node the node attribute that supplements the 'jid' attribute
|
||||
*/
|
||||
public void setNode(String node) {
|
||||
|
@ -206,7 +206,7 @@ public class DiscoverInfo extends IQ implements TypedCloneable<DiscoverInfo> {
|
|||
|
||||
/**
|
||||
* Returns true if the specified feature is part of the discovered information.
|
||||
*
|
||||
*
|
||||
* @param feature the feature to check
|
||||
* @return true if the requests feature has been discovered
|
||||
*/
|
||||
|
@ -230,7 +230,7 @@ public class DiscoverInfo extends IQ implements TypedCloneable<DiscoverInfo> {
|
|||
|
||||
/**
|
||||
* Test if a DiscoverInfo response contains duplicate identities.
|
||||
*
|
||||
*
|
||||
* @return true if duplicate identities where found, otherwise false
|
||||
*/
|
||||
public boolean containsDuplicateIdentities() {
|
||||
|
@ -247,7 +247,7 @@ public class DiscoverInfo extends IQ implements TypedCloneable<DiscoverInfo> {
|
|||
|
||||
/**
|
||||
* Test if a DiscoverInfo response contains duplicate features.
|
||||
*
|
||||
*
|
||||
* @return true if duplicate identities where found, otherwise false
|
||||
*/
|
||||
public boolean containsDuplicateFeatures() {
|
||||
|
@ -262,11 +262,11 @@ public class DiscoverInfo extends IQ implements TypedCloneable<DiscoverInfo> {
|
|||
/**
|
||||
* Represents the identity of a given XMPP entity. An entity may have many identities but all
|
||||
* the identities SHOULD have the same name.<p>
|
||||
*
|
||||
*
|
||||
* Refer to <a href="http://www.jabber.org/registrar/disco-categories.html">Jabber::Registrar</a>
|
||||
* in order to get the official registry of values for the <i>category</i> and <i>type</i>
|
||||
* in order to get the official registry of values for the <i>category</i> and <i>type</i>
|
||||
* attributes.
|
||||
*
|
||||
*
|
||||
*/
|
||||
public static class Identity implements Comparable<Identity>, TypedCloneable<Identity> {
|
||||
|
||||
|
@ -286,7 +286,7 @@ public class DiscoverInfo extends IQ implements TypedCloneable<DiscoverInfo> {
|
|||
|
||||
/**
|
||||
* Creates a new identity for an XMPP entity.
|
||||
*
|
||||
*
|
||||
* @param category the entity's category (required as per XEP-30).
|
||||
* @param type the entity's type (required as per XEP-30).
|
||||
*/
|
||||
|
@ -296,9 +296,9 @@ public class DiscoverInfo extends IQ implements TypedCloneable<DiscoverInfo> {
|
|||
|
||||
/**
|
||||
* Creates a new identity for an XMPP entity.
|
||||
* 'category' and 'type' are required by
|
||||
* 'category' and 'type' are required by
|
||||
* <a href="http://xmpp.org/extensions/xep-0030.html#schemas">XEP-30 XML Schemas</a>
|
||||
*
|
||||
*
|
||||
* @param category the entity's category (required as per XEP-30).
|
||||
* @param name the entity's name.
|
||||
* @param type the entity's type (required as per XEP-30).
|
||||
|
@ -309,9 +309,9 @@ public class DiscoverInfo extends IQ implements TypedCloneable<DiscoverInfo> {
|
|||
|
||||
/**
|
||||
* Creates a new identity for an XMPP entity.
|
||||
* 'category' and 'type' are required by
|
||||
* 'category' and 'type' are required by
|
||||
* <a href="http://xmpp.org/extensions/xep-0030.html#schemas">XEP-30 XML Schemas</a>
|
||||
*
|
||||
*
|
||||
* @param category the entity's category (required as per XEP-30).
|
||||
* @param type the entity's type (required as per XEP-30).
|
||||
* @param name the entity's name.
|
||||
|
@ -326,8 +326,8 @@ public class DiscoverInfo extends IQ implements TypedCloneable<DiscoverInfo> {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the entity's category. To get the official registry of values for the
|
||||
* 'category' attribute refer to <a href="http://www.jabber.org/registrar/disco-categories.html">Jabber::Registrar</a>
|
||||
* Returns the entity's category. To get the official registry of values for the
|
||||
* 'category' attribute refer to <a href="http://www.jabber.org/registrar/disco-categories.html">Jabber::Registrar</a>
|
||||
*
|
||||
* @return the entity's category.
|
||||
*/
|
||||
|
@ -345,8 +345,8 @@ public class DiscoverInfo extends IQ implements TypedCloneable<DiscoverInfo> {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the entity's type. To get the official registry of values for the
|
||||
* 'type' attribute refer to <a href="http://www.jabber.org/registrar/disco-categories.html">Jabber::Registrar</a>
|
||||
* Returns the entity's type. To get the official registry of values for the
|
||||
* 'type' attribute refer to <a href="http://www.jabber.org/registrar/disco-categories.html">Jabber::Registrar</a>
|
||||
*
|
||||
* @return the entity's type.
|
||||
*/
|
||||
|
@ -356,7 +356,7 @@ public class DiscoverInfo extends IQ implements TypedCloneable<DiscoverInfo> {
|
|||
|
||||
/**
|
||||
* Returns the identities natural language if one is set.
|
||||
*
|
||||
*
|
||||
* @return the value of xml:lang of this Identity
|
||||
*/
|
||||
public String getLanguage() {
|
||||
|
@ -389,11 +389,11 @@ public class DiscoverInfo extends IQ implements TypedCloneable<DiscoverInfo> {
|
|||
return xml;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Check equality for Identity for category, type, lang and name
|
||||
* in that order as defined by
|
||||
* <a href="http://xmpp.org/extensions/xep-0115.html#ver-proc">XEP-0015 5.4 Processing Method (Step 3.3)</a>.
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
|
@ -434,7 +434,7 @@ public class DiscoverInfo extends IQ implements TypedCloneable<DiscoverInfo> {
|
|||
* Compares this identity with another one. The comparison order is: Category, Type, Lang.
|
||||
* If all three are identical the other Identity is considered equal. Name is not used for
|
||||
* comparison, as defined by XEP-0115
|
||||
*
|
||||
*
|
||||
* @param other
|
||||
* @return a negative integer, zero, or a positive integer as this object is less than,
|
||||
* equal to, or greater than the specified object.
|
||||
|
@ -473,8 +473,8 @@ public class DiscoverInfo extends IQ implements TypedCloneable<DiscoverInfo> {
|
|||
|
||||
/**
|
||||
* Represents the features offered by the item. This information helps the requester to determine
|
||||
* what actions are possible with regard to this item (registration, search, join, etc.)
|
||||
* as well as specific feature types of interest, if any (e.g., for the purpose of feature
|
||||
* what actions are possible with regard to this item (registration, search, join, etc.)
|
||||
* as well as specific feature types of interest, if any (e.g., for the purpose of feature
|
||||
* negotiation).
|
||||
*/
|
||||
public static class Feature implements TypedCloneable<Feature> {
|
||||
|
@ -491,7 +491,7 @@ public class DiscoverInfo extends IQ implements TypedCloneable<DiscoverInfo> {
|
|||
|
||||
/**
|
||||
* Creates a new feature offered by an XMPP entity or item.
|
||||
*
|
||||
*
|
||||
* @param variable the feature's variable.
|
||||
*/
|
||||
public Feature(String variable) {
|
||||
|
|
|
@ -27,10 +27,10 @@ import org.jivesoftware.smack.util.XmlStringBuilder;
|
|||
import org.jxmpp.jid.Jid;
|
||||
|
||||
/**
|
||||
* A DiscoverItems IQ packet, which is used by XMPP clients to request and receive items
|
||||
* A DiscoverItems IQ packet, which is used by XMPP clients to request and receive items
|
||||
* associated with XMPP entities.<p>
|
||||
*
|
||||
* The items could also be queried in order to discover if they contain items inside. Some items
|
||||
*
|
||||
* The items could also be queried in order to discover if they contain items inside. Some items
|
||||
* may be addressable by its JID and others may require to be addressed by a JID and a node name.
|
||||
*
|
||||
* @author Gaston Dombiak
|
||||
|
@ -49,7 +49,7 @@ public class DiscoverItems extends IQ {
|
|||
|
||||
/**
|
||||
* Adds a new item to the discovered information.
|
||||
*
|
||||
*
|
||||
* @param item the discovered entity's item
|
||||
*/
|
||||
public void addItem(Item item) {
|
||||
|
@ -70,7 +70,7 @@ public class DiscoverItems extends IQ {
|
|||
|
||||
|
||||
/**
|
||||
* Returns the discovered items of the queried XMPP entity.
|
||||
* Returns the discovered items of the queried XMPP entity.
|
||||
*
|
||||
* @return an unmodifiable list of the discovered entity's items
|
||||
*/
|
||||
|
@ -79,10 +79,10 @@ public class DiscoverItems extends IQ {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the node attribute that supplements the 'jid' attribute. A node is merely
|
||||
* something that is associated with a JID and for which the JID can provide information.<p>
|
||||
*
|
||||
* Node attributes SHOULD be used only when trying to provide or query information which
|
||||
* Returns the node attribute that supplements the 'jid' attribute. A node is merely
|
||||
* something that is associated with a JID and for which the JID can provide information.<p>
|
||||
*
|
||||
* Node attributes SHOULD be used only when trying to provide or query information which
|
||||
* is not directly addressable.
|
||||
*
|
||||
* @return the node attribute that supplements the 'jid' attribute
|
||||
|
@ -92,12 +92,12 @@ public class DiscoverItems extends IQ {
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the node attribute that supplements the 'jid' attribute. A node is merely
|
||||
* something that is associated with a JID and for which the JID can provide information.<p>
|
||||
*
|
||||
* Node attributes SHOULD be used only when trying to provide or query information which
|
||||
* Sets the node attribute that supplements the 'jid' attribute. A node is merely
|
||||
* something that is associated with a JID and for which the JID can provide information.<p>
|
||||
*
|
||||
* Node attributes SHOULD be used only when trying to provide or query information which
|
||||
* is not directly addressable.
|
||||
*
|
||||
*
|
||||
* @param node the node attribute that supplements the 'jid' attribute
|
||||
*/
|
||||
public void setNode(String node) {
|
||||
|
@ -117,11 +117,11 @@ public class DiscoverItems extends IQ {
|
|||
}
|
||||
|
||||
/**
|
||||
* An item is associated with an XMPP Entity, usually thought of a children of the parent
|
||||
* entity and normally are addressable as a JID.<p>
|
||||
*
|
||||
* An item associated with an entity may not be addressable as a JID. In order to handle
|
||||
* such items, Service Discovery uses an optional 'node' attribute that supplements the
|
||||
* An item is associated with an XMPP Entity, usually thought of a children of the parent
|
||||
* entity and normally are addressable as a JID.<p>
|
||||
*
|
||||
* An item associated with an entity may not be addressable as a JID. In order to handle
|
||||
* such items, Service Discovery uses an optional 'node' attribute that supplements the
|
||||
* 'jid' attribute.
|
||||
*/
|
||||
public static class Item {
|
||||
|
@ -143,7 +143,7 @@ public class DiscoverItems extends IQ {
|
|||
|
||||
/**
|
||||
* Create a new Item associated with a given entity.
|
||||
*
|
||||
*
|
||||
* @param entityID the id of the entity that contains the item
|
||||
*/
|
||||
public Item(Jid entityID) {
|
||||
|
@ -178,10 +178,10 @@ public class DiscoverItems extends IQ {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the node attribute that supplements the 'jid' attribute. A node is merely
|
||||
* something that is associated with a JID and for which the JID can provide information.<p>
|
||||
*
|
||||
* Node attributes SHOULD be used only when trying to provide or query information which
|
||||
* Returns the node attribute that supplements the 'jid' attribute. A node is merely
|
||||
* something that is associated with a JID and for which the JID can provide information.<p>
|
||||
*
|
||||
* Node attributes SHOULD be used only when trying to provide or query information which
|
||||
* is not directly addressable.
|
||||
*
|
||||
* @return the node attribute that supplements the 'jid' attribute
|
||||
|
@ -191,12 +191,12 @@ public class DiscoverItems extends IQ {
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the node attribute that supplements the 'jid' attribute. A node is merely
|
||||
* something that is associated with a JID and for which the JID can provide information.<p>
|
||||
*
|
||||
* Node attributes SHOULD be used only when trying to provide or query information which
|
||||
* Sets the node attribute that supplements the 'jid' attribute. A node is merely
|
||||
* something that is associated with a JID and for which the JID can provide information.<p>
|
||||
*
|
||||
* Node attributes SHOULD be used only when trying to provide or query information which
|
||||
* is not directly addressable.
|
||||
*
|
||||
*
|
||||
* @param node the node attribute that supplements the 'jid' attribute
|
||||
*/
|
||||
public void setNode(String node) {
|
||||
|
@ -204,11 +204,11 @@ public class DiscoverItems extends IQ {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the action that specifies the action being taken for this item. Possible action
|
||||
* values are: "update" and "remove". Update should either create a new entry if the node
|
||||
* and jid combination does not already exist, or simply update an existing entry. If
|
||||
* Returns the action that specifies the action being taken for this item. Possible action
|
||||
* values are: "update" and "remove". Update should either create a new entry if the node
|
||||
* and jid combination does not already exist, or simply update an existing entry. If
|
||||
* "remove" is used as the action, the item should be removed from persistent storage.
|
||||
*
|
||||
*
|
||||
* @return the action being taken for this item
|
||||
*/
|
||||
public String getAction() {
|
||||
|
@ -216,11 +216,11 @@ public class DiscoverItems extends IQ {
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the action that specifies the action being taken for this item. Possible action
|
||||
* values are: "update" and "remove". Update should either create a new entry if the node
|
||||
* and jid combination does not already exist, or simply update an existing entry. If
|
||||
* Sets the action that specifies the action being taken for this item. Possible action
|
||||
* values are: "update" and "remove". Update should either create a new entry if the node
|
||||
* and jid combination does not already exist, or simply update an existing entry. If
|
||||
* "remove" is used as the action, the item should be removed from persistent storage.
|
||||
*
|
||||
*
|
||||
* @param action the action being taken for this item
|
||||
*/
|
||||
public void setAction(String action) {
|
||||
|
|
|
@ -21,14 +21,14 @@ import org.jivesoftware.smack.SmackException;
|
|||
public abstract class FileTransferException extends SmackException {
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class NoStreamMethodsOfferedException extends FileTransferException {
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
@ -37,7 +37,7 @@ public abstract class FileTransferException extends SmackException {
|
|||
public static class NoAcceptableTransferMechanisms extends FileTransferException {
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue