+ public void start() {
+ memoryPostDatabase.start();
+ loadKnownPostReplies();
+ }
+
+ @Override
+ public void stop() {
+ try {
+ memoryPostDatabase.stop();
+ configuration.save();
+ } catch (DatabaseException de1) {
+ logger.log(Level.WARNING, "Could not stop post database!", de1);
+ } catch (ConfigurationException ce1) {
+ logger.log(Level.WARNING, "Could not save configuration!", ce1);
+ }
+ }
+
+ @Override
+ public Optional<Identity> getIdentity(String identityId) {
+ return memoryIdentityDatabase.getIdentity(identityId);
+ }
+
+ @Override
+ public void storeIdentity(Identity identitiy) {
+ memoryIdentityDatabase.storeIdentity(identitiy);
+ }
+
+ @Override
+ public Function<String, Optional<Sone>> getSone() {
+ return new Function<String, Optional<Sone>>() {
+ @Override
+ public Optional<Sone> apply(String soneId) {
+ return (soneId == null) ? Optional.<Sone>absent() : getSone(soneId);
+ }
+ };
+ }
+
+ @Override
+ public Optional<Sone> getSone(String soneId) {