View Javadoc
1   /**
2    * Copyright 2010-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.common.util.config.supplier;
17  
18  import java.util.List;
19  import java.util.Properties;
20  
21  import org.springframework.util.Assert;
22  
23  /**
24   * @deprecated
25   */
26  @Deprecated
27  public class ConfigPropertiesSupplier implements PropertiesSupplier {
28  
29  	org.kuali.common.util.config.service.ConfigService service;
30  	List<String> configIds;
31  	Properties overrides;
32  
33  	public ConfigPropertiesSupplier() {
34  		this(null, null);
35  	}
36  
37  	public ConfigPropertiesSupplier(List<String> configIds, org.kuali.common.util.config.service.ConfigService service) {
38  		this(configIds, service, null);
39  	}
40  
41  	public ConfigPropertiesSupplier(List<String> configIds, org.kuali.common.util.config.service.ConfigService service, Properties overrides) {
42  		super();
43  		this.configIds = configIds;
44  		this.service = service;
45  		this.overrides = overrides;
46  	}
47  
48  	@Override
49  	public Properties getProperties() {
50  
51  		// Make sure we are configured correctly
52  		Assert.notNull(service, "service is null");
53  
54  		// Load properties for the configIds they've provided (if any)
55  		return service.getProperties(configIds, overrides);
56  	}
57  
58  	public org.kuali.common.util.config.service.ConfigService getService() {
59  		return service;
60  	}
61  
62  	public void setService(org.kuali.common.util.config.service.ConfigService service) {
63  		this.service = service;
64  	}
65  
66  	public List<String> getConfigIds() {
67  		return configIds;
68  	}
69  
70  	public void setConfigIds(List<String> configIds) {
71  		this.configIds = configIds;
72  	}
73  
74  	public Properties getOverrides() {
75  		return overrides;
76  	}
77  
78  	public void setOverrides(Properties overrides) {
79  		this.overrides = overrides;
80  	}
81  
82  }