summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/isode')
-rw-r--r--src/com/isode/stroke/client/CoreClient.java8
-rw-r--r--src/com/isode/stroke/network/JavaNetworkFactories.java11
-rw-r--r--src/com/isode/stroke/network/NetworkFactories.java5
3 files changed, 16 insertions, 8 deletions
diff --git a/src/com/isode/stroke/client/CoreClient.java b/src/com/isode/stroke/client/CoreClient.java
index c332f27..236ed89 100644
--- a/src/com/isode/stroke/client/CoreClient.java
+++ b/src/com/isode/stroke/client/CoreClient.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2012, Isode Limited, London, England.
+ * Copyright (c) 2010-2013, Isode Limited, London, England.
* All rights reserved.
*/
/*
@@ -15,7 +15,6 @@ import com.isode.stroke.elements.Stanza;
import com.isode.stroke.elements.StreamType;
import com.isode.stroke.jid.JID;
import com.isode.stroke.network.Connection;
-import com.isode.stroke.network.ConnectionFactory;
import com.isode.stroke.network.Connector;
import com.isode.stroke.network.DomainNameResolveError;
import com.isode.stroke.network.NetworkFactories;
@@ -34,7 +33,6 @@ import com.isode.stroke.tls.Certificate;
import com.isode.stroke.tls.CertificateTrustChecker;
import com.isode.stroke.tls.CertificateVerificationError;
import com.isode.stroke.tls.CertificateWithKey;
-import com.isode.stroke.tls.PlatformTLSFactories;
/**
* The central class for communicating with an XMPP server.
@@ -101,7 +99,6 @@ public class CoreClient {
private ClientOptions options;
private CertificateTrustChecker certificateTrustChecker;
private NetworkFactories networkFactories;
- private PlatformTLSFactories tlsFactories;
private SignalConnection sessionStreamDataReadConnection_;
private SignalConnection sessionStreamDataWrittenConnection_;
private SignalConnection sessionFinishedConnection_;
@@ -157,7 +154,6 @@ public class CoreClient {
});
iqRouter_ = new IQRouter(stanzaChannel_);
- tlsFactories = new PlatformTLSFactories();
}
/*CoreClient::~CoreClient() {
@@ -252,7 +248,7 @@ public class CoreClient {
connection_ = connection;
assert (sessionStream_ == null);
- sessionStream_ = new BasicSessionStream(StreamType.ClientStreamType, connection_, payloadParserFactories_, payloadSerializers_, tlsFactories.getTLSContextFactory(), networkFactories.getTimerFactory());
+ sessionStream_ = new BasicSessionStream(StreamType.ClientStreamType, connection_, payloadParserFactories_, payloadSerializers_, networkFactories.getTLSContextFactory(), networkFactories.getTimerFactory());
if (certificate_ != null && !certificate_.isNull()) {
sessionStream_.setTLSCertificate(certificate_);
}
diff --git a/src/com/isode/stroke/network/JavaNetworkFactories.java b/src/com/isode/stroke/network/JavaNetworkFactories.java
index acd289b..aaffea3 100644
--- a/src/com/isode/stroke/network/JavaNetworkFactories.java
+++ b/src/com/isode/stroke/network/JavaNetworkFactories.java
@@ -1,10 +1,12 @@
/*
- * Copyright (c) 2011 Isode Limited, London, England.
+ * Copyright (c) 2011-2013 Isode Limited, London, England.
* All rights reserved.
*/
package com.isode.stroke.network;
import com.isode.stroke.eventloop.EventLoop;
+import com.isode.stroke.tls.PlatformTLSFactories;
+import com.isode.stroke.tls.TLSContextFactory;
public class JavaNetworkFactories implements NetworkFactories {
@@ -13,6 +15,7 @@ public class JavaNetworkFactories implements NetworkFactories {
timers_ = new JavaTimerFactory(eventLoop_);
connections_ = new JavaConnectionFactory(eventLoop_);
dns_ = new PlatformDomainNameResolver(eventLoop_);
+ platformTLSFactories_ = new PlatformTLSFactories();
}
public TimerFactory getTimerFactory() {
@@ -26,8 +29,14 @@ public class JavaNetworkFactories implements NetworkFactories {
public DomainNameResolver getDomainNameResolver() {
return dns_;
}
+
+ public TLSContextFactory getTLSContextFactory() {
+ return platformTLSFactories_.getTLSContextFactory();
+ }
+
private final EventLoop eventLoop_;
private final JavaTimerFactory timers_;
private final JavaConnectionFactory connections_;
private final PlatformDomainNameResolver dns_;
+ private final PlatformTLSFactories platformTLSFactories_;
}
diff --git a/src/com/isode/stroke/network/NetworkFactories.java b/src/com/isode/stroke/network/NetworkFactories.java
index e2cbf2f..678a3b7 100644
--- a/src/com/isode/stroke/network/NetworkFactories.java
+++ b/src/com/isode/stroke/network/NetworkFactories.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Isode Limited, London, England.
+ * Copyright (c) 2011-2013 Isode Limited, London, England.
* All rights reserved.
*/
/*
@@ -8,10 +8,13 @@
*/
package com.isode.stroke.network;
+import com.isode.stroke.tls.TLSContextFactory;
+
public interface NetworkFactories {
TimerFactory getTimerFactory();
ConnectionFactory getConnectionFactory();
DomainNameResolver getDomainNameResolver();
+ TLSContextFactory getTLSContextFactory();
}