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 voidaddFriend(Friend friend)Adds a new friend.Collection<Friend>getAllFriends()Gets all OAuth friends.protected abstract Collection<Friend>load()Loads friends from the underlying storage.voidremoveFriend(String identifier)Removes a friend.protected abstract voidstore(Collection<Friend> friends)Stores the new collection of friends.voidupdateFriend(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:FriendStoreGets all OAuth friends.- Specified by:
getAllFriendsin 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:FriendStoreAdds a new friend.- Specified by:
addFriendin 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:FriendStoreRemoves a friend.- Specified by:
removeFriendin 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:FriendStoreUpdates a friend.- Specified by:
updateFriendin interfaceFriendStore- Parameters:
friend- the friend to update.- Throws:
org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException- on errors.
-
-