Package com.sodius.oslc.server.oauth
Class AbstractFriendStore
- java.lang.Object
-
- com.sodius.oslc.server.oauth.AbstractFriendStore
-
- All Implemented Interfaces:
FriendStore
- Direct Known Subclasses:
FileSystemFriendStore
public abstract class AbstractFriendStore extends Object implements FriendStore
Provide a default implementation of the store, leaving to sub classes the responsibility of the actual loading and saving of friends.- Since:
- 1.3.0
-
-
Constructor Summary
Constructors Constructor Description AbstractFriendStore()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addFriend(Friend friend)
Adds a new friend.Collection<Friend>
getAllFriends()
Gets all OAuth friends.protected abstract Collection<Friend>
load()
Loads friends from the underlying storage.void
removeFriend(String identifier)
Removes a friend.protected abstract void
store(Collection<Friend> friends)
Stores the new collection of friends.void
updateFriend(Friend friend)
Updates a friend.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.sodius.oslc.server.oauth.FriendStore
getFriend
-
-
-
-
Method Detail
-
load
protected abstract Collection<Friend> load() throws org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
Loads friends from the underlying storage.- Returns:
- the loaded friends.
- Throws:
org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
- on errors.
-
store
protected abstract void store(Collection<Friend> friends) throws org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
Stores the new collection of friends.- Parameters:
friends
- the new collection of friends to store.- Throws:
org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
- on errors.
-
getAllFriends
public Collection<Friend> getAllFriends() throws org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
Description copied from interface:FriendStore
Gets all OAuth friends.- Specified by:
getAllFriends
in interfaceFriendStore
- Returns:
- all OAuth friends.
- Throws:
org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
- on errors.
-
addFriend
public void addFriend(Friend friend) throws org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
Description copied from interface:FriendStore
Adds a new friend.- Specified by:
addFriend
in interfaceFriendStore
- Parameters:
friend
- the new friend.- Throws:
org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
- on errors.
-
removeFriend
public void removeFriend(String identifier) throws org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
Description copied from interface:FriendStore
Removes a friend.- Specified by:
removeFriend
in interfaceFriendStore
- Parameters:
identifier
- identifier of the friend to remove.- Throws:
org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
- on errors.
-
updateFriend
public void updateFriend(Friend friend) throws org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
Description copied from interface:FriendStore
Updates a friend.- Specified by:
updateFriend
in interfaceFriendStore
- Parameters:
friend
- the friend to update.- Throws:
org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
- on errors.
-
-