Class FileBasedOpenPgpMetadataStore

  • All Implemented Interfaces:
    OpenPgpMetadataStore

    public class FileBasedOpenPgpMetadataStore
    extends AbstractOpenPgpMetadataStore
    Implementation of the OpenPgpMetadataStore, which stores metadata information in a file structure. The information is stored in the following directory structure:
     
     <basePath>/
         <userjid@server.tld>/
             announced.list       // list of the users announced key fingerprints and modification dates
     
     
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ANNOUNCED  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<org.pgpainless.key.OpenPgpV4Fingerprint,​java.util.Date> readAnnouncedFingerprintsOf​(org.jxmpp.jid.BareJid contact)
      Read the fingerprints and modification dates of announced keys of a user from local storage.
      void writeAnnouncedFingerprintsOf​(org.jxmpp.jid.BareJid contact, java.util.Map<org.pgpainless.key.OpenPgpV4Fingerprint,​java.util.Date> metadata)
      Write the fingerprints and modification dates of announced keys of a user to local storage.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileBasedOpenPgpMetadataStore

        public FileBasedOpenPgpMetadataStore​(java.io.File basePath)
    • Method Detail

      • readAnnouncedFingerprintsOf

        public java.util.Map<org.pgpainless.key.OpenPgpV4Fingerprint,​java.util.Date> readAnnouncedFingerprintsOf​(org.jxmpp.jid.BareJid contact)
                                                                                                                throws java.io.IOException
        Description copied from class: AbstractOpenPgpMetadataStore
        Read the fingerprints and modification dates of announced keys of a user from local storage.
        Specified by:
        readAnnouncedFingerprintsOf in class AbstractOpenPgpMetadataStore
        Parameters:
        contact - contact
        Returns:
        contacts announced key fingerprints and latest modification dates
        Throws:
        java.io.IOException - IO is dangerous
      • writeAnnouncedFingerprintsOf

        public void writeAnnouncedFingerprintsOf​(org.jxmpp.jid.BareJid contact,
                                                 java.util.Map<org.pgpainless.key.OpenPgpV4Fingerprint,​java.util.Date> metadata)
                                          throws java.io.IOException
        Description copied from class: AbstractOpenPgpMetadataStore
        Write the fingerprints and modification dates of announced keys of a user to local storage.
        Specified by:
        writeAnnouncedFingerprintsOf in class AbstractOpenPgpMetadataStore
        Parameters:
        contact - contact
        metadata - announced key fingerprints and latest modification dates
        Throws:
        java.io.IOException - IO is dangerous