001/* 002 * Copyright 2011-2016 UnboundID Corp. 003 * 004 * This program is free software; you can redistribute it and/or modify 005 * it under the terms of the GNU General Public License (GPLv2 only) 006 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only) 007 * as published by the Free Software Foundation. 008 * 009 * This program is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 012 * GNU General Public License for more details. 013 * 014 * You should have received a copy of the GNU General Public License 015 * along with this program; if not, see <http://www.gnu.org/licenses>. 016 */ 017 018package com.unboundid.scim.sdk; 019 020import java.util.concurrent.atomic.AtomicBoolean; 021import java.util.concurrent.atomic.AtomicInteger; 022 023 024 025/** 026 * This class contains mutable configuration settings for a SCIM Backend. 027 */ 028public class SCIMBackendConfig 029{ 030 /** 031 * The maximum number of resources that are returned in a response. 032 */ 033 private final AtomicInteger maxResults = new AtomicInteger(Integer.MAX_VALUE); 034 035 /** 036 * Whether to perform schema checking. 037 */ 038 private final AtomicBoolean checkSchema = new AtomicBoolean(true); 039 040 041 042 /** 043 * Retrieve the maximum number of resources that are returned in a response. 044 * @return The maximum number of resources that are returned in a response. 045 */ 046 public int getMaxResults() 047 { 048 return maxResults.intValue(); 049 } 050 051 052 053 /** 054 * Specify the maximum number of resources that are returned in a response. 055 * @param maxResults The maximum number of resources that are returned in 056 * a response. 057 */ 058 public void setMaxResults(final int maxResults) 059 { 060 this.maxResults.set(maxResults); 061 } 062 063 064 065 /** 066 * Whether to perform schema checking. 067 * 068 * @return {@code true} to perform schema checking and 069 * {@code false} otherwise. 070 */ 071 public boolean isCheckSchema() 072 { 073 return checkSchema.get(); 074 } 075 076 077 078 /** 079 * Specify whether to perform schema checking. 080 * 081 * @param checkSchema {@code true} to perform schema checking and 082 * {@code false} otherwise. 083 */ 084 public void setCheckSchema(final boolean checkSchema) 085 { 086 this.checkSchema.set(checkSchema); 087 } 088}