001/*-
002 * #%L
003 * HAPI FHIR Storage api
004 * %%
005 * Copyright (C) 2014 - 2024 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        private ReindexSearchParametersEnum myReindexSearchParameters = REINDEX_SEARCH_PARAMETERS_DEFAULT;
029        private OptimizeStorageModeEnum myOptimizeStorage = OPTIMIZE_STORAGE_DEFAULT;
030        private boolean myOptimisticLock = OPTIMISTIC_LOCK_DEFAULT;
031
032        public boolean isOptimisticLock() {
033                return myOptimisticLock;
034        }
035
036        public ReindexParameters setOptimisticLock(boolean theOptimisticLock) {
037                myOptimisticLock = theOptimisticLock;
038                return this;
039        }
040
041        public ReindexSearchParametersEnum getReindexSearchParameters() {
042                return myReindexSearchParameters;
043        }
044
045        public ReindexParameters setReindexSearchParameters(ReindexSearchParametersEnum theReindexSearchParameters) {
046                myReindexSearchParameters = theReindexSearchParameters;
047                return this;
048        }
049
050        public OptimizeStorageModeEnum getOptimizeStorage() {
051                return myOptimizeStorage;
052        }
053
054        public ReindexParameters setOptimizeStorage(OptimizeStorageModeEnum theOptimizeStorage) {
055                myOptimizeStorage = theOptimizeStorage;
056                return this;
057        }
058
059        public enum ReindexSearchParametersEnum {
060                ALL,
061                NONE
062        }
063
064        public enum OptimizeStorageModeEnum {
065                NONE,
066                CURRENT_VERSION,
067                ALL_VERSIONS
068        }
069}