Class FileSystemConsumerStore

  • All Implemented Interfaces:
    org.eclipse.lyo.server.oauth.core.consumer.ConsumerStore

    public class FileSystemConsumerStore
    extends Object
    implements org.eclipse.lyo.server.oauth.core.consumer.ConsumerStore
    A simple RDF consumer store backed by an XML file on the filesystem. NOTE: The consumer secret is stored as Base64 and is only obfuscated, not encrypted.
    Since:
    3.0.0
    • Constructor Detail

      • FileSystemConsumerStore

        public FileSystemConsumerStore​(File file)
        Creates a new store backed by the specified file.
        Parameters:
        file - the file where to store consumers.
    • Method Detail

      • load

        public Map<String,​org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer> load()
                                                                                           throws org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
        Throws:
        org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
      • store

        public void store​(Collection<org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer> consumers)
                   throws org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
        Throws:
        org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
      • getAllConsumers

        public Collection<org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer> getAllConsumers()
                                                                                                throws org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
        Specified by:
        getAllConsumers in interface org.eclipse.lyo.server.oauth.core.consumer.ConsumerStore
        Throws:
        org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
      • addConsumer

        public org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer addConsumer​(org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer consumer)
                                                                                throws org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
        Specified by:
        addConsumer in interface org.eclipse.lyo.server.oauth.core.consumer.ConsumerStore
        Throws:
        org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
      • removeConsumer

        public org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer removeConsumer​(String identifier)
                                                                                   throws org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
        Specified by:
        removeConsumer in interface org.eclipse.lyo.server.oauth.core.consumer.ConsumerStore
        Throws:
        org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
      • updateConsumer

        public org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer updateConsumer​(org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer consumer)
                                                                                   throws org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
        Specified by:
        updateConsumer in interface org.eclipse.lyo.server.oauth.core.consumer.ConsumerStore
        Throws:
        org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
      • getConsumer

        public org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer getConsumer​(net.oauth.OAuthMessage message)
                                                                                throws org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException,
                                                                                       IOException
        Specified by:
        getConsumer in interface org.eclipse.lyo.server.oauth.core.consumer.ConsumerStore
        Throws:
        org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
        IOException
      • getConsumer

        public org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer getConsumer​(String key)
                                                                                throws org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
        Specified by:
        getConsumer in interface org.eclipse.lyo.server.oauth.core.consumer.ConsumerStore
        Throws:
        org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
      • closeConsumerStore

        public void closeConsumerStore()
        Specified by:
        closeConsumerStore in interface org.eclipse.lyo.server.oauth.core.consumer.ConsumerStore