Class RequestImpl

    • Field Detail

      • FORMAT_PARAMETER_JSON_OBJ

        protected static final java.lang.String FORMAT_PARAMETER_JSON_OBJ
        See Also:
        Constant Field Values
      • FORMAT_PARAMETER_JSON_ROWS

        protected static final java.lang.String FORMAT_PARAMETER_JSON_ROWS
        See Also:
        Constant Field Values
      • FORMAT_PARAMETER_XML

        protected static final java.lang.String FORMAT_PARAMETER_XML
        See Also:
        Constant Field Values
      • FORMAT_PARAMETER_COUNT

        protected static final java.lang.String FORMAT_PARAMETER_COUNT
        See Also:
        Constant Field Values
    • Constructor Detail

      • RequestImpl

        public RequestImpl​(Request.RequestType type,
                           java.lang.String url,
                           ContentType contentType)
        Constructor.
        Parameters:
        type - type
        url - URL
        contentType - content type
    • Method Detail

      • addParameter

        public void addParameter​(java.lang.String name,
                                 java.lang.String value)
        Adds parameter.
        Specified by:
        addParameter in interface Request
        Parameters:
        name - parameter name
        value - parameter value
      • getParameterValues

        public java.util.List<java.lang.String> getParameterValues​(java.lang.String name)
        Specified by:
        getParameterValues in interface Request
        Parameters:
        name - parameter name
        Returns:
        parameter values
      • getParameter

        public java.lang.String getParameter​(java.lang.String name)
        Use only if you are sure, that the parameter has only one value else use getParameterValues method.
        Specified by:
        getParameter in interface Request
        Parameters:
        name - parameter name
        Returns:
        parameter value
      • getParameterNames

        public java.util.Set<java.lang.String> getParameterNames()
        Specified by:
        getParameterNames in interface Request
        Returns:
        names of all parameters
      • setParameter

        public void setParameter​(java.lang.String name,
                                 java.lang.String value)
        Sets parameter
        Specified by:
        setParameter in interface Request
        Parameters:
        name - parameter name
        value - parameter value
      • getServiceUrl

        public java.lang.String getServiceUrl()
        Returns service URL. Service URL is the URL of service without service parameters. Example: http://www.flymine.org/service/query/results
        Specified by:
        getServiceUrl in interface Request
        Returns:
        URL as a string
      • setUrl

        public void setUrl​(java.lang.String url)
        Sets whole request URL. Must not be URL encoded.
        Specified by:
        setUrl in interface Request
        Parameters:
        url - URL
      • setMaxCount

        public void setMaxCount​(int maxCount)
        Sets the maximum number of rows returned.
        Parameters:
        maxCount - an integer number of rows, where outer joins count as multiple rows
      • setStart

        public void setStart​(int start)
        Set the start parameter.
        Parameters:
        start - The index of the first result to include.
      • setFormat

        public void setFormat​(java.lang.String format)
        Set the format for the request.
        Parameters:
        format - The format of the request.
      • setJSONFormat

        public void setJSONFormat()
        Set the format as JSON-Object format.
      • setJSONRowsFormat

        public void setJSONRowsFormat()
        Set the format as JSON-Rows format.
      • setXMLFormat

        public void setXMLFormat()
        Set the format as XML format.
      • setCountFormat

        public void setCountFormat()
        Set the format as count format.
      • setContentType

        public void setContentType​(ContentType contentType)
        Specified by:
        setContentType in interface Request
        Parameters:
        contentType - content type
      • getParameterMap

        public java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getParameterMap()
        Returns all parameters as an unmodifiable map.
        Specified by:
        getParameterMap in interface Request
        Returns:
        map
      • getUnencodedUrl

        public java.lang.String getUnencodedUrl()
        Specified by:
        getUnencodedUrl in interface Request
        Returns:
        Get the URL as an un-encoded (ie. human-readable) string.
      • setHeader

        public void setHeader​(java.lang.String name,
                              java.lang.String value)
        Sets a request header.
        Specified by:
        setHeader in interface Request
        Parameters:
        name - the header name
        value - the header value
      • getHeaders

        public java.util.Map<java.lang.String,​java.lang.String> getHeaders()
        Returns request headers.
        Specified by:
        getHeaders in interface Request
        Returns:
        headers
      • getHeader

        public java.lang.String getHeader​(java.lang.String name)
        Returns the header value.
        Specified by:
        getHeader in interface Request
        Parameters:
        name - the header name
        Returns:
        the header value
      • setAuthToken

        public void setAuthToken​(java.lang.String token)
        Description copied from interface: Request
        Set the authentication token for the request
        Specified by:
        setAuthToken in interface Request
        Parameters:
        token - the Authentication token for this request.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • setPage

        public void setPage​(Page page)
        Specify what section of the result set you wish to retrieve.
        Specified by:
        setPage in interface Request
        Parameters:
        page - the subsection of the result set you want.