001package ca.uhn.fhir.jpa.model.search; 002 003/*- 004 * #%L 005 * HAPI FHIR JPA Model 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.rest.api.server.RequestDetails; 024import ca.uhn.fhir.util.StopWatch; 025 026import javax.annotation.Nullable; 027 028/** 029 * This class contains a runtime in-memory description of a search operation, 030 * including details on processing time and other things 031 */ 032public class SearchRuntimeDetails { 033 private final String mySearchUuid; 034 private final RequestDetails myRequestDetails; 035 private StopWatch myQueryStopwatch; 036 private int myFoundMatchesCount; 037 private boolean myLoadSynchronous; 038 private String myQueryString; 039 private SearchStatusEnum mySearchStatus; 040 private int myFoundIndexMatchesCount; 041 042 public SearchRuntimeDetails(RequestDetails theRequestDetails, String theSearchUuid) { 043 myRequestDetails = theRequestDetails; 044 mySearchUuid = theSearchUuid; 045 } 046 047 @Nullable 048 public RequestDetails getRequestDetails() { 049 return myRequestDetails; 050 } 051 052 public String getSearchUuid() { 053 return mySearchUuid; 054 } 055 056 public StopWatch getQueryStopwatch() { 057 return myQueryStopwatch; 058 } 059 060 public void setQueryStopwatch(StopWatch theQueryStopwatch) { 061 myQueryStopwatch = theQueryStopwatch; 062 } 063 064 public int getFoundMatchesCount() { 065 return myFoundMatchesCount; 066 } 067 068 public void setFoundMatchesCount(int theFoundMatchesCount) { 069 myFoundMatchesCount = theFoundMatchesCount; 070 } 071 072 public int getFoundIndexMatchesCount() { 073 return myFoundIndexMatchesCount; 074 } 075 076 public void setFoundIndexMatchesCount(int theFoundIndexMatchesCount) { 077 myFoundIndexMatchesCount = theFoundIndexMatchesCount; 078 } 079 080 public boolean getLoadSynchronous() { 081 return myLoadSynchronous; 082 } 083 084 public void setLoadSynchronous(boolean theLoadSynchronous) { 085 myLoadSynchronous = theLoadSynchronous; 086 } 087 088 public String getQueryString() { 089 return myQueryString; 090 } 091 092 public void setQueryString(String theQueryString) { 093 myQueryString = theQueryString; 094 } 095 096 public SearchStatusEnum getSearchStatus() { 097 return mySearchStatus; 098 } 099 100 public void setSearchStatus(SearchStatusEnum theSearchStatus) { 101 mySearchStatus = theSearchStatus; 102 } 103}