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
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 ornull
in case no resource with the designated ID exists.ResourceDescriptor
getResourceDescriptor(SessionToken session, UUID resourceID)
Gets the latest revision of the designated resource descriptor ornull
in case no resource descriptor with the designated ID exists.ServerStream
getResourceIncrementally(SessionToken session, ResourceDescriptor resourceDescriptor)
The same asgetResource(SessionToken, ResourceDescriptor)
but with incremental retrieval of the resource.ServerStream
getResourceIncrementally(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 ornull
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 ornull
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 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
ServerStream
ornull
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, anIllegalArgumentException
will 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
ServerStream
ornull
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, anIllegalArgumentException
will be thrown.
-
-