Commit b4e47ce8 authored by JonnyHeavey's avatar JonnyHeavey Committed by Dave Cridland

Minor adjustments following review

parent ea56ccdd
...@@ -98,7 +98,7 @@ public abstract class LocalSession implements Session { ...@@ -98,7 +98,7 @@ public abstract class LocalSession implements Session {
/** /**
* XEP-0198 Stream Manager * XEP-0198 Stream Manager
*/ */
protected StreamManager streamManager = null; protected final StreamManager streamManager;
/** /**
* Creates a session with an underlying connection and permission protection. * Creates a session with an underlying connection and permission protection.
...@@ -432,7 +432,7 @@ public abstract class LocalSession implements Session { ...@@ -432,7 +432,7 @@ public abstract class LocalSession implements Session {
/** /**
* Enables stream management for session * Enables stream management for session
* @param enable XEP-0198 <enable/> stanza * @param enable XEP-0198 <enable/> element
*/ */
public void enableStreamMangement(Element enable) { public void enableStreamMangement(Element enable) {
......
...@@ -6,6 +6,7 @@ import java.util.Map; ...@@ -6,6 +6,7 @@ import java.util.Map;
import org.dom4j.Element; import org.dom4j.Element;
import org.jivesoftware.openfire.Connection; import org.jivesoftware.openfire.Connection;
import org.xmpp.packet.Packet; import org.xmpp.packet.Packet;
import org.xmpp.packet.PacketError;
/** /**
* XEP-0198 Stream Manager. * XEP-0198 Stream Manager.
...@@ -24,7 +25,7 @@ public class StreamManager { ...@@ -24,7 +25,7 @@ public class StreamManager {
/** /**
* Connection (stream) to client for the session the manager belongs to * Connection (stream) to client for the session the manager belongs to
*/ */
private Connection connection; private final Connection connection;
/** /**
* Whether Stream Management is enabled for session * Whether Stream Management is enabled for session
...@@ -61,7 +62,7 @@ public class StreamManager { ...@@ -61,7 +62,7 @@ public class StreamManager {
private Map<Long, Packet> unacknowledgedServerStanzas = new HashMap<Long, Packet>(); private Map<Long, Packet> unacknowledgedServerStanzas = new HashMap<Long, Packet>();
public StreamManager(Connection connection) { public StreamManager(Connection connection) {
this.setConnection(connection); this.connection = connection;
} }
/** /**
...@@ -91,7 +92,7 @@ public class StreamManager { ...@@ -91,7 +92,7 @@ public class StreamManager {
public void sendUnexpectedError() { public void sendUnexpectedError() {
StringBuilder sb = new StringBuilder(340); StringBuilder sb = new StringBuilder(340);
sb.append(String.format("<failed xmlns='%s'>", getNamespace())); sb.append(String.format("<failed xmlns='%s'>", getNamespace()));
sb.append("<unexpected-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>"); sb.append(new PacketError(PacketError.Condition.unexpected_request).toXML());
sb.append("</failed>"); sb.append("</failed>");
getConnection().deliverRawText(sb.toString()); getConnection().deliverRawText(sb.toString());
} }
...@@ -127,14 +128,6 @@ public class StreamManager { ...@@ -127,14 +128,6 @@ public class StreamManager {
return connection; return connection;
} }
/**
* Set connection for the session
* @param connection
*/
public void setConnection(Connection connection) {
this.connection = connection;
}
/** /**
* Determines whether Stream Management enabled for session this * Determines whether Stream Management enabled for session this
* manager belongs to. * manager belongs to.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment