summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTarun Gupta <tarun1995gupta@gmail.com>2015-07-24 17:01:42 (GMT)
committerNick Hudson <nick.hudson@isode.com>2015-08-14 15:32:08 (GMT)
commit0a1f7199e26523dd2693f44a5841c5434cc9000d (patch)
tree8f28ebb20fbe60f420ea25055955ac3d246db549 /src/com/isode/stroke/component
parentdc2b35bee48261e8b06e12bd82a434af118e035e (diff)
downloadstroke-0a1f7199e26523dd2693f44a5841c5434cc9000d.zip
stroke-0a1f7199e26523dd2693f44a5841c5434cc9000d.tar.bz2
Completes TLS & Session.
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
Diffstat (limited to 'src/com/isode/stroke/component')
-rw-r--r--src/com/isode/stroke/component/ComponentSession.java6
-rw-r--r--src/com/isode/stroke/component/CoreComponent.java8
2 files changed, 7 insertions, 7 deletions
diff --git a/src/com/isode/stroke/component/ComponentSession.java b/src/com/isode/stroke/component/ComponentSession.java
index 40bb391..4fd2d3a 100644
--- a/src/com/isode/stroke/component/ComponentSession.java
+++ b/src/com/isode/stroke/component/ComponentSession.java
@@ -84,9 +84,9 @@ public class ComponentSession {
handleElement(e1);
}
});
- onClosedConnection = stream.onClosed.connect(new Slot1<SessionStream.Error>() {
+ onClosedConnection = stream.onClosed.connect(new Slot1<com.isode.stroke.base.Error>() {
@Override
- public void call(SessionStream.Error e1) {
+ public void call(com.isode.stroke.base.Error e1) {
handleStreamClosed(e1);
}
});
@@ -172,7 +172,7 @@ public class ComponentSession {
stream.writeElement(new ComponentHandshake(ComponentHandshakeGenerator.getHandshake(header.getID(), secret, crypto)));
}
- private void handleStreamClosed(SessionStream.Error streamError) {
+ private void handleStreamClosed(com.isode.stroke.base.Error streamError) {
State oldState = state;
state = State.Finished;
stream.setWhitespacePingEnabled(false);
diff --git a/src/com/isode/stroke/component/CoreComponent.java b/src/com/isode/stroke/component/CoreComponent.java
index 63b9cd5..cc51873 100644
--- a/src/com/isode/stroke/component/CoreComponent.java
+++ b/src/com/isode/stroke/component/CoreComponent.java
@@ -35,6 +35,7 @@ import com.isode.stroke.signals.Signal;
import com.isode.stroke.signals.SignalConnection;
import com.isode.stroke.signals.Slot1;
import com.isode.stroke.client.StanzaChannel;
+import com.isode.stroke.tls.TLSOptions;
/**
* The central class for communicating with an XMPP server as a component.
@@ -178,8 +179,7 @@ public class CoreComponent extends Entity {
connection_ = connection;
assert(sessionStream_ == null);
- //TODO: PORT TLSOPTIONS.
- sessionStream_ = new BasicSessionStream(StreamType.ComponentStreamType, connection_, getPayloadParserFactories(), getPayloadSerializers(), null, networkFactories.getTimerFactory());
+ sessionStream_ = new BasicSessionStream(StreamType.ComponentStreamType, connection_, getPayloadParserFactories(), getPayloadSerializers(), null, networkFactories.getTimerFactory(), new TLSOptions());
onDataReadConnection = sessionStream_.onDataRead.connect(new Slot1<SafeByteArray>() {
@Override
public void call(SafeByteArray s1) {
@@ -235,8 +235,8 @@ public class CoreComponent extends Entity {
break;
}
}
- else if(error instanceof SessionStream.Error) {
- SessionStream.Error actualError = (SessionStream.Error)error;
+ else if(error instanceof SessionStream.SessionStreamError) {
+ SessionStream.SessionStreamError actualError = (SessionStream.SessionStreamError)error;
switch(actualError.type) {
case ParseError:
componentError = new ComponentError(ComponentError.Type.XMLError);