001package ca.uhn.fhir.jpa.api.model; 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 org.apache.commons.lang3.builder.ToStringBuilder; 024import org.apache.commons.lang3.builder.ToStringStyle; 025 026public class ExpungeOptions { 027 private int myLimit = 1000; 028 private boolean myExpungeOldVersions; 029 private boolean myExpungeDeletedResources; 030 private boolean myExpungeEverything; 031 032 @Override 033 public String toString() { 034 return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) 035 .append("limit", myLimit) 036 .append("oldVersions", myExpungeOldVersions) 037 .append("deletedResources", myExpungeDeletedResources) 038 .append("everything", myExpungeEverything) 039 .toString(); 040 } 041 042 /** 043 * The maximum number of resources versions to expunge 044 */ 045 public int getLimit() { 046 return myLimit; 047 } 048 049 /** 050 * The maximum number of resource versions to expunge 051 */ 052 public ExpungeOptions setLimit(int theLimit) { 053 myLimit = theLimit; 054 return this; 055 } 056 057 public boolean isExpungeEverything() { 058 return myExpungeEverything; 059 } 060 061 public ExpungeOptions setExpungeEverything(boolean theExpungeEverything) { 062 myExpungeEverything = theExpungeEverything; 063 return this; 064 } 065 066 public boolean isExpungeDeletedResources() { 067 return myExpungeDeletedResources; 068 } 069 070 public ExpungeOptions setExpungeDeletedResources(boolean theExpungeDeletedResources) { 071 myExpungeDeletedResources = theExpungeDeletedResources; 072 return this; 073 } 074 075 public boolean isExpungeOldVersions() { 076 return myExpungeOldVersions; 077 } 078 079 public ExpungeOptions setExpungeOldVersions(boolean theExpungeOldVersions) { 080 myExpungeOldVersions = theExpungeOldVersions; 081 return this; 082 } 083}