예제 #1
0
  @Override
  public <T extends IResource> T vread(final Class<T> theType, IdDt theId, IdDt theVersionId) {
    HttpGetClientInvocation invocation =
        ReadMethodBinding.createVReadInvocation(theId, theVersionId, toResourceName(theType));
    if (isKeepResponses()) {
      myLastRequest = invocation.asHttpRequest(getServerBase(), createExtraParams(), getEncoding());
    }

    ResourceResponseHandler<T> binding = new ResourceResponseHandler<T>(theType, theId);
    T resp = invokeClient(myContext, binding, invocation, myLogRequestAndResponse);
    return resp;
  }
예제 #2
0
  @Override
  public Conformance conformance() {
    HttpGetClientInvocation invocation = MethodUtil.createConformanceInvocation();
    if (isKeepResponses()) {
      myLastRequest = invocation.asHttpRequest(getServerBase(), createExtraParams(), getEncoding());
    }

    ResourceResponseHandler<Conformance> binding =
        new ResourceResponseHandler<Conformance>(Conformance.class, null);
    Conformance resp = invokeClient(myContext, binding, invocation, myLogRequestAndResponse);
    return resp;
  }
예제 #3
0
  @Override
  public <T extends IResource> Bundle history(
      final Class<T> theType, IdDt theIdDt, DateTimeDt theSince, Integer theLimit) {
    String resourceName = theType != null ? toResourceName(theType) : null;
    IdDt id = theIdDt != null && theIdDt.isEmpty() == false ? theIdDt : null;
    HttpGetClientInvocation invocation =
        HistoryMethodBinding.createHistoryInvocation(resourceName, id, theSince, theLimit);
    if (isKeepResponses()) {
      myLastRequest = invocation.asHttpRequest(getServerBase(), createExtraParams(), getEncoding());
    }

    BundleResponseHandler binding = new BundleResponseHandler(theType);
    Bundle resp = invokeClient(myContext, binding, invocation, myLogRequestAndResponse);
    return resp;
  }
예제 #4
0
  @Override
  public <T extends IResource> T read(final Class<T> theType, IdDt theId) {
    if (theId == null || theId.hasIdPart() == false) {
      throw new IllegalArgumentException("theId does not contain a valid ID, is: " + theId);
    }

    HttpGetClientInvocation invocation =
        ReadMethodBinding.createReadInvocation(theId, toResourceName(theType));
    if (isKeepResponses()) {
      myLastRequest = invocation.asHttpRequest(getServerBase(), createExtraParams(), getEncoding());
    }

    ResourceResponseHandler<T> binding = new ResourceResponseHandler<T>(theType, theId);
    T resp = invokeClient(myContext, binding, invocation, myLogRequestAndResponse);
    return resp;
  }