Package 

Interface Publication.Service

  • All Implemented Interfaces:
    org.readium.r2.shared.util.Closeable

    
    public interface Publication.Service
     implements Closeable
                        

    Base interface to be implemented by all publication services.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public final class Publication.Service.Context

      Container for the context from which a service is created.

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Resource get(Link link) A service can return a Resource to:
      • respond to a request to its web API declared in links,

      • serve additional resources on behalf of the publication,

      • replace a publication resource by its own version.

      Called by Publication.get for each request.
      Unit close() Closes any opened file handles, removes temporary files, etc.
      List<Link> getLinks()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • get

         Resource get(Link link)

        A service can return a Resource to:

        • respond to a request to its web API declared in links,

        • serve additional resources on behalf of the publication,

        • replace a publication resource by its own version.

        Called by Publication.get for each request.

        Warning: If you need to request one of the publication resources to answer the request, use the Fetcher provided by the Publication.Service.Context instead of Publication.get, otherwise it will trigger an infinite loop.

      • close

         Unit close()

        Closes any opened file handles, removes temporary files, etc.