Interface ResourceProvider


  • public interface ResourceProvider
    This interface provides (binary) resources at runtime to the appropriate clients. For instance, code can be hot-deployed this way.
    Author:
    Ulrich Kreher, Kevin Goeser
    • Method Detail

      • getResourceDescriptor

        ResourceDescriptor getResourceDescriptor​(SessionToken session,
                                                 UUID resourceID)
        Gets the latest revision of the designated resource descriptor or null in case no resource descriptor with the designated ID exists.
        Parameters:
        session - The session which is used to check for access rights on this method.
        resourceID - The ID of the resource descriptor of which to retrieve the latest revision.
        Returns:
        The latest revision of the resource descriptor having the designated ID or null in case the corresponding resource descriptor does not exist.
      • getResource

        byte[] getResource​(SessionToken session,
                           UUID resourceID)
        Gets the (latest revision of the) designated resource or null in case no resource with the designated ID exists.
        Parameters:
        session - The session which is used to check for access rights on this method.
        resourceID - The ID of the resource of which to retrieve the latest revision.
        Returns:
        The latest revision of the resource having the designated ID or null in case the corresponding resource does not exist.
      • getResourceIncrementally

        ServerStream getResourceIncrementally​(SessionToken session,
                                              UUID resourceID)
        The same as getResource(SessionToken, UUID) but with incremental retrieval of the resource.
        Parameters:
        session - The session which is used to check for access rights on this method.
        resourceID - The ID of the resource of which to retrieve the latest revision.
        Returns:
        The latest revision of the resource having the designated ID as ServerStream or null in case the corresponding resource does not exist. The caller is responsible for closing.
      • getResource

        byte[] getResource​(SessionToken session,
                           ResourceDescriptor resourceDescriptor)
        Gets the the resource identified by the resource descriptor. Note that this considers the revision of the designated resource (descriptor)!
        Parameters:
        session - The session which is used to check for access rights on this method.
        resourceDescriptor - The descriptor providing the resource ID as well as the revision for which to retrieve resource.
        Returns:
        The resource belonging to the designated resource descriptor (resource ID and revision).
        Throws:
        IllegalArgumentException - If the designated resource descriptor is invalid, for instance it has an invalid resource ID or revision, an IllegalArgumentException will be thrown.
      • getResourceIncrementally

        ServerStream getResourceIncrementally​(SessionToken session,
                                              ResourceDescriptor resourceDescriptor)
        The same as getResource(SessionToken, ResourceDescriptor) but with incremental retrieval of the resource.
        Parameters:
        session - The session which is used to check for access rights on this method.
        resourceDescriptor - The descriptor providing the resource ID as well as the revision for which to retrieve resource.
        Returns:
        The resource belonging to the designated resource descriptor (resource ID and revision) as ServerStream or null in case the corresponding resource does not exist. The caller is responsible for closing.
        Throws:
        IllegalArgumentException - If the designated resource descriptor is invalid, for instance it has an invalid resource ID or revision, an IllegalArgumentException will be thrown.