diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-06-30 20:19:38 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-06-30 20:19:38 +0200 |
commit | ed88b634fc8354d45df95745836dc5db0d58176b (patch) | |
tree | cdaae0ae0a1ac7842db872522717fcb5699e1a60 /src/main/java/eu/siacs/conversations/http/HttpConnectionManager.java | |
parent | a2a1f1e0847952c1b6f08f003cd78ad5520a3db6 (diff) | |
parent | c36238141de719442e3f542019e68e268f2f2265 (diff) |
Merge branch 'feature/http_upload' into development
Diffstat (limited to 'src/main/java/eu/siacs/conversations/http/HttpConnectionManager.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/http/HttpConnectionManager.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/http/HttpConnectionManager.java b/src/main/java/eu/siacs/conversations/http/HttpConnectionManager.java index 9a2a2405..fc266e7b 100644 --- a/src/main/java/eu/siacs/conversations/http/HttpConnectionManager.java +++ b/src/main/java/eu/siacs/conversations/http/HttpConnectionManager.java @@ -13,7 +13,8 @@ public class HttpConnectionManager extends AbstractConnectionManager { super(service); } - private List<HttpConnection> connections = new CopyOnWriteArrayList<HttpConnection>(); + private List<HttpConnection> connections = new CopyOnWriteArrayList<>(); + private List<HttpUploadConnection> uploadConnections = new CopyOnWriteArrayList<>(); public HttpConnection createNewConnection(Message message) { HttpConnection connection = new HttpConnection(this); @@ -22,7 +23,18 @@ public class HttpConnectionManager extends AbstractConnectionManager { return connection; } + public HttpUploadConnection createNewUploadConnection(Message message) { + HttpUploadConnection connection = new HttpUploadConnection(this); + connection.init(message); + this.uploadConnections.add(connection); + return connection; + } + public void finishConnection(HttpConnection connection) { this.connections.remove(connection); } + + public void finishUploadConnection(HttpUploadConnection httpUploadConnection) { + this.uploadConnections.remove(httpUploadConnection); + } } |