Class FileSystemConsumerStore
java.lang.Object
org.eclipse.lyo.server.oauth.core.consumer.AbstractConsumerStore
org.eclipse.lyo.server.oauth.consumerstore.FileSystemConsumerStore
- All Implemented Interfaces:
ConsumerStore
A simple RDF consumer store backed by an XML file on the filesystem.
NOTE: The shared consumer secret is stored as Base64 and is only obfuscated, not encrypted (unless
the ctor with an encryption key is used).
- Author:
- Samuel Padgett
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFileSystemConsumerStore(String oauthStoreRoot) FileSystemConsumerStore(String oauthStoreRoot, String encryptionKey) This provides a extra parameter for storing the consumer secret encrypted by a userKeyFileSystemConsumerStore(Model model, String oauthStoreRoot) -
Method Summary
Modifier and TypeMethodDescriptionaddConsumer(LyoOAuthConsumer consumer) Adds a new consumer.voidCloses the consumer store.protected voidprotected Stringprotected Stringprotected LyoOAuthConsumerfromResource(Resource resource) protected SecretKeygetSecreteKey(String encryptionKey) It generate Secret Key of length 32 bytes using user provided key.protected voidremoveConsumer(String consumerKey) Removes a consumer.protected voidremoveProperties(String consumerKey) Removes any properties previously associated with the consumer.protected voidremoveProperties(LyoOAuthConsumer consumer) Removes any properties previously associated with the consumer.protected ResourcetoResource(LyoOAuthConsumer consumer) updateConsumer(LyoOAuthConsumer consumer) Updates a consumer.protected voidMethods inherited from class org.eclipse.lyo.server.oauth.core.consumer.AbstractConsumerStore
add, addAll, getAllConsumers, getConsumer, getConsumer, remove
-
Field Details
-
LYO_OAUTH_NAMESPACE
- See Also:
-
CONSUMER_RESOURCE
- See Also:
-
CALLBACK_URL
- See Also:
-
CONSUMER_NAME
- See Also:
-
CONSUMER_KEY
- See Also:
-
CONSUMER_SECRET
- See Also:
-
PROVISIONAL
- See Also:
-
TRUSTED
- See Also:
-
AES_CIPHER
- See Also:
-
-
Constructor Details
-
FileSystemConsumerStore
public FileSystemConsumerStore(String oauthStoreRoot) throws SQLException, ConsumerStoreException, ClassNotFoundException -
FileSystemConsumerStore
public FileSystemConsumerStore(String oauthStoreRoot, String encryptionKey) throws SQLException, ConsumerStoreException, ClassNotFoundException This provides a extra parameter for storing the consumer secret encrypted by a userKey- Parameters:
oauthStoreRoot-encryptionKey-- Throws:
SQLExceptionConsumerStoreExceptionClassNotFoundException
-
FileSystemConsumerStore
- Throws:
ConsumerStoreException
-
-
Method Details
-
createModel
protected void createModel() -
writeModel
- Throws:
FileNotFoundException
-
loadConsumers
- Throws:
ConsumerStoreException
-
addConsumer
Description copied from interface:ConsumerStoreAdds a new consumer.- Parameters:
consumer- the consumer- Returns:
- the previous consumer associated with this key or null if there wasn't one
- Throws:
ConsumerStoreException
-
removeConsumer
Description copied from interface:ConsumerStoreRemoves a consumer.- Returns:
- the removed consumer or null if it wasn't previously in the store
- Throws:
ConsumerStoreException- on errors
-
updateConsumer
Description copied from interface:ConsumerStoreUpdates a consumer.- Parameters:
consumer- the consumer- Returns:
- the same consumer or null if it wasn't previously in the store
- Throws:
ConsumerStoreException- on errors
-
closeConsumerStore
public void closeConsumerStore()Description copied from interface:ConsumerStoreCloses the consumer store. It is unavailable for further use.- Specified by:
closeConsumerStorein interfaceConsumerStore- Specified by:
closeConsumerStorein classAbstractConsumerStore
-
removeProperties
Removes any properties previously associated with the consumer.- Parameters:
consumerKey- the consumer key
-
removeProperties
Removes any properties previously associated with the consumer.- Parameters:
consumer- the consumer
-
toResource
- Throws:
UnsupportedEncodingException
-
fromResource
- Throws:
UnsupportedEncodingException
-
encrypt
-
decrypt
-
getSecreteKey
It generate Secret Key of length 32 bytes using user provided key.- Returns:
-