Make contact-storage pure storage
diff --git a/src/contact-manager.h b/src/contact-manager.h
index ddf8489..1cde4bc 100644
--- a/src/contact-manager.h
+++ b/src/contact-manager.h
@@ -11,30 +11,81 @@
#ifndef LINKNDN_CONTACT_MANAGER_H
#define LINKNDN_CONTACT_MANAGER_H
-#include "contact-storage.h"
-#include "ndn.cxx/wrapper/wrapper.h"
+#include <QObject>
-class ContactManager
+#ifndef Q_MOC_RUN
+#include "contact-storage.h"
+#include "dns-storage.h"
+#include "endorse-certificate.h"
+#include "ndn.cxx/wrapper/wrapper.h"
+#endif
+
+
+class ContactManager : public QObject
{
+ Q_OBJECT
+
public:
- ContactManager(ndn::Ptr<ContactStorage> contactStorage);
+ ContactManager(ndn::Ptr<ContactStorage> contactStorage,
+ ndn::Ptr<DnsStorage> dnsStorage);
~ContactManager();
+ void
+ fetchSelfEndorseCertificate(const ndn::Name& identity);
+
+ void
+ updateProfileData(const ndn::Name& identity);
+
inline ndn::Ptr<ContactStorage>
getContactStorage()
{ return m_contactStorage; }
+ inline ndn::Ptr<DnsStorage>
+ getDnsStorage()
+ { return m_dnsStorage; }
+
+ inline ndn::Name
+ getDefaultIdentity()
+ { return m_keychain->getDefaultIdentity(); }
+
inline ndn::Ptr<ndn::Wrapper>
getWrapper()
{ return m_wrapper; }
private:
- ndn::Ptr<ndn::security::Keychain>
+ void
setKeychain();
+
+ ndn::Ptr<EndorseCertificate>
+ getSignedSelfEndorseCertificate(const ndn::Name& identity, const Profile& profile);
+
+ void
+ publishSelfEndorseCertificateInDNS(ndn::Ptr<EndorseCertificate> selfEndorseCertificate);
+
+ void
+ onDnsSelfEndorseCertificateVerified(ndn::Ptr<ndn::Data> selfEndorseCertificate, const ndn::Name& identity);
+
+ void
+ onDnsSelfEndorseCertificateUnverified(ndn::Ptr<ndn::Data> selfEndorseCertificate, const ndn::Name& identity);
+
+ void
+ onDnsSelfEndorseCertificateTimeout(ndn::Ptr<ndn::Closure> closure, ndn::Ptr<ndn::Interest> interest, const ndn::Name& identity, int retry);
+
+signals:
+ void
+ contactFetched(ndn::Ptr<EndorseCertificate> selfEndorseCertificate);
+
+ void
+ contactFetchFailed(const ndn::Name& identity);
+
+private slots:
+
private:
ndn::Ptr<ContactStorage> m_contactStorage;
+ ndn::Ptr<DnsStorage> m_dnsStorage;
+ ndn::Ptr<ndn::security::Keychain> m_keychain;
ndn::Ptr<ndn::Wrapper> m_wrapper;
};