1 /*
2 * Copyright 2010 FatWire Corporation. All Rights Reserved.
3 *
4 * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
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 tools.gsf.properties;
17
18 import java.util.Collection;
19
20 /**
21 * Utility to retrieve properties
22 *
23 * @author Tony Field
24 * @since 2011-09-02
25 */
26 public interface PropertyDao {
27 Property getProperty(String name);
28
29 Collection<String> getPropertyNames();
30
31 /**
32 * Set (or re-set) a property value
33 * @param property property object with name and value
34 */
35 void setProperty(Property property);
36
37 /**
38 * Convenience method to set (or re-set) a property value
39 * @param name property name
40 * @param description description of property
41 * @param propertyValue value as a string
42 */
43 void setProperty(String name, String description, String propertyValue);
44
45 /**
46 * Add the property specified to the sites specified. The property is NOT
47 * un-shared from any other sites using this tag (it only adds additional sites)
48 * @param name property name
49 * @param sitename site names to add the property to
50 */
51 void addToSite(String name, String... sitename);
52 }