Class Default64ResourceIDMapper

  • All Implemented Interfaces:
    ResourceIDMapper

    public class Default64ResourceIDMapper
    extends Object
    implements ResourceIDMapper
    The class Default64ResourceIDMapper provides a default implementation of the ResourceIDMapper interface.

    The implementation assumes the format of ResourceID is: providerID + "/" + the Base64 encoded userID.

    • Constructor Detail

      • Default64ResourceIDMapper

        public Default64ResourceIDMapper()
        Default Constructor.
    • Method Detail

      • getResourceID

        public String getResourceID​(String providerID,
                                    String userID)
        Returns the resource ID that is associated with the user in a provider.
        Specified by:
        getResourceID in interface ResourceIDMapper
        Parameters:
        providerID - ID of the provider.
        userID - ID of the user.
        Returns:
        resource ID. Return null if the resource ID cannot be found.
      • getUserID

        public String getUserID​(String providerID,
                                String resourceID)
        Returns the ID of the user who has the resource ID in a provider.
        Specified by:
        getUserID in interface ResourceIDMapper
        Parameters:
        providerID - ID of the provider.
        resourceID - ID of the resource.
        Returns:
        user ID. Return null if the user is not found.
      • getUserID

        public String getUserID​(String providerID,
                                String resourceID,
                                Message message)
        Returns the ID of the user who has the resource ID in a provider.
        Specified by:
        getUserID in interface ResourceIDMapper
        Parameters:
        providerID - ID of the provider.
        resourceID - ID of the resource.
        message - Request message.
        Returns:
        user ID. Return null if the user is not found.