001/*-
002 * #%L
003 * HAPI FHIR Storage api
004 * %%
005 * Copyright (C) 2014 - 2025 Smile CDR, Inc.
006 * %%
007 * Licensed under the Apache License, Version 2.0 (the "License");
008 * you may not use this file except in compliance with the License.
009 * You may obtain a copy of the License at
010 *
011 *      http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing, software
014 * distributed under the License is distributed on an "AS IS" BASIS,
015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016 * See the License for the specific language governing permissions and
017 * limitations under the License.
018 * #L%
019 */
020package ca.uhn.fhir.jpa.api.dao;
021
022public class ReindexParameters {
023        public static final ReindexSearchParametersEnum REINDEX_SEARCH_PARAMETERS_DEFAULT = ReindexSearchParametersEnum.ALL;
024        public static final String REINDEX_SEARCH_PARAMETERS_DEFAULT_STRING = "ALL";
025        public static final boolean OPTIMISTIC_LOCK_DEFAULT = true;
026        public static final OptimizeStorageModeEnum OPTIMIZE_STORAGE_DEFAULT = OptimizeStorageModeEnum.NONE;
027        public static final String OPTIMIZE_STORAGE_DEFAULT_STRING = "NONE";
028        public static final CorrectCurrentVersionModeEnum CORRECT_CURRENT_VERSION_DEFAULT =
029                        CorrectCurrentVersionModeEnum.NONE;
030        public static final String CORRECT_CURRENT_VERSION_DEFAULT_STRING = "NONE";
031        private ReindexSearchParametersEnum myReindexSearchParameters = REINDEX_SEARCH_PARAMETERS_DEFAULT;
032        private OptimizeStorageModeEnum myOptimizeStorage = OPTIMIZE_STORAGE_DEFAULT;
033        private boolean myOptimisticLock = OPTIMISTIC_LOCK_DEFAULT;
034        private CorrectCurrentVersionModeEnum myCorrectCurrentVersion = CORRECT_CURRENT_VERSION_DEFAULT;
035
036        public boolean isOptimisticLock() {
037                return myOptimisticLock;
038        }
039
040        public ReindexParameters setOptimisticLock(boolean theOptimisticLock) {
041                myOptimisticLock = theOptimisticLock;
042                return this;
043        }
044
045        public ReindexSearchParametersEnum getReindexSearchParameters() {
046                return myReindexSearchParameters;
047        }
048
049        public ReindexParameters setReindexSearchParameters(ReindexSearchParametersEnum theReindexSearchParameters) {
050                myReindexSearchParameters = theReindexSearchParameters;
051                return this;
052        }
053
054        public OptimizeStorageModeEnum getOptimizeStorage() {
055                return myOptimizeStorage;
056        }
057
058        public ReindexParameters setOptimizeStorage(OptimizeStorageModeEnum theOptimizeStorage) {
059                myOptimizeStorage = theOptimizeStorage;
060                return this;
061        }
062
063        /**
064         * @since 8.6.0
065         */
066        public ReindexParameters setCorrectCurrentVersion(CorrectCurrentVersionModeEnum theCorrectCurrentVersion) {
067                myCorrectCurrentVersion = theCorrectCurrentVersion;
068                return this;
069        }
070
071        /**
072         * @since 8.6.0
073         */
074        public CorrectCurrentVersionModeEnum getCorrectCurrentVersion() {
075                return myCorrectCurrentVersion;
076        }
077
078        public enum ReindexSearchParametersEnum {
079                ALL,
080                NONE
081        }
082
083        public enum OptimizeStorageModeEnum {
084                NONE,
085                CURRENT_VERSION,
086                ALL_VERSIONS
087        }
088
089        public enum CorrectCurrentVersionModeEnum {
090                ALL,
091                NONE
092        }
093}