Esempio n. 1
0
  @Override
  public BaseHttpClientInvocation invokeClient(Object[] theArgs) throws InternalErrorException {
    IIdType idDt = (IIdType) theArgs[getIdParameterIndex()];
    if (idDt == null) {
      throw new NullPointerException("ID can not be null");
    }

    if (idDt.hasResourceType() == false) {
      idDt = idDt.withResourceType(getResourceName());
    } else if (getResourceName().equals(idDt.getResourceType()) == false) {
      throw new InvalidRequestException(
          "ID parameter has the wrong resource type, expected '"
              + getResourceName()
              + "', found: "
              + idDt.getResourceType());
    }

    HttpDeleteClientInvocation retVal = createDeleteInvocation(getContext(), idDt);

    for (int idx = 0; idx < theArgs.length; idx++) {
      IParameter nextParam = getParameters().get(idx);
      nextParam.translateClientArgumentIntoQueryArgument(getContext(), theArgs[idx], null, null);
    }

    return retVal;
  }
  @Override
  public HttpGetClientInvocation invokeClient(Object[] theArgs) throws InternalErrorException {
    HttpGetClientInvocation retVal = MethodUtil.createConformanceInvocation(getContext());

    if (theArgs != null) {
      for (int idx = 0; idx < theArgs.length; idx++) {
        IParameter nextParam = getParameters().get(idx);
        nextParam.translateClientArgumentIntoQueryArgument(getContext(), theArgs[idx], null, null);
      }
    }

    return retVal;
  }