Interface FriendStore

  • All Known Implementing Classes:
    AbstractFriendStore, FileSystemFriendStore

    public interface FriendStore
    Manages persistence of OAuth friends.

    Friend store methods throw ConsumerStoreException when an error occurs at updating the store. This is the exact same semantics as for the ConsumerStore defined by Lyo, hence the reuse of the same exception.

    Since:
    1.3.0
    • Method Detail

      • getAllFriends

        Collection<Friend> getAllFriends()
                                  throws org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
        Gets all OAuth friends.
        Returns:
        all OAuth friends.
        Throws:
        org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException - on errors.
      • getFriend

        default Optional<Friend> getFriend​(String identifier)
                                    throws org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
        Returns the friend for the given identifier.
        Parameters:
        identifier - the identifier of the friend to look for.
        Returns:
        the friend corresponding to the given identifier, Optional.empty() if none.
        Throws:
        org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException - on errors.
        Since:
        2.0.0
      • addFriend

        void addFriend​(Friend friend)
                throws org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
        Adds a new friend.
        Parameters:
        friend - the new friend.
        Throws:
        org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException - on errors.
      • removeFriend

        void removeFriend​(String identifier)
                   throws org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
        Removes a friend.
        Parameters:
        identifier - identifier of the friend to remove.
        Throws:
        org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException - on errors.
      • updateFriend

        void updateFriend​(Friend friend)
                   throws org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException
        Updates a friend.
        Parameters:
        friend - the friend to update.
        Throws:
        org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException - on errors.