001package ca.uhn.fhir.jpa.dao; 002 003/*- 004 * #%L 005 * HAPI FHIR Storage api 006 * %% 007 * Copyright (C) 2014 - 2022 Smile CDR, Inc. 008 * %% 009 * Licensed under the Apache License, Version 2.0 (the "License"); 010 * you may not use this file except in compliance with the License. 011 * You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, software 016 * distributed under the License is distributed on an "AS IS" BASIS, 017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 018 * See the License for the specific language governing permissions and 019 * limitations under the License. 020 * #L% 021 */ 022 023import ca.uhn.fhir.context.FhirContext; 024import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; 025import org.hl7.fhir.instance.model.api.IBase; 026import org.hl7.fhir.instance.model.api.IBaseBundle; 027import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; 028import org.hl7.fhir.instance.model.api.IBaseResource; 029 030import java.util.Date; 031import java.util.List; 032 033public interface ITransactionProcessorVersionAdapter<BUNDLE extends IBaseBundle, BUNDLEENTRY extends IBase> { 034 035 void setResponseStatus(BUNDLEENTRY theBundleEntry, String theStatus); 036 037 void setResponseLastModified(BUNDLEENTRY theBundleEntry, Date theLastModified); 038 039 void setResource(BUNDLEENTRY theBundleEntry, IBaseResource theResource); 040 041 IBaseResource getResource(BUNDLEENTRY theBundleEntry); 042 043 String getBundleType(BUNDLE theRequest); 044 045 void populateEntryWithOperationOutcome(BaseServerResponseException theCaughtEx, BUNDLEENTRY theEntry); 046 047 BUNDLE createBundle(String theBundleType); 048 049 List<BUNDLEENTRY> getEntries(BUNDLE theRequest); 050 051 void addEntry(BUNDLE theBundle, BUNDLEENTRY theEntry); 052 053 BUNDLEENTRY addEntry(BUNDLE theBundle); 054 055 String getEntryRequestVerb(FhirContext theContext, BUNDLEENTRY theEntry); 056 057 String getFullUrl(BUNDLEENTRY theEntry); 058 059 void setFullUrl(BUNDLEENTRY theEntry, String theFullUrl); 060 061 String getEntryIfNoneExist(BUNDLEENTRY theEntry); 062 063 String getEntryRequestUrl(BUNDLEENTRY theEntry); 064 065 void setResponseLocation(BUNDLEENTRY theEntry, String theResponseLocation); 066 067 void setResponseETag(BUNDLEENTRY theEntry, String theEtag); 068 069 String getEntryRequestIfMatch(BUNDLEENTRY theEntry); 070 071 String getEntryRequestIfNoneExist(BUNDLEENTRY theEntry); 072 073 String getEntryRequestIfNoneMatch(BUNDLEENTRY theEntry); 074 075 void setResponseOutcome(BUNDLEENTRY theEntry, IBaseOperationOutcome theOperationOutcome); 076 077 void setRequestVerb(BUNDLEENTRY theEntry, String theVerb); 078 079 void setRequestUrl(BUNDLEENTRY theEntry, String theUrl); 080 081}