summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-10-18 15:41:26 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-10-18 15:41:26 (GMT)
commit1731806d084707847994aea5ccb6c7e388a8d16c (patch)
tree64f2cec8eea7abec97ef4c59e6b390359ecc51d3 /src/com/isode/stroke/client/ClientSessionStanzaChannel.java
parent9d6bf77f787ed6bb00d723489af338b92b69f2c8 (diff)
downloadstroke-1731806d084707847994aea5ccb6c7e388a8d16c.zip
stroke-1731806d084707847994aea5ccb6c7e388a8d16c.tar.bz2
Trying to quieten down PMD's complaining a little bit
Change-Id: Id2710c674abc19cdf2b37f97fe53288b86c7f367
Diffstat (limited to 'src/com/isode/stroke/client/ClientSessionStanzaChannel.java')
-rw-r--r--src/com/isode/stroke/client/ClientSessionStanzaChannel.java28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/com/isode/stroke/client/ClientSessionStanzaChannel.java b/src/com/isode/stroke/client/ClientSessionStanzaChannel.java
index 531ff62..e870dda 100644
--- a/src/com/isode/stroke/client/ClientSessionStanzaChannel.java
+++ b/src/com/isode/stroke/client/ClientSessionStanzaChannel.java
@@ -22,12 +22,15 @@ import java.util.logging.Logger;
* StanzaChannel implementation around a ClientSession.
*/
public class ClientSessionStanzaChannel extends StanzaChannel {
+ private final IDGenerator idGenerator = new IDGenerator();
+ private ClientSession session;
+ private static final Logger logger_ = Logger.getLogger(ClientSessionStanzaChannel.class.getName());
private SignalConnection sessionInitializedConnection;
private SignalConnection sessionFinishedConnection;
private SignalConnection sessionStanzaReceivedConnection;
private SignalConnection sessionStanzaAckedConnection;
- public void setSession(ClientSession session) {
+ public void setSession(final ClientSession session) {
assert this.session == null;
this.session = session;
sessionInitializedConnection = session.onInitialized.connect(new Slot() {
@@ -36,9 +39,9 @@ public class ClientSessionStanzaChannel extends StanzaChannel {
handleSessionInitialized();
}
});
- sessionFinishedConnection = session.onFinished.connect(new Slot1<com.isode.stroke.base.Error>() {
+ sessionFinishedConnection = session.onFinished.connect(new Slot1<Error>() {
- public void call(com.isode.stroke.base.Error p1) {
+ public void call(Error p1) {
handleSessionFinished(p1);
}
});
@@ -56,15 +59,15 @@ public class ClientSessionStanzaChannel extends StanzaChannel {
});
}
- public void sendIQ(IQ iq) {
+ public void sendIQ(final IQ iq) {
send(iq);
}
- public void sendMessage(Message message) {
+ public void sendMessage(final Message message) {
send(message);
}
- public void sendPresence(Presence presence) {
+ public void sendPresence(final Presence presence) {
send(presence);
}
@@ -83,7 +86,7 @@ public class ClientSessionStanzaChannel extends StanzaChannel {
return idGenerator.generateID();
}
- private void send(Stanza stanza) {
+ private void send(final Stanza stanza) {
if (!isAvailable()) {
logger_.warning("Warning: Client: Trying to send a stanza while disconnected.");
return;
@@ -91,7 +94,8 @@ public class ClientSessionStanzaChannel extends StanzaChannel {
session.sendStanza(stanza);
}
- private void handleSessionFinished(Error error) {
+ // NOPMD, ignore that Error isn't used.
+ private void handleSessionFinished(final Error error) {
sessionFinishedConnection.disconnect();
sessionStanzaReceivedConnection.disconnect();
sessionStanzaAckedConnection.disconnect();
@@ -100,7 +104,7 @@ public class ClientSessionStanzaChannel extends StanzaChannel {
onAvailableChanged.emit(false);
}
- private void handleStanza(Stanza stanza) {
+ private void handleStanza(final Stanza stanza) {
if (stanza instanceof Message) {
onMessageReceived.emit((Message)stanza);
}
@@ -112,14 +116,12 @@ public class ClientSessionStanzaChannel extends StanzaChannel {
}
}
- private void handleStanzaAcked(Stanza stanza) {
+ private void handleStanzaAcked(final Stanza stanza) {
onStanzaAcked.emit(stanza);
}
private void handleSessionInitialized() {
onAvailableChanged.emit(true);
}
- private IDGenerator idGenerator = new IDGenerator();
- private ClientSession session;
- private static final Logger logger_ = Logger.getLogger(ClientSessionStanzaChannel.class.getName());
+
}