Package com.sodius.oslc.server.oauth
Class FileSystemConsumerStore
- java.lang.Object
-
- com.sodius.oslc.server.oauth.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 Summary
Constructors Constructor Description FileSystemConsumerStore(File file)Creates a new store backed by the specified file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumeraddConsumer(org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer consumer)voidcloseConsumerStore()Collection<org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer>getAllConsumers()org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumergetConsumer(String key)org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumergetConsumer(net.oauth.OAuthMessage message)Map<String,org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer>load()org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumerremoveConsumer(String identifier)voidstore(Collection<org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer> consumers)org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumerupdateConsumer(org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer consumer)
-
-
-
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:
getAllConsumersin interfaceorg.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:
addConsumerin interfaceorg.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:
removeConsumerin interfaceorg.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:
updateConsumerin interfaceorg.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:
getConsumerin interfaceorg.eclipse.lyo.server.oauth.core.consumer.ConsumerStore- Throws:
org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreExceptionIOException
-
getConsumer
public org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer getConsumer(String key) throws org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
- Specified by:
getConsumerin interfaceorg.eclipse.lyo.server.oauth.core.consumer.ConsumerStore- Throws:
org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
-
closeConsumerStore
public void closeConsumerStore()
- Specified by:
closeConsumerStorein interfaceorg.eclipse.lyo.server.oauth.core.consumer.ConsumerStore
-
-