Class ModelService


  • public class ModelService
    extends WebService
    Web service that returns a serialised representation of the data model. The currently supported formats are JSON and XML.
    Author:
    Jakub Kulaviak, Alex Kalderimis
    • Constructor Detail

      • ModelService

        public ModelService​(InterMineAPI im)
        Constructor.
        Parameters:
        im - The API settings bundle
    • Method Detail

      • makeXMLOutput

        protected Output makeXMLOutput​(java.io.PrintWriter out,
                                       java.lang.String separator)
        Description copied from class: WebService
        Make the XML output given the HttpResponse's PrintWriter.
        Overrides:
        makeXMLOutput in class WebService
        Parameters:
        out - The PrintWriter from the HttpResponse.
        separator - the line-separator for the client's platform.
        Returns:
        An Output that produces good XML.
      • getDefaultFormat

        protected Format getDefaultFormat()
        Overrides:
        getDefaultFormat in class WebService
        Returns:
        The default format constant for this service.
      • initState

        protected void initState()
        Description copied from class: WebService
        Subclasses can put initialisation here.
        Overrides:
        initState in class WebService
      • canServe

        protected boolean canServe​(Format format)
        Description copied from class: WebService
        Check whether the format is acceptable. By default returns true. Services with a particular set of accepted formats should override this and check.
        Overrides:
        canServe in class WebService
        Parameters:
        format - The format to check.
        Returns:
        whether or not this format is acceptable.
      • execute

        protected void execute()
        Runs service. This is abstract method, that must be defined in subclasses and so performs something useful. Standard procedure is overwrite this method in subclasses and let this method to be called from WebService.doGet method that encapsulates logic common for all web services else you can overwrite doGet method in your web service class and manage all the things alone.}
        Specified by:
        execute in class WebService