summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTarun Gupta <tarun1995gupta@gmail.com>2015-07-15 23:49:56 (GMT)
committerNick Hudson <nick.hudson@isode.com>2015-07-28 15:42:52 (GMT)
commit251813ccca9404d8d4122b2848f9fec86a451bf5 (patch)
treea1ebb0f6a04547ef6b588ea85c1a50ea5d8e4997 /src/com/isode/stroke/client
parent673655830b0325d964e67fa835ea83f485e9beeb (diff)
downloadstroke-251813ccca9404d8d4122b2848f9fec86a451bf5.zip
stroke-251813ccca9404d8d4122b2848f9fec86a451bf5.tar.bz2
Completes Components and AdHoc.
Adds Component, ComponentConnector, ComponentError, ComponentSession, ComponentXMLTracer, CoreComponent, ComponentSessionStanzaChannel, ComponentXMTracer, CoreComponent. Updates CoreClient, StrokeGUI, BasicSessionStream and SessionStream and Client, so that signal definition can be changed. Updates ComponentHandshake element, Entity. Updates OutgoingAdHocCommandSession to have feature parity with Swiften. This patch does not port Client or Session fully, which will be done in separate future patches. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Test added for ComponentSession, which passes. Test for ComponentConnector cannot be ported right now and will be done in future patches, as it requires some bits of Network to be ported. Change-Id: I7138a2041fe28a2be7ac57cb47b15365f9334b24
Diffstat (limited to 'src/com/isode/stroke/client')
-rw-r--r--src/com/isode/stroke/client/CoreClient.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/com/isode/stroke/client/CoreClient.java b/src/com/isode/stroke/client/CoreClient.java
index 84ea673..efefa1c 100644
--- a/src/com/isode/stroke/client/CoreClient.java
+++ b/src/com/isode/stroke/client/CoreClient.java
@@ -5,6 +5,7 @@
package com.isode.stroke.client;
import com.isode.stroke.base.NotNull;
+import com.isode.stroke.base.SafeByteArray;
import com.isode.stroke.elements.Message;
import com.isode.stroke.elements.Presence;
import com.isode.stroke.elements.Stanza;
@@ -58,13 +59,13 @@ public class CoreClient {
* The user may add a listener to this signal, which will be called when
* data are received from the server. Useful for observing protocol exchange.
*/
- public final Signal1<String> onDataRead = new Signal1<String>();
+ public final Signal1<SafeByteArray> onDataRead = new Signal1<SafeByteArray>();
/**
* The user may add a listener to this signal, which will be called when
* data are sent to the server. Useful for observing protocol exchange.
*/
- public final Signal1<String> onDataWritten = new Signal1<String>();
+ public final Signal1<SafeByteArray> onDataWritten = new Signal1<SafeByteArray>();
/**
* Called when a message stanza is received.
@@ -249,16 +250,16 @@ public class CoreClient {
if (certificate_ != null && !certificate_.isNull()) {
sessionStream_.setTLSCertificate(certificate_);
}
- sessionStreamDataReadConnection_ = sessionStream_.onDataRead.connect(new Slot1<String>() {
+ sessionStreamDataReadConnection_ = sessionStream_.onDataRead.connect(new Slot1<SafeByteArray>() {
- public void call(String p1) {
+ public void call(SafeByteArray p1) {
handleDataRead(p1);
}
});
- sessionStreamDataWrittenConnection_ = sessionStream_.onDataWritten.connect(new Slot1<String>() {
+ sessionStreamDataWrittenConnection_ = sessionStream_.onDataWritten.connect(new Slot1<SafeByteArray>() {
- public void call(String p1) {
+ public void call(SafeByteArray p1) {
handleDataWritten(p1);
}
});
@@ -421,11 +422,11 @@ public class CoreClient {
session_.sendCredentials(password_);
}
- private void handleDataRead(final String data) {
+ private void handleDataRead(final SafeByteArray data) {
onDataRead.emit(data);
}
- private void handleDataWritten(final String data) {
+ private void handleDataWritten(final SafeByteArray data) {
onDataWritten.emit(data);
}