public void setCreatedUsingStatusCode(int theResponseStatusCode) { if (theResponseStatusCode == Constants.STATUS_HTTP_201_CREATED) { setCreated(true); } } }
public SortInternal(SortSpec theSortSpec) { if (theSortSpec.getOrder() == null) { myParamName = Constants.PARAM_SORT; } else if (theSortSpec.getOrder() == SortOrderEnum.ASC) { myParamName = Constants.PARAM_SORT_ASC; } else if (theSortSpec.getOrder() == SortOrderEnum.DESC) { myParamName = Constants.PARAM_SORT_DESC; } myDirection = theSortSpec.getOrder(); myParamValue = theSortSpec.getParamName(); }
public static QualifiedParamList singleton(String theQualifier, String theParamValue) { QualifiedParamList retVal = new QualifiedParamList(1); retVal.setQualifier(theQualifier); retVal.add(theParamValue); return retVal; }
@Override public String toCodeString(RestSearchParameterTypeEnum theEnum) { return theEnum.getCode(); }
@Override public MethodOutcome invokeClient(String theResponseMimeType, InputStream theResponseInputStream, int theResponseStatusCode, Map<String, List<String>> theHeaders) throws IOException, BaseServerResponseException { IBaseResource response = myWrap.invokeClient(theResponseMimeType, theResponseInputStream, theResponseStatusCode, theHeaders); MethodOutcome retVal = new MethodOutcome(); retVal.setResource(response); retVal.setCreatedUsingStatusCode(theResponseStatusCode); retVal.setResponseHeaders(theHeaders); return retVal; } }
private void addContentLocationHeaders(RequestDetails theRequest, HttpServletResponse servletResponse, MethodOutcome response, String resourceName) { if (response != null && response.getId() != null) { addLocationHeader(theRequest, servletResponse, response, Constants.HEADER_LOCATION, resourceName); addLocationHeader(theRequest, servletResponse, response, Constants.HEADER_CONTENT_LOCATION, resourceName); } }
@Override public String getHttpVerbName() { return myRequestType.name(); }
public static EncodingEnum detectEncoding(String theBody) { EncodingEnum retVal = detectEncodingNoDefault(theBody); retVal = ObjectUtils.defaultIfNull(retVal, EncodingEnum.XML); return retVal; }
public static QualifiedParamList singleton(String theParamValue) { return singleton(null, theParamValue); }
public static PreferReturnEnum fromHeaderValue(String theHeaderValue) { if (ourValues == null) { HashMap<String, PreferReturnEnum> values = new HashMap<String, PreferReturnEnum>(); for (PreferReturnEnum next : PreferReturnEnum.values()) { values.put(next.getHeaderValue(), next); } ourValues = values; } return ourValues.get(theHeaderValue); }
@Override public Object outgoingClient(Object theObject) { return ParametersUtil.createString(theContext, ((ValidationModeEnum) theObject).getCode()); } });
private static void addPreferHeader(PreferReturnEnum thePrefer, BaseHttpClientInvocation theInvocation) { if (thePrefer != null) { theInvocation.addHeader(Constants.HEADER_PREFER, Constants.HEADER_PREFER_RETURN + '=' + thePrefer.getHeaderValue()); } }
@Override public String toSystemString(RestSearchParameterTypeEnum theEnum) { return theEnum.getSystem(); }
/** * Is the given type a FHIR legacy (pre-DSTU3) content type? */ public static boolean isLegacy(String theContentType) { String contentTypeSplitted = getTypeWithoutCharset(theContentType); if (contentTypeSplitted == null) { return false; } else { return ourContentTypeToEncodingLegacy.containsKey(contentTypeSplitted); } }
public static HttpPatchClientInvocation createPatchInvocation(FhirContext theContext, IIdType theId, PatchTypeEnum thePatchType, String theBody) { HttpPatchClientInvocation retVal = new HttpPatchClientInvocation(theContext, theId, thePatchType.getContentType(), theBody); return retVal; }
public String getSearchParamType() { if (mySearchParameterBinding != null) { return mySearchParameterBinding.getParamType().getCode(); } return null; }
@Override public DaoMethodOutcome setCreated(Boolean theCreated) { super.setCreated(theCreated); return this; } }
@Override public String getHttpVerbName() { return myRequestTypeEnum.name(); }
@Override public Object outgoingClient(Object theObject) { return ParametersUtil.createString(theContext, ((ValidationModeEnum) theObject).getCode()); } });
public String getSearchParamType() { if (mySearchParameterBinding != null) { return mySearchParameterBinding.getParamType().getCode(); } return null; }