smartrics.rest.client
Class RestRequest

java.lang.Object
  extended by smartrics.rest.client.RestData
      extended by smartrics.rest.client.RestRequest

public class RestRequest
extends RestData

Wraps a REST request object.


Nested Class Summary
static class RestRequest.Method
          An http verb (those supported).
 
Nested classes/interfaces inherited from class smartrics.rest.client.RestData
RestData.Header
 
Field Summary
 
Fields inherited from class smartrics.rest.client.RestData
LINE_SEPARATOR
 
Constructor Summary
RestRequest()
           
 
Method Summary
 String getFileName()
           
 RestRequest.Method getMethod()
           
 String getMultipartFileName()
           
 String getMultipartFileParameterName()
           
 String getQuery()
           
 boolean isValid()
          Checks validity of this request.
 RestRequest setFileName(String fileName)
          Sets the upload file name for this request.
 RestRequest setMethod(RestRequest.Method method)
          Sets the method for this request.
 RestRequest setMultipartFileName(String multipartFileName)
          Sets the multipart upload file name for this request.
 RestRequest setMultipartFileParameterName(String multipartFileParameterName)
          Sets the multipart file form parameter name for this request.
 RestRequest setQuery(String query)
          Sets the query for this request.
 String toString()
          String representation of this request.
 
Methods inherited from class smartrics.rest.client.RestData
addHeader, addHeaders, addHeaders, getBody, getHeader, getHeaders, getResource, getTransactionId, setBody, setResource, setTransactionId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RestRequest

public RestRequest()
Method Detail

getMethod

public RestRequest.Method getMethod()
Returns:
the method for this request

setMethod

public RestRequest setMethod(RestRequest.Method method)
Sets the method for this request.

Parameters:
method - the method
Returns:
this request
See Also:
RestRequest.Method

getQuery

public String getQuery()
Returns:
the query for this request

setQuery

public RestRequest setQuery(String query)
Sets the query for this request.

Parameters:
query - the query
Returns:
this request

getFileName

public String getFileName()
Returns:
the upload file name for this request

getMultipartFileName

public String getMultipartFileName()
Returns:
the multipart upload file name for this request

getMultipartFileParameterName

public String getMultipartFileParameterName()
Returns:
the multipart file form parameter name for this request

setMultipartFileParameterName

public RestRequest setMultipartFileParameterName(String multipartFileParameterName)
Sets the multipart file form parameter name for this request.

Parameters:
multipartFileParameterName - the multipart file form parameter name
Returns:
this request

setMultipartFileName

public RestRequest setMultipartFileName(String multipartFileName)
Sets the multipart upload file name for this request.

Parameters:
multipartFileName - the multipart file name
Returns:
this request

setFileName

public RestRequest setFileName(String fileName)
Sets the upload file name for this request.

Parameters:
fileName - the upload file name
Returns:
this request

isValid

public boolean isValid()
Checks validity of this request. In this implementation a request is valid if both the method and the resource Uri not null

Returns:
true if valid

toString

public String toString()
String representation of this request.

Overrides:
toString in class RestData
Returns:
the string representation


Copyright © 2012 smartrics. All Rights Reserved.