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.LyoOAuthConsumer
addConsumer(org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer consumer)
void
closeConsumerStore()
Collection<org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer>
getAllConsumers()
org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer
getConsumer(String key)
org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer
getConsumer(net.oauth.OAuthMessage message)
Map<String,org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer>
load()
org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer
removeConsumer(String identifier)
void
store(Collection<org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer> consumers)
org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer
updateConsumer(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:
getAllConsumers
in 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:
addConsumer
in 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:
removeConsumer
in 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:
updateConsumer
in 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:
getConsumer
in interfaceorg.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 interfaceorg.eclipse.lyo.server.oauth.core.consumer.ConsumerStore
- Throws:
org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
-
closeConsumerStore
public void closeConsumerStore()
- Specified by:
closeConsumerStore
in interfaceorg.eclipse.lyo.server.oauth.core.consumer.ConsumerStore
-
-