Interface Source<R extends ResourceId>

    • Method Detail

      • id

        java.lang.String id()
        The unique identifier of the given source in the given Ressor context.
        Returns:
        the source ID
      • loadIfModified

        LoadedResource loadIfModified​(R resourceId,
                                      SourceVersion version)
        Loads the contents of the resource if it was modified since the provided version.
        Parameters:
        resourceId - the resource id which should be reloaded
        version - the last modified version prior which the resource shouldn't be loaded
        Returns:
        the loaded resource or null
        Throws:
        java.lang.RuntimeException - or its subclass in case of any error
      • isListenable

        boolean isListenable()
        Describes whether you can subscribe for the changes on this resource.
        Returns:
        true if subscribe(ResourceId, Runnable) call is supported, otherwise false
      • subscribe

        Subscription subscribe​(R resourceId,
                               java.lang.Runnable listener)
        Subscribe for the change events from the Source.
        Returns:
        subscription handle if isListenable() true, otherwise null
      • describe

        java.lang.String describe()
        Returns description of the service in any format.
      • load

        default LoadedResource load​(R resourceId)
        Load resource forcibly from the Source.
        Parameters:
        resourceId - the resource id which should be reloaded
        Returns:
        the loaded resource or null