Package org.intermine.client.core
Interface Request
-
- All Known Implementing Classes:
MultiPartRequest
,QueryService.QueryRequest
,RequestImpl
,TemplateService.TemplateRequest
public interface Request
Client request interface. Client creates the request using following methods and sends it to the server.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Request.RequestType
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addParameter(java.lang.String name, java.lang.String value)
Adds parameter.ContentType
getContentType()
java.lang.String
getEncodedUrl()
java.lang.String
getHeader(java.lang.String name)
Returns the header value.java.util.Map<java.lang.String,java.lang.String>
getHeaders()
Returns request headers.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.java.util.Map<java.lang.String,java.util.List<java.lang.String>>
getParameterMap()
Returns all parameters as an unmodifiable map.java.util.Set<java.lang.String>
getParameterNames()
java.util.List<java.lang.String>
getParameterValues(java.lang.String name)
java.lang.String
getServiceUrl()
Returns service URL.Request.RequestType
getType()
java.lang.String
getUnencodedUrl()
void
setAuthToken(java.lang.String token)
Set the authentication token for the requestvoid
setContentType(ContentType contentType)
void
setHeader(java.lang.String name, java.lang.String value)
Sets a request header.void
setPage(Page page)
Set the page for this request.void
setParameter(java.lang.String name, java.lang.String value)
Sets parametervoid
setServiceUrl(java.lang.String url)
Sets service URL.void
setType(Request.RequestType type)
void
setUrl(java.lang.String url)
Sets whole request URL.
-
-
-
Method Detail
-
addParameter
void addParameter(java.lang.String name, java.lang.String value)
Adds parameter.- Parameters:
name
- parameter namevalue
- parameter value
-
getParameterValues
java.util.List<java.lang.String> getParameterValues(java.lang.String name)
- Parameters:
name
- parameter name- Returns:
- parameter values
-
getParameter
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.- Parameters:
name
- parameter name- Returns:
- parameter value
-
getParameterNames
java.util.Set<java.lang.String> getParameterNames()
- Returns:
- names of all parameters
-
setParameter
void setParameter(java.lang.String name, java.lang.String value)
Sets parameter- Parameters:
name
- parameter namevalue
- parameter value
-
setAuthToken
void setAuthToken(java.lang.String token)
Set the authentication token for the request- Parameters:
token
- the Authentication token for this request.
-
getType
Request.RequestType getType()
- Returns:
- request type
- See Also:
Request.RequestType
-
setType
void setType(Request.RequestType type)
- Parameters:
type
- request type- See Also:
Request.RequestType
-
getServiceUrl
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- Returns:
- URL as a string
-
setServiceUrl
void setServiceUrl(java.lang.String url)
Sets service URL.- Parameters:
url
- URL as a string- See Also:
setType(org.intermine.webservice.client.core.Request.RequestType)
-
setUrl
void setUrl(java.lang.String url)
Sets whole request URL. Must not be URL encoded.- Parameters:
url
- URL
-
getEncodedUrl
java.lang.String getEncodedUrl()
- Returns:
- the URL-encoded URL.
- See Also:
- URL encoding specification
-
getUnencodedUrl
java.lang.String getUnencodedUrl()
- Returns:
- Get the URL as an un-encoded (ie. human-readable) string.
-
getContentType
ContentType getContentType()
- Returns:
- content type
-
setContentType
void setContentType(ContentType contentType)
- Parameters:
contentType
- content type
-
getParameterMap
java.util.Map<java.lang.String,java.util.List<java.lang.String>> getParameterMap()
Returns all parameters as an unmodifiable map.- Returns:
- map
-
setHeader
void setHeader(java.lang.String name, java.lang.String value)
Sets a request header.- Parameters:
name
- the header namevalue
- the header value
-
getHeader
java.lang.String getHeader(java.lang.String name)
Returns the header value.- Parameters:
name
- the header name- Returns:
- the header value
-
getHeaders
java.util.Map<java.lang.String,java.lang.String> getHeaders()
Returns request headers.- Returns:
- headers
-
setPage
void setPage(Page page)
Set the page for this request. The page delimits which subsection of the results you wish to receive.- Parameters:
page
- The page
-
-