001/** 002 * Copyright 2010-2014 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.common.util.config.supplier; 017 018import java.util.List; 019import java.util.Properties; 020 021import org.springframework.util.Assert; 022 023/** 024 * @deprecated 025 */ 026@Deprecated 027public class ConfigPropertiesSupplier implements PropertiesSupplier { 028 029 org.kuali.common.util.config.service.ConfigService service; 030 List<String> configIds; 031 Properties overrides; 032 033 public ConfigPropertiesSupplier() { 034 this(null, null); 035 } 036 037 public ConfigPropertiesSupplier(List<String> configIds, org.kuali.common.util.config.service.ConfigService service) { 038 this(configIds, service, null); 039 } 040 041 public ConfigPropertiesSupplier(List<String> configIds, org.kuali.common.util.config.service.ConfigService service, Properties overrides) { 042 super(); 043 this.configIds = configIds; 044 this.service = service; 045 this.overrides = overrides; 046 } 047 048 @Override 049 public Properties getProperties() { 050 051 // Make sure we are configured correctly 052 Assert.notNull(service, "service is null"); 053 054 // Load properties for the configIds they've provided (if any) 055 return service.getProperties(configIds, overrides); 056 } 057 058 public org.kuali.common.util.config.service.ConfigService getService() { 059 return service; 060 } 061 062 public void setService(org.kuali.common.util.config.service.ConfigService service) { 063 this.service = service; 064 } 065 066 public List<String> getConfigIds() { 067 return configIds; 068 } 069 070 public void setConfigIds(List<String> configIds) { 071 this.configIds = configIds; 072 } 073 074 public Properties getOverrides() { 075 return overrides; 076 } 077 078 public void setOverrides(Properties overrides) { 079 this.overrides = overrides; 080 } 081 082}