summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/com')
-rw-r--r--src/com/isode/stroke/client/ClientSession.java11
-rw-r--r--src/com/isode/stroke/elements/StreamFeatures.java12
-rw-r--r--src/com/isode/stroke/session/BasicSessionStream.java12
-rw-r--r--src/com/isode/stroke/session/SessionStream.java20
4 files changed, 44 insertions, 11 deletions
diff --git a/src/com/isode/stroke/client/ClientSession.java b/src/com/isode/stroke/client/ClientSession.java
index d9d7109..78594b0 100644
--- a/src/com/isode/stroke/client/ClientSession.java
+++ b/src/com/isode/stroke/client/ClientSession.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2011 Isode Limited, London, England.
+ * Copyright (c) 2010-2012 Isode Limited, London, England.
* All rights reserved.
*/
/*
@@ -589,6 +589,15 @@ public class ClientSession {
private JID getRemoteJID() {
return new JID("", localJID.getDomain());
}
+
+ @Override
+ public String toString() {
+ return "useTLS=" + useTLS +
+ "; allowPLAINOverNonTLS=" + allowPLAINOverNonTLS +
+ "; certificatetrustChecker=" + certificateTrustChecker +
+ "; state=" + state +
+ "; error_=" + error_;
+ }
private JID localJID;
private State state;
diff --git a/src/com/isode/stroke/elements/StreamFeatures.java b/src/com/isode/stroke/elements/StreamFeatures.java
index c784077..39ebb04 100644
--- a/src/com/isode/stroke/elements/StreamFeatures.java
+++ b/src/com/isode/stroke/elements/StreamFeatures.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Isode Limited, London, England.
+ * Copyright (c) 2010-2012, Isode Limited, London, England.
* All rights reserved.
*/
/*
@@ -88,6 +88,16 @@ public class StreamFeatures implements Element {
public void setHasRosterVersioning() {
hasRosterVersioning_ = true;
}
+
+ @Override
+ public String toString() {
+ return "StreamFeatures: hasStartTLS=" + hasStartTLS_ +
+ "; hasResourceBind_=" + hasResourceBind_ +
+ "; hasSession_=" + hasSession_ +
+ "; hasStreamManagement_ =" + hasStreamManagement_ +
+ "; compression methods:" + compressionMethods_.size() +
+ "; authentication mechs:" + authenticationMechanisms_.size();
+ }
private boolean hasStartTLS_;
private ArrayList<String> compressionMethods_ = new ArrayList<String>();
diff --git a/src/com/isode/stroke/session/BasicSessionStream.java b/src/com/isode/stroke/session/BasicSessionStream.java
index 6ae6c1d..e1ff24d 100644
--- a/src/com/isode/stroke/session/BasicSessionStream.java
+++ b/src/com/isode/stroke/session/BasicSessionStream.java
@@ -1,10 +1,8 @@
/*
* Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
- */
+ * All rights reserved. */
/*
- * Copyright (c) 2010, Isode Limited, London, England.
+ * Copyright (c) 2010-2012, Isode Limited, London, England.
* All rights reserved.
*/
package com.isode.stroke.session;
@@ -235,6 +233,12 @@ public class BasicSessionStream extends SessionStream {
private void handleDataWritten(ByteArray data) {
onDataWritten.emit(data.toString());
}
+ @Override
+ public String toString() {
+ return super.toString() +
+ "; available=" + available;
+ }
+
private boolean available;
private Connection connection;
private PayloadParserFactoryCollection payloadParserFactories;
diff --git a/src/com/isode/stroke/session/SessionStream.java b/src/com/isode/stroke/session/SessionStream.java
index 879ee7d..ee17a09 100644
--- a/src/com/isode/stroke/session/SessionStream.java
+++ b/src/com/isode/stroke/session/SessionStream.java
@@ -1,10 +1,9 @@
/*
* Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * All rights reserved.
*/
/*
- * Copyright (c) 2010-2011, Isode Limited, London, England.
+ * Copyright (c) 2010-2012, Isode Limited, London, England.
* All rights reserved.
*/
package com.isode.stroke.session;
@@ -29,13 +28,13 @@ public abstract class SessionStream {
InvalidTLSCertificateError,
ConnectionReadError,
ConnectionWriteError
- };
+ }
public Error(Type type) {
this.type = type;
}
public final Type type;
- };
+ }
public abstract void close();
@@ -84,5 +83,16 @@ public abstract class SessionStream {
protected PKCS12Certificate getTLSCertificate() {
return certificate;
}
+
+ @Override
+ public String toString() {
+ String className = this.getClass().getSimpleName();
+
+ // Include actual type based on class name of the object
+ return className +
+ "; supportsTLSEncryption:" + supportsTLSEncryption() +
+ "; " + (hasTLSCertificate() ? "has" : "no") +
+ " certificate";
+ }
private PKCS12Certificate certificate;
}