Exemplo n.º 1
0
 @SuppressWarnings("unchecked")
 @Override
 public T execute() {
   if (myResources != null) {
     ResourceListResponseHandler binding = new ResourceListResponseHandler(null);
     BaseHttpClientInvocation invocation =
         TransactionMethodBinding.createTransactionInvocation(myResources, myContext);
     Map<String, List<String>> params = new HashMap<String, List<String>>();
     return (T) invoke(params, binding, invocation);
   } else {
     BundleResponseHandler binding = new BundleResponseHandler(null);
     BaseHttpClientInvocation invocation =
         TransactionMethodBinding.createTransactionInvocation(myBundle, myContext);
     Map<String, List<String>> params = new HashMap<String, List<String>>();
     return (T) invoke(params, binding, invocation);
   }
 }
Exemplo n.º 2
0
  @Override
  public List<IResource> transaction(List<IResource> theResources) {
    BaseHttpClientInvocation invocation =
        TransactionMethodBinding.createTransactionInvocation(theResources, myContext);
    if (isKeepResponses()) {
      myLastRequest = invocation.asHttpRequest(getServerBase(), createExtraParams(), getEncoding());
    }

    Bundle resp =
        invokeClient(
            myContext, new BundleResponseHandler(null), invocation, myLogRequestAndResponse);

    return resp.toListOfResources();
  }