com.deepshiftlabs.nerrvana
Class HttpCommunicator

java.lang.Object
  extended by com.deepshiftlabs.nerrvana.HttpCommunicator

public class HttpCommunicator
extends Object

Class which communicates with Nerrvana (by performing API calls and interpreting responses) It is wrapped around Apache HttpClient.

Version:
1.00
Author:
Deep Shift Labs, Victor Orlov

Field Summary
static String[] PARAMS
           
 
Constructor Summary
HttpCommunicator(NerrvanaPluginSettings settings)
           
 
Method Summary
 Testrun createTestrun(String space_id, String name, String descr, List<Platform> platforms, String executable_file, boolean bValidation, int nodes_count)
           Calls Nerrvana API to create Nerrvana test run All function parameters are obtained from @see NerrvanaPluginSettings object, which, in turn obtains them from plugin settings.
 org.apache.http.HttpEntity get(String resource, List<org.apache.http.NameValuePair> params)
          HTTP GET shortcut
 NerrvanaExecution getExecutionStatus(String exec_id)
          Calls Nerrvana API to get status of the execution by id
 org.apache.http.HttpEntity post(String resource, List<org.apache.http.NameValuePair> params)
          HTTP POST shortcut
 void traceParams(org.apache.http.params.HttpParams params)
          Function for log/debug
 void traceResponseHeaders(org.apache.http.HttpResponse response)
          Function for log/debug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAMS

public static final String[] PARAMS
Constructor Detail

HttpCommunicator

public HttpCommunicator(NerrvanaPluginSettings settings)
Method Detail

traceResponseHeaders

public void traceResponseHeaders(org.apache.http.HttpResponse response)
                          throws Exception
Function for log/debug

Parameters:
response -
Throws:
Exception

traceParams

public void traceParams(org.apache.http.params.HttpParams params)
                 throws Exception
Function for log/debug

Parameters:
params -
Throws:
Exception

get

public org.apache.http.HttpEntity get(String resource,
                                      List<org.apache.http.NameValuePair> params)
                               throws Exception
HTTP GET shortcut

Parameters:
resource - address of the HTTP server
params - list of name/value pairs
Returns:
server response as HttpEntity
Throws:
Exception

post

public org.apache.http.HttpEntity post(String resource,
                                       List<org.apache.http.NameValuePair> params)
                                throws Exception
HTTP POST shortcut

Parameters:
resource - address of the HTTP server
params - list of name/value pairs
Returns:
server response as HttpEntity
Throws:
Exception

getExecutionStatus

public NerrvanaExecution getExecutionStatus(String exec_id)
                                     throws Exception
Calls Nerrvana API to get status of the execution by id

Parameters:
exec_id - ID of the NerrvanaExecution to get status of
Returns:
NerrvanaExecution object from server response
Throws:
Exception

createTestrun

public Testrun createTestrun(String space_id,
                             String name,
                             String descr,
                             List<Platform> platforms,
                             String executable_file,
                             boolean bValidation,
                             int nodes_count)
                      throws Exception

Calls Nerrvana API to create Nerrvana test run

All function parameters are obtained from @see NerrvanaPluginSettings object, which, in turn obtains them from plugin settings.

Parameters:
space_id -
name -
descr -
platforms -
executable_file -
bValidation -
nodes_count -
Returns:
Throws:
Exception


Copyright © 2004-2013 Deep Shift Labs. All Rights Reserved.