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 Summary
Modifier and TypeMethodDescriptionbyte[]getResource(SessionToken session, ResourceDescriptor resourceDescriptor) Gets the the resource identified by the resource descriptor.byte[]getResource(SessionToken session, UUID resourceID) Gets the (latest revision of the) designated resource ornullin case no resource with the designated ID exists.getResourceDescriptor(SessionToken session, UUID resourceID) Gets the latest revision of the designated resource descriptor ornullin case no resource descriptor with the designated ID exists.getResourceIncrementally(SessionToken session, ResourceDescriptor resourceDescriptor) The same asgetResource(SessionToken, ResourceDescriptor)but with incremental retrieval of the resource.getResourceIncrementally(SessionToken session, UUID resourceID) The same asgetResource(SessionToken, UUID)but with incremental retrieval of the resource.
-
Method Details
-
getResourceDescriptor
Gets the latest revision of the designated resource descriptor ornullin 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
nullin case the corresponding resource descriptor does not exist.
-
getResource
Gets the (latest revision of the) designated resource ornullin 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
nullin case the corresponding resource does not exist.
-
getResourceIncrementally
The same asgetResource(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
ServerStreamornullin case the corresponding resource does not exist. The caller is responsible for closing.
-
getResource
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, anIllegalArgumentExceptionwill be thrown.
-
getResourceIncrementally
The same asgetResource(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
ServerStreamornullin 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, anIllegalArgumentExceptionwill be thrown.
-