com.dtolabs.client.services
Class ServerService

java.lang.Object
  extended by com.dtolabs.client.services.ServerService

public class ServerService
extends java.lang.Object

ServerService provides the ability to make webservice requests to the Web server.


Nested Class Summary
static interface ServerService.WebConnectionParameters
          An interface for providing connection parameters for the web app
 
Constructor Summary
ServerService(Framework framework)
          Create ServerService using the Framework to provdie connection parameters
ServerService(ServerService.WebConnectionParameters connParams)
          Create ServerService using the connection parameters
 
Method Summary
 ServerService.WebConnectionParameters getConnParams()
          Return the connection params configured for this ServerService
 WebserviceResponse makeRundeckRequest(java.lang.String urlPath, java.util.Map queryParams, java.io.File uploadFile, java.lang.String method, java.lang.String uploadFileParam)
          Make the request to the ItNav workbench.
 WebserviceResponse makeRundeckRequest(java.lang.String urlPath, java.util.Map queryParams, java.io.File uploadFile, java.lang.String method, java.lang.String expectedContentType, java.util.Map<java.lang.String,? extends java.lang.Object> formData, java.lang.String uploadFileParam)
          Make the request to the ItNav workbench.
 WebserviceResponse makeRundeckRequest(java.lang.String urlPath, java.util.Map queryParams, java.io.File uploadFile, java.lang.String method, java.lang.String expectedContentType, java.lang.String uploadFileParam)
          Make the request to the ItNav workbench.
 WebserviceResponse makeRundeckRequest(java.lang.String urlPath, java.util.Map queryParams, java.util.Map<java.lang.String,? extends java.lang.Object> formData)
          Make the request to the ItNav workbench.
 void setConnParams(ServerService.WebConnectionParameters connParams)
          Set the connection params.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerService

public ServerService(Framework framework)
Create ServerService using the Framework to provdie connection parameters

Parameters:
framework - Framework to provide connection parameters

ServerService

public ServerService(ServerService.WebConnectionParameters connParams)
Create ServerService using the connection parameters

Parameters:
connParams - the connection info
Method Detail

makeRundeckRequest

public WebserviceResponse makeRundeckRequest(java.lang.String urlPath,
                                             java.util.Map queryParams,
                                             java.io.File uploadFile,
                                             java.lang.String method,
                                             java.lang.String uploadFileParam)
                                      throws CoreException,
                                             java.net.MalformedURLException
Make the request to the ItNav workbench.

Parameters:
urlPath - the path for the request
queryParams - any query parameters
uploadFile - a file to upload with the request.
method - HTTP connection method, e.g. "get","post","put","delete".
uploadFileParam - name of the uploaded file param
Returns:
parsed XML document, or null
Throws:
CoreException - if an error occurs
java.net.MalformedURLException - if connection URL or urlPath params are malformed.

makeRundeckRequest

public WebserviceResponse makeRundeckRequest(java.lang.String urlPath,
                                             java.util.Map queryParams,
                                             java.util.Map<java.lang.String,? extends java.lang.Object> formData)
                                      throws CoreException,
                                             java.net.MalformedURLException
Make the request to the ItNav workbench.

Parameters:
urlPath - the path for the request
queryParams - any query parameters
uploadFile - a file to upload with the request.
method - HTTP connection method, e.g. "get","post","put","delete".
Returns:
parsed XML document, or null
Throws:
CoreException - if an error occurs
java.net.MalformedURLException - if connection URL or urlPath params are malformed.

makeRundeckRequest

public WebserviceResponse makeRundeckRequest(java.lang.String urlPath,
                                             java.util.Map queryParams,
                                             java.io.File uploadFile,
                                             java.lang.String method,
                                             java.lang.String expectedContentType,
                                             java.lang.String uploadFileParam)
                                      throws CoreException,
                                             java.net.MalformedURLException
Make the request to the ItNav workbench.

Parameters:
uploadFileParam - name of the uploaded file param
urlPath - the path for the request
queryParams - any query parameters
uploadFile - a file to upload with the request.
method - HTTP connection method, e.g. "get","post","put","delete".
Returns:
parsed XML document, or null
Throws:
CoreException - if an error occurs
java.net.MalformedURLException - if connection URL or urlPath params are malformed.

makeRundeckRequest

public WebserviceResponse makeRundeckRequest(java.lang.String urlPath,
                                             java.util.Map queryParams,
                                             java.io.File uploadFile,
                                             java.lang.String method,
                                             java.lang.String expectedContentType,
                                             java.util.Map<java.lang.String,? extends java.lang.Object> formData,
                                             java.lang.String uploadFileParam)
                                      throws CoreException,
                                             java.net.MalformedURLException
Make the request to the ItNav workbench.

Parameters:
uploadFileParam - name of the uploaded file param
urlPath - the path for the request
queryParams - any query parameters
uploadFile - a file to upload with the request.
method - HTTP connection method, e.g. "get","post","put","delete".
Returns:
parsed XML document, or null
Throws:
CoreException - if an error occurs
java.net.MalformedURLException - if connection URL or urlPath params are malformed.

getConnParams

public ServerService.WebConnectionParameters getConnParams()
Return the connection params configured for this ServerService

Returns:
connection params

setConnParams

public void setConnParams(ServerService.WebConnectionParameters connParams)
Set the connection params.

Parameters:
connParams - connection params