예제 #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 <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;
  }