Some bugfixes and added findMessages by sender

This commit is contained in:
Christian Basler 2015-09-29 07:13:27 +02:00
parent 7fb837645f
commit c3fdee79ca
4 changed files with 12 additions and 4 deletions

View File

@ -34,6 +34,8 @@ public interface MessageRepository {
List<Plaintext> findMessages(Status status, BitmessageAddress recipient);
List<Plaintext> findMessages(BitmessageAddress sender);
void save(Plaintext message);
void remove(Plaintext message);

View File

@ -221,7 +221,8 @@ public class DefaultNetworkHandler implements NetworkHandler, ContextHolder {
i++;
}
return new Property("network", null,
new Property("connectionManager", connectionManager.isAlive() ? "running" : "stopped"),
new Property("connectionManager",
connectionManager != null && connectionManager.isAlive() ? "running" : "stopped"),
new Property("connections", null, streamProperties)
);
}

View File

@ -101,6 +101,11 @@ public class JdbcMessageRepository extends JdbcHelper implements MessageReposito
return find("status='" + status.name() + "'");
}
@Override
public List<Plaintext> findMessages(BitmessageAddress sender) {
return find("sender='" + sender.getAddress() + "'");
}
private List<Plaintext> find(String where) {
List<Plaintext> result = new LinkedList<>();
try (Connection connection = config.getConnection()) {

View File

@ -2,9 +2,9 @@ uploadArchives {
repositories {
mavenDeployer {
pom.project {
name 'Jabit Spongy Security'
artifactId = 'jabit-security-spongy'
description 'The Security implementation using spongy castle (needed for Android)'
name 'Jabit Bouncy Security'
artifactId = 'jabit-security-bouncy'
description 'The Security implementation using bouncy castle'
}
}
}