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 Details

    • AbstractFriendStore

      public AbstractFriendStore()
  • Method Details

    • 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 interface FriendStore
      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 interface FriendStore
      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 interface FriendStore
      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 interface FriendStore
      Parameters:
      friend - the friend to update.
      Throws:
      org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException - on errors.