co.cask.cdap.test.internal
Class DefaultProcedureClient

java.lang.Object
  extended by co.cask.cdap.test.internal.DefaultProcedureClient
All Implemented Interfaces:
ProcedureClient

public final class DefaultProcedureClient
extends Object
implements ProcedureClient

Simple procedure client that uses java URLConnection to fire requests.


Constructor Summary
DefaultProcedureClient(org.apache.twill.discovery.DiscoveryServiceClient discoveryServiceClient, String accountId, String applicationId, String procedureName)
           
 
Method Summary
 String query(String method, Map<String,String> arguments)
          Makes a query to the procedure with String result.
 byte[] queryRaw(String method, Map<String,String> arguments)
          Makes a query to the procedure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultProcedureClient

@Inject
public DefaultProcedureClient(org.apache.twill.discovery.DiscoveryServiceClient discoveryServiceClient,
                                     String accountId,
                                     String applicationId,
                                     String procedureName)
Method Detail

queryRaw

public byte[] queryRaw(String method,
                       Map<String,String> arguments)
                throws IOException
Description copied from interface: ProcedureClient
Makes a query to the procedure.

Specified by:
queryRaw in interface ProcedureClient
Parameters:
method - Name of the procedure method to query against.
arguments - Arguments to be submitted to the procedure for the query.
Returns:
A byte array representing the response.
Throws:
IOException - When there is error querying the procedure.

query

public String query(String method,
                    Map<String,String> arguments)
             throws IOException
Description copied from interface: ProcedureClient
Makes a query to the procedure with String result.

Specified by:
query in interface ProcedureClient
Parameters:
method - Name of the procedure method to query against.
arguments - Arguments to be submitted to the procedure for the query.
Returns:
A String representing the response.
Throws:
IOException - When there is error querying the procedure.


Copyright © 2015 Cask Data, Inc. Licensed under the Apache License, Version 2.0.