@Override public IBundleProvider history(final IIdType theId, final Date theSince, Date theUntil, RequestDetails theRequestDetails) { // Notify interceptors ActionRequestDetails requestDetails = new ActionRequestDetails(theRequestDetails, getResourceName(), theId); notifyInterceptors(RestOperationTypeEnum.HISTORY_INSTANCE, requestDetails); StopWatch w = new StopWatch(); IIdType id = theId.withResourceType(myResourceName).toUnqualifiedVersionless(); BaseHasResource entity = readEntity(id); IBundleProvider retVal = super.history(myResourceName, entity.getId(), theSince, theUntil); ourLog.debug("Processed history on {} in {}ms", id, w.getMillisAndRestart()); return retVal; }
IIdType subscriptionId = theSubscriptionId; if (!subscriptionId.hasResourceType()) { subscriptionId = subscriptionId.withResourceType(ResourceTypeEnum.SUBSCRIPTION.getCode());
@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()); } PatchTypeEnum patchType = (PatchTypeEnum) theArgs[myPatchTypeParameterIndex]; String body = (String) theArgs[myResourceParamIndex]; HttpPatchClientInvocation retVal = createPatchInvocation(getContext(), idDt, patchType, body); for (int idx = 0; idx < theArgs.length; idx++) { IParameter nextParam = getParameters().get(idx); nextParam.translateClientArgumentIntoQueryArgument(getContext(), theArgs[idx], null, null); } return retVal; }
@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; }
if (id.hasResourceType() == false) { String resName = myContext.getResourceDefinition(nextRes).getName(); id = id.withResourceType(resName);
if (id.hasResourceType() == false) { String resName = myContext.getResourceDefinition(nextRes).getName(); id = id.withResourceType(resName);
if (id.hasResourceType() == false) { String resName = myContext.getResourceDefinition(nextRes).getName(); id = id.withResourceType(resName);
if (id.hasResourceType() == false) { String resName = myContext.getResourceDefinition(nextRes).getName(); id = id.withResourceType(resName);
if (id.hasResourceType() == false) { String resName = myContext.getResourceDefinition(nextRes).getName(); id = id.withResourceType(resName);
if (nextId.hasIdPart()) { if (!nextId.hasResourceType()) { nextId = nextId.withResourceType(appliesToResourceType);
} else { if (!refId.hasResourceType()) { refId = refId.withResourceType(myContext.getResourceDefinition(theRef.getResource()).getName()); ref = ref.withResourceType(myContext.getResourceDefinition(theRef.getResource()).getName());
responseId = responseId.withResourceType(getResourceName());
protected void updateResourceMetadata(IBaseResourceEntity theEntity, IBaseResource theResource) { IIdType id = theEntity.getIdDt(); if (getContext().getVersion().getVersion().isRi()) { id = getContext().getVersion().newIdType().setValue(id.getValue()); } if (id.hasResourceType() == false) { id = id.withResourceType(theEntity.getResourceType()); } theResource.setId(id); if (theResource instanceof IResource) { ResourceMetadataKeyEnum.VERSION.put((IResource) theResource, id.getVersionIdPart()); ResourceMetadataKeyEnum.UPDATED.put((IResource) theResource, theEntity.getUpdated()); } else { IBaseMetaType meta = theResource.getMeta(); meta.setVersionId(id.getVersionIdPart()); meta.setLastUpdated(theEntity.getUpdatedDate()); } }
@Override public IBundleProvider history(final IIdType theId, final Date theSince, Date theUntil, RequestDetails theRequestDetails) { // Notify interceptors ActionRequestDetails requestDetails = new ActionRequestDetails(theRequestDetails, getResourceName(), theId); notifyInterceptors(RestOperationTypeEnum.HISTORY_INSTANCE, requestDetails); StopWatch w = new StopWatch(); IIdType id = theId.withResourceType(myResourceName).toUnqualifiedVersionless(); BaseHasResource entity = readEntity(id); IBundleProvider retVal = super.history(myResourceName, entity.getId(), theSince, theUntil); ourLog.debug("Processed history on {} in {}ms", id, w.getMillisAndRestart()); return retVal; }
@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 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()); } PatchTypeEnum patchType = (PatchTypeEnum) theArgs[myPatchTypeParameterIndex]; String body = (String) theArgs[myResourceParamIndex]; HttpPatchClientInvocation retVal = createPatchInvocation(getContext(), idDt, patchType, body); for (int idx = 0; idx < theArgs.length; idx++) { IParameter nextParam = getParameters().get(idx); nextParam.translateClientArgumentIntoQueryArgument(getContext(), theArgs[idx], null, null); } return retVal; }
IIdType subscriptionId = theSubscriptionId; if (!subscriptionId.hasResourceType()) { subscriptionId = subscriptionId.withResourceType(ResourceTypeEnum.SUBSCRIPTION.getCode());
if (id.hasResourceType() == false) { String resName = myContext.getResourceDefinition(nextRes).getName(); id = id.withResourceType(resName);
} else { if (!refId.hasResourceType()) { refId = refId.withResourceType(myContext.getResourceDefinition(theRef.getResource()).getName()); ref = ref.withResourceType(myContext.getResourceDefinition(theRef.getResource()).getName());
protected void updateResourceMetadata(IBaseResourceEntity theEntity, IBaseResource theResource) { IIdType id = theEntity.getIdDt(); if (getContext().getVersion().getVersion().isRi()) { id = getContext().getVersion().newIdType().setValue(id.getValue()); } if (id.hasResourceType() == false) { id = id.withResourceType(theEntity.getResourceType()); } theResource.setId(id); if (theResource instanceof IResource) { ResourceMetadataKeyEnum.VERSION.put((IResource) theResource, id.getVersionIdPart()); ResourceMetadataKeyEnum.UPDATED.put((IResource) theResource, theEntity.getUpdated()); } else { IBaseMetaType meta = theResource.getMeta(); meta.setVersionId(id.getVersionIdPart()); meta.setLastUpdated(theEntity.getUpdatedDate()); } }