Interface ResourceProvider
-
public interface ResourceProviderThis 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]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.ResourceDescriptorgetResourceDescriptor(SessionToken session, UUID resourceID)Gets the latest revision of the designated resource descriptor ornullin case no resource descriptor with the designated ID exists.ServerStreamgetResourceIncrementally(SessionToken session, ResourceDescriptor resourceDescriptor)The same asgetResource(SessionToken, ResourceDescriptor)but with incremental retrieval of the resource.ServerStreamgetResourceIncrementally(SessionToken session, UUID resourceID)The same asgetResource(SessionToken, UUID)but with incremental retrieval of the resource.
-
-
-
Method Detail
-
getResourceDescriptor
ResourceDescriptor getResourceDescriptor(SessionToken session, UUID resourceID)
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
byte[] getResource(SessionToken session, UUID resourceID)
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
ServerStream getResourceIncrementally(SessionToken session, UUID resourceID)
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
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, anIllegalArgumentExceptionwill be thrown.
-
getResourceIncrementally
ServerStream getResourceIncrementally(SessionToken session, ResourceDescriptor resourceDescriptor)
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.
-
-