Interface LocalGadgetSpecProvider

All Superinterfaces:
GadgetSpecProvider

public interface LocalGadgetSpecProvider extends GadgetSpecProvider
A provider of gadget specs that are avaiable locally, without making an HTTP request to fetch them. Implementations of GadgetSpecProvider that serve gadget specs that are intended to be rendered by the same server that they are published from should implement this interface in order to eliminate the need for the renderer to make a loopback HTTP request to fetch the gadget spec.
Since:
1.1
  • Method Details

    • writeGadgetSpecTo

      void writeGadgetSpecTo(URI gadgetSpecUri, OutputStream output) throws GadgetSpecUriNotAllowedException, IOException
      Writes the gadget spec found at the specified URI, to the specified OutputStream. It is assumed that the caller has already checked that the URI is provided by this provider by calling the GadgetSpecProvider.contains(java.net.URI) method. If not, this method will throw a com.atlassian.gadgets.GadgetSpecUriNotAllowedException.
      Parameters:
      gadgetSpecUri - URI of the gadget spec to write. Must not be null or a NullPointerException will be thrown.
      output - the OutputStream to write the gadget spec XML to. Must not be null, or a NullPointerException will be thrown.
      Throws:
      GadgetSpecUriNotAllowedException - if the provided gadget spec URI cannot be written by this provider
      IOException - if an error occurs in I/O processing
      NullPointerException - if any argument is null
    • getLastModified

      Date getLastModified(URI gadgetSpecUri)
      Return the date the gadget spec was last modified.
      Returns:
      date the gadget spec was last modified.