Example #1
0
  @Override
  public MethodOutcome update(IdDt theIdDt, IResource theResource) {
    BaseHttpClientInvocation invocation =
        MethodUtil.createUpdateInvocation(theResource, null, theIdDt, myContext);
    if (isKeepResponses()) {
      myLastRequest = invocation.asHttpRequest(getServerBase(), createExtraParams(), getEncoding());
    }

    RuntimeResourceDefinition def = myContext.getResourceDefinition(theResource);
    final String resourceName = def.getName();

    OutcomeResponseHandler binding = new OutcomeResponseHandler(resourceName);
    MethodOutcome resp = invokeClient(myContext, binding, invocation, myLogRequestAndResponse);
    return resp;
  }
Example #2
0
    @Override
    public MethodOutcome execute() {
      if (myResource == null) {
        myResource = parseResourceBody(myResourceBody);
      }
      if (myId == null) {
        myId = myResource.getId();
      }
      if (myId == null || myId.hasIdPart() == false) {
        throw new InvalidRequestException(
            "No ID supplied for resource to update, can not invoke server");
      }

      BaseHttpClientInvocation invocation =
          MethodUtil.createUpdateInvocation(myResource, myResourceBody, myId, myContext);

      RuntimeResourceDefinition def = myContext.getResourceDefinition(myResource);
      final String resourceName = def.getName();

      OutcomeResponseHandler binding = new OutcomeResponseHandler(resourceName);

      Map<String, List<String>> params = new HashMap<String, List<String>>();
      return invoke(params, binding, invocation);
    }