summaryrefslogtreecommitdiffstats
path: root/src/com
AgeCommit message (Collapse)Author
2016-03-16Add destroy methods to IncomingJingleFileTransfer and ↵Alex Clayton
OutgoingJingleFileTransfer. Add destroy methods to IncomingJingleFileTransfer and OutgoingJingeFlieTranser to match the destructors of the swiften code (as of patch 'Add missing Timer related cleanup code' - 52e685379436794cc0e4c2687c35f5e69a2f09a7). Test-information: Unit tests ran ok. Change-Id: Ie86c5fc74f66d9c62095045475eb6d9447c7699e
2016-03-15Add destroy method to WhitespacePingLayer.Alex Clayton
Add a destroy method to the WhitespacePingLayer to act like the destructor introduced in swiften patch 'Stop timer during clean up of WhitespacePingLayer' (f377207cb896679b4eab9f6773d9d071700852ad). Test-information: Unit tests still pass ok. Change-Id: I4fca19c3d3b5f120102727db10b046904da848a4
2016-03-15Add getRemoteAddress() method to Connection.Alex Clayton
Added a getRemoteAddress() method to connection as per patch 'Listen to IPv6 any address instead of only IPv4' (13801557b6664426cac26384441ab0b19ff9abb5). Also some modifications to SOCKS5BytestreamServerManager to use IPv6 address. Test-information: Unit tests pass ok. Change-Id: Ic0536745db9052ec1c5fc0832ed90eb5ec609429
2016-03-15Add description to FileTransferAlex Clayton
As per patch 'Show file-transfer description if provided' (523dbfb769069663eda19e381ad35f466b1ef27c) add a description field to the FileTransfer interface and its implementations. Test-information: Unit test still pass ok. Change-Id: I146e2adce67a491ae0381154e54d6d0e480026a2
2016-03-15Only calculate S5B candidates if supported by recipientAlex Clayton
As per swiften patch of the same name (e9ed818dac91e280eb8da86dc8494710f1da0624), some changes to FileTransferMangerImpl on how it creates an Outgoing File Transfer. Also added a copy constructor to FileTransferOption that had been in swiften but was not yet implemented in stroke. Change-Id: I314ac5ef7f8e082c7121ad89c012b84569f98d6c Test-information: Unit tests still pass.
2016-03-15Fix handling when client certificate is missingAlex Clayton
As per patch 'Fix swiften handling when client certificate is missing' (8405fa16b738b6ef6a5920cd9d0f5735f8b62369). Change-Id: Iec5036213d8432a3af78647470381485bfcc01e3 Test-information: Code inspection. Unit tests still pass.
2016-03-14Add getter for TLSContext in TLSConnection.Alex Clayton
As per patch 4a6950af0f324091553f7ab7271de45721b8667f (Rest of patch is for implementing TLS on OSX so no need to port). Test-information: Code inspection. Unit tests still all pass ok. Change-Id: I62b2f32f3cba0caa7db84f2806cd49b1a7a202e4
2016-03-14Add FileTransfer.getState methodAlex Clayton
As per swiften patch of same name (cb62de17d1e17fd3049a6bc8155a100574a42a85) add getState() method to FileTransfer interface. Test-information: Unit tests pass ok. Change-Id: I27db4e60c3a8df251b813c90fc4a2e029762082d
2016-03-14Add methods to PresenceOracle.Alex Clayton
As per swiften patch 'Change bare JID presence lookup code to ignore priorities' (0f5ef716a50c8d9761cafda12aacf818cdfd6353) add a couple of methods and a test for PresenceOracle. Test-information: Unit tests still pass. Change-Id: If3961f29be821a065ffa854faeab7f20da666d25
2016-03-14Add roster to PresenceOracle.Alex Clayton
As per patch 'Mark removed contacts as unavailable in Swift' (9e6ee0f262e7dc663f4c706b16a346a268f425aa) added an XMPPRoster to the member variables and constructor arguments for PresenceOracle. Test-information: Unit tests pass. Change-Id: I062d256c088a968e061d864fbd1386f850b614a7
2016-03-14Fix singal disconnections in DiscoServiceWalker.Alex Clayton
Fix how DiscoServiceWalker handles it disconnections from the discoInfoRequests and discoItemsRequest, as per swiften patch 'Fix memory leak warnings by Valgrind/LSAN' (b00c84574fc730eeeabb57df1f17b54855218193). Test-information: Unit tests pass ok. Change-Id: If47dca0f89822b0bf1da8dab1a3113a969f1c396
2016-03-14Do not flush VCard cache if IQ request returns an error.Alex Clayton
As per swiften patch of the same name (37aafcb4d693a0b4f5944a52e0c070e5aa384245) changes behaviour of VCard cache slightly, and updates test accordingly. Test-information: Unit tests pass. Change-Id: I933c8000b4cb73b43db28db94887a768d0272dd2
2016-03-10Fix BlockListImpl logic and add unit test.Alex Clayton
As per swiften patch 'Fix notification logic for signals in BlockListImpl' (4455c20085834098f6d9aa872db3115d466e7004). Fix the logic in the BlockListImpl class and add a unit test for it. Test-information: Unit tests pass ok. Change-Id: I739d1febb2cf728ff00c132a00adb2f7f144b739
2016-03-09Add Whiteboard FunctionalityAlex Clayton
Add the Whiteboard classes to stroke. Test-information: Unit tests all pass. Change-Id: Id409c09d0fc1f82864e5d706c413b9d984a7db82
2016-03-07Add missing TLS and Base classesAlex Clayton
Add missing methods and classes in the TLS and Base packages where possible. In the case of TLSContextFactory the methods could not be implemented in java so added a not saying they are not supported in java. Test-information: Unit tests still build and run ok. Change-Id: I9be2035f092875fcdc02644a3c0082739f26949a
2016-02-29Add BOSHSessionStream classAlex Clayton
Add the BOSHSessionStream class to stroke. Also tidy up PortingProgress.txt there were some files it was saying had not been imported when they had. Test-information: Code inspection as there are no unit tests for the new code. Sanity test all existing unit tests pass. Change-Id: Ia049a008f0d2c39c23f5752aa7740b10f48aa397
2016-02-29Finish porting on Network PackageAlex Clayton
As per PortingProgress.txt finsh porting all the classes I can from the network package. This involved some updates as the tests and code had changed since they existing classes had been imported. I have added notes for the classes I did not port in PortingProgress explaining why they were not ported. Test-information: All unit tests pass. Change-Id: Ibb52ae409f1da9b72a4c1e590cd22835a1be95eb
2016-02-29Add sort method for ServiceQuery and add TestsAlex Clayton
Add the sortResult static method to the DomainNameServiceQuery class. This required adding a few equivalances for C++ std library methods to the class. And add a test for the new method too. Test-information: All unit tests pass ok. Change-Id: Idee0888f7ea140d35a971414fc2fd3cbcdfc337f
2016-02-29Add Network Bosh ClassesAlex Clayton
Add the missing Bosh classes to the network packages (BoshConnection and BoshConnectionPool), plus tests for the classes and any other classes required by the new classes. Test-information: Units tests all pass ok. Change-Id: I5c2e05bae9e678ac10d2601c7fdbdccd68d66b71
2016-02-16Add the FileTransfer testsAlex Clayton
Add the missing FileTransfer tests to stroke. When porting the tests I found some of them were failing and required changes to the classes being tested to fix. Had to add a DummyNetworkEnvironment as well for the OutgoingJingleFileTransferTest. Test-information: All unit tests pass. Change-Id: Id511a556ef3a5d66e0e107f36f736db3bbb3a437
2016-02-09Finish porting S5BTransportSessionAlex Clayton
Finish porting S5BTransportSession to Stroke (previously a lot of it had been commented out). To do so had to introduce a heirachy to the SOCKS5BytestreamSession classes (which were being used as type parameters for the Transport Session) and refactor some of the onByteSent signals to insure they were all of the same type (Integer). Also update PortingProgress.txt to update to give status of some of the porting files. Test-information: Ran unit tests they all still pass. Change-Id: I4295b3a8829c208e65f5a46d19c35090f8c55865
2016-02-08Add CombinedAvatarProviderTestAlex Clayton
Adds the CombinedAvatarProviderTest class. When I was adding the test I noticed that testProviderUpdateWithAvatarDisappearingTriggersChange kept failing due to a bug in the CombinedAvatarProvider class and testRemoveProviderDisconnectsUpdates could not be implemented as the class was incomplete. I had to make some changes to CombinedAvatarProvider to fix these issues. Test-information: Ran unit tests they all pass. Change-Id: I0bfb68dd2b15df0f220f36c136aceadaf6545893
2016-02-04Add Block Parser and SerializerAlex Clayton
Add BlockParser and BlockSerializer for the block payload classes. This required slightly different approach to the Swiften code as C++ templates are different to Java generics. In short needed to add a type hierachy to the Block payload classes and to the Parsers and Serilaizers associated with them. Test-information: Ran unit tests everything passed ok. Change-Id: I3ea2d66afd7cb3b5c4c3515be3a1ef99d7dbb566
2016-02-02Update FullPayloadSerializerCollectionAlex Clayton
Updates the FullPayloadSerializerCollection and FullPayloadParserSerializerCollection to bring it inline with the Swiften classes. This included reordering the elements so they are in the same order as the Swiften class (so its easier to see classes that are missing), and adding ones that were missing. For ones where no Java implemenation exits yet the line is added but commented out. Test-information: Sanity test, ran unit tests all test still pass. Change-Id: I318c8da577f638f4d799fabdfc09a3afa7fcb608
2016-02-01Add S5BProxyRequest Serializers and ParserAlex Clayton
Adds a S5BProxyRequestParser and a S5BProxyRequestSerializer to stroke based on the Swiften classes of the same name. These has been missed out previous stroke patches for some reason. Test-information: Code inspection against the Swifen classes. Sanity test ran the unit tests for stroke they still all pass (note I could not find any unit tests for this class to transfer from Swiften). Change-Id: Ic5463169ada33c72127e87a416d42a650aad6399
2016-01-28Changes to FileTransfer to be inline with current Swiften codeAlex Clayton
There has been some changes to the file transfer clases in Swiften since Tarun's patch was written. This patch updates the java classes to bring them in line with the swiften one. In details IBBSendSession - added code to clean up onResponse connection when not needed. In Swiften this was done by keeping reference to current session using boost bindings to remove binding. In java we have to keep a reference to the current onResponse connection and disconnect it when not neeeded. IncomingFileTransferManager - Remove redundant IQRouter field. LocalJingeTransportCandidateGenerator - Do not advertise link-local IPv6 addresses in FT candidates OutgoingSIFileTransfer - File deleted SOCKS5BytestreamProxiesManager and SOCKS5BytestreamProxyFinder - Search for all proxies instead of just one. Test-information: Ran make and make test to check everything built ok and that the unit tests still passed. Change-Id: I696444e5074fe20625243693a44c836306b3a41e
2016-01-27Some fixes for File Transfer PatchAlex Clayton
Some fixes that were required for the File Transfer Patch (see patch notes on Gerrit). Test-information: By code inspection. Ran against MLC (after modification so it works for stroke interface changes introduces in a previous patch) it still runs correctly. Ran unit tests they still all pass. Change-Id: Ib49d9f9160f5e6b6b578f16695f8e8bc0f96a412
2016-01-21Completes FileTransfer according to Swiften.Tarun Gupta
S5BTransport Session still needs generic T. FileTransfer, OutgoingFileTransfer and IncomingFileTransfer are made an interface due to the need of multiple inheritance in IncomingJingleFileTransfer and OutgoingJingleFileTransfer. Corresponding documentation has been updated. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: None. Change-Id: If44cf387767865c37492d871c12d623f94ebaa3a
2016-01-18Some Jingle FixesAlex Clayton
Some fixes to the Jingle classes for the previous patch. Test-information: By code inspection. Ran Unit Tests there were no failures. Change-Id: I61210dd1ec2c7e0dd11d67a45a0ced63952804c7
2016-01-14Completes Jingle.Tarun Gupta
Adds Listenable, JingleSession, JingleContentID, FakeJingleSession, JingleSessionListener, JingleSessionManager, JingleResponder. NotifyListeners are not in line with Swiften and have to be corrected. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: None. Change-Id: I6533b2be02a0843277a63ca115348ff6138a0fc0
2016-01-14Minor changes to PubSubManagerImpl and StanzaAckRequester.Tarun Gupta
Small changes to PubSubManagerImpl and StanzaAckRequester making them equivalent with Swiften. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Added tests for StanzaAckResponder and StanzaAckRequester, which passes. Change-Id: I99878fc6552ed18e353848a0cea6584c26b2ba0c
2016-01-14More Changes to NetworksAlex Clayton
Some more changes to the Networks classes. Based on comments on the last patch. Test-information: No longer see crash I was seeing when I ran the updated Stroke against MLC. Ran unit tests. Change-Id: Id577e5322bab0ec48f0353907f82e72bc93b848a
2016-01-12Make Networks equivalent with Swiften.Tarun Gupta
Adds ProxyProviders, DomainNameResolvers and DummyConnection. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tests added for ChainedConnector, Connector and HostAddress. Test also added for ComponentConnector, which needed bits of Network. Five assertions are commented in ConnectorTest, which fails and will be updated after review. Change-Id: I8a62841eb2f9c109bc3a94865b7a003b33493e11
2015-09-17Do not override system default time-zone.Alan Young
Remove calls to TimeZone.setDefault(). Whatever problem the changes that introduced these calls were supposed to solve, overriding the system default timezone is not the right solution. Change-Id: I626419a1c00fe9d68df0c63472d4433e12502acb
2015-09-11Add JavaConnection.ActivityWatcher for watching connection activity.Alan Young
If a JavaConnection is supplied with a JavaConnection.ActivityWatcher at creation time, then each of its Worker threads will signal when they become active and when they potentially go to sleep (on select()). This allows clients to manage a device's power state or any other suitable subsystem. Change-Id: I3c83cb8ce5a087dd6fc5d402c75f830f5deca282
2015-09-11Improve efficiency of JavaConnection reads.Alan Young
Given that doRead() ends up populating a SafeByteArray as part of the result is is more efficient to pass an empty SafeByteArray to doRead() and push each chunk of data read directly to the it rather than use an intermediate ByteArrayOutputStream. SafeByteArray.getData() will do any concatenation necessary. It is unnecessarily inefficient to use a class instance to return the connection status from doRead. Remove JavaConnection.ReadResult. Change-Id: I6c8dc000d9030d3929c71444eb5b489df93f1987
2015-09-11Make JavaConnection fully event driven - no 100ms spinAlan Young
Refactor JavaConnection to make it fully event-driven via select for both reads and writes. Remove the 100ms spin when there are pending writes. Encapslate all the management of the select mask and the write queue within Worker and protect via a common lock. Change-Id: I1a709f9b12a949448923f51c2d434746c9190c9d
2015-08-26Add the missing initialisation for authenticator for SASL ExternalGurmeen Bindra
Missing initialisation for client authenticator for SASL external was causing null pointer exceptions. This patch corrects it by initialising the authenticator as is done in swiften. Test-information: tested using an XMPP admin client that does SASL External Change-Id: I321b425c1c28e0424effd9cb974980c392e48b68
2015-08-21Fix code to not throw StringPrepParseException that was part of ICU jarGurmeen Bindra
The IDNConverter interface now throws java strandard IllegalArg exception instead of the ICU specific StringPrepParseException. Users of stroke that are not using ICU will now be able to use it without the icu jar. Test-information: Sanity tested by connecting to an XMPP server using an XMPP client Change-Id: I6999ae0c690b70bc748f131908a758a01dac20b9
2015-08-21Correct ClientSession.finish()Alan Young
The default, clean finish() method needs to set up no error, not a null instance of Error.Type (with type field == null). Change-Id: I6912392b226dd84c411e2369844b9aee656d2e6f
2015-08-20Fix NPE in Stanza.getTimestampFrom() when Delay.getFrom() returns nullAlan Young
Change-Id: I2ccf6ae1293859dc8bd49731ee55a90b383d30a8
2015-08-19Handle case SessionStream.getTLSFinishMessage() returns null.Alan Young
Change-Id: I41924cdd6d32deb9d47b47a3fc7ffb3b55947029
2015-08-17Remove unnecessary Crypto functions from StringCodecs.Tarun Gupta
Remove SHA1 and HMACSHA1 from StringCodecs as they are already provided by CryptoProvider, and is equivalent to Swiften. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Add tests for Base64 and PBKDF2, which passes. Change-Id: Ife05f185a10a79c9d69a12235f1b0397d022d992
2015-08-17Update Client.Tarun Gupta
Updates all bits of Client to be in parity with Swiften. Some part of code which depends on Network is commented. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tests added for: ClientBlockListManager, ClientSession and NickResolver. All tests pass. Change-Id: I5b9b0e5ae5b2df58202e2349ba24e4544d9a4614
2015-08-17Updates Presence in accordance with Swiften.Tarun Gupta
Updates DirectedPresenceSender, PayloadAddingPresenceSender, PresenceOracle and SubscriptionManager. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tests added for: DirectedPresenceSenderTest, PayloadAddingPresenceSenderTest and PresenceOracle. All tests pass. Change-Id: I9ad899965f5ac32c6f21805b530c234e391be6ba
2015-08-14Completes TLS & Session.Tarun Gupta
Adds TLSError and TLSOptions. Updates BasicSessionStream, SessionStream and Session. Updates Client and Components to accomodate changes in TLS. Also completes TLSLayer in StreamStack which was pending due to TLS port. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tests added for Certificate and ServerIdentityVerifier. Test updated for ComponentSession. All tests pass. Change-Id: I34a8fe068c1e8af5348cc4ab49d3d1ed118ae833
2015-08-13Revert pessimistic allocation of collection members in VCard.Alan Young
The way a VCard is used, pessimistic allocation puts an undue load on the Java GC. Change-Id: Ifced03a759783db2de911fc22dd40f6e475e5596
2015-08-13Add default-parameter versions of invitePerson() to MUC.Alan Young
Clean up imports. Add @Override annotations as appropraiate to MUCImpl and MockMUC. Change-Id: Id34849364fe1e4cdd7709b2cc7b397d007c2868c
2015-08-13Rework ByteArray implementationAlan Young
Use and ArrayList<byte[]> as the internal storage, instead of Vector<Byte>. Constructors and methods that supply a byte[] to add to the instance will have that value copied, rather than just taking ownership of the byte[]. There is an argument, on efficiency grounds, for providing methods that take ownership of the supplied argument. The earlier discussions about use of synchronization in the class are revisited. This is a low-level container that should be thread-safe or take precautions against non-thread-safe use. It is anticipated that the vast majority of uses will be thread-safe. Use of synchronization permits occasional deviations from this without imposing any significant overhead for the normal case - uncontended synchronization is close to free. Change-Id: Ifb7b2915d5c96345c53aec8e33673d892c430431
2015-08-13VCard.getPhoto() to return null for absent photo.Alan Young
Most of the time when VCard.getPhoto() is called it is only used to determine presence or absence of a photo. Thus, it makes no sense to allocate an empty ByteArray() just for this purpose. Return null instead, if absent. Change-Id: I3bae02ffbece5589c74c950bbb4c0db6c0376c76