1 |
5033
|
daigle
|
/**
|
2 |
|
|
* '$RCSfile$'
|
3 |
|
|
* Purpose: A Class that loads eml-access.xml file containing ACL
|
4 |
|
|
* for a metadata document into relational DB
|
5 |
|
|
* Copyright: 2000 Regents of the University of California and the
|
6 |
|
|
* National Center for Ecological Analysis and Synthesis
|
7 |
|
|
* Authors: Jivka Bojilova
|
8 |
|
|
*
|
9 |
|
|
* '$Author: daigle $'
|
10 |
|
|
* '$Date: 2009-03-25 14:04:06 -0800 (Wed, 25 Mar 2009) $'
|
11 |
|
|
* '$Revision: 4863 $'
|
12 |
|
|
*
|
13 |
|
|
* This program is free software; you can redistribute it and/or modify
|
14 |
|
|
* it under the terms of the GNU General Public License as published by
|
15 |
|
|
* the Free Software Foundation; either version 2 of the License, or
|
16 |
|
|
* (at your option) any later version.
|
17 |
|
|
*
|
18 |
|
|
* This program is distributed in the hope that it will be useful,
|
19 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
20 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
21 |
|
|
* GNU General Public License for more details.
|
22 |
|
|
*
|
23 |
|
|
* You should have received a copy of the GNU General Public License
|
24 |
|
|
* along with this program; if not, write to the Free Software
|
25 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
26 |
|
|
*/
|
27 |
|
|
|
28 |
|
|
package edu.ucsb.nceas.metacat.properties;
|
29 |
|
|
|
30 |
|
|
import java.util.Map;
|
31 |
|
|
import java.util.Vector;
|
32 |
|
|
|
33 |
|
|
import javax.servlet.ServletContext;
|
34 |
|
|
import javax.servlet.http.HttpServletRequest;
|
35 |
|
|
|
36 |
|
|
import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
|
37 |
|
|
import edu.ucsb.nceas.metacat.shared.ServiceException;
|
38 |
|
|
import edu.ucsb.nceas.utilities.GeneralPropertyException;
|
39 |
|
|
import edu.ucsb.nceas.utilities.PropertiesMetaData;
|
40 |
|
|
import edu.ucsb.nceas.utilities.PropertyNotFoundException;
|
41 |
|
|
import edu.ucsb.nceas.utilities.SortedProperties;
|
42 |
|
|
|
43 |
|
|
/**
|
44 |
|
|
* This interface will handle properties access
|
45 |
|
|
*/
|
46 |
|
|
public interface PropertiesInterface {
|
47 |
|
|
|
48 |
|
|
// system is configured
|
49 |
|
|
public static final String CONFIGURED = "true";
|
50 |
|
|
// system has never been configured
|
51 |
|
|
public static final String UNCONFIGURED = "false";
|
52 |
|
|
public static final String BYPASSED = "bypassed";
|
53 |
|
|
|
54 |
|
|
// public PropertiesInterface getInstance() throws ServiceException;
|
55 |
|
|
|
56 |
|
|
public String getProperty(String propertyName) throws PropertyNotFoundException;
|
57 |
|
|
|
58 |
|
|
public Vector<String> getPropertyNames();
|
59 |
|
|
|
60 |
|
|
public Vector<String> getPropertyNamesByGroup(String groupName);
|
61 |
|
|
|
62 |
|
|
public Map<String, String> getPropertiesByGroup(String groupName) throws PropertyNotFoundException;
|
63 |
|
|
|
64 |
6030
|
leinfelder
|
public void addProperty(String propertyName, String value) throws GeneralPropertyException;
|
65 |
|
|
|
66 |
5033
|
daigle
|
public void setProperty(String propertyName, String newValue) throws GeneralPropertyException;
|
67 |
|
|
|
68 |
|
|
public void setPropertyNoPersist(String propertyName, String newValue) throws GeneralPropertyException;
|
69 |
|
|
|
70 |
|
|
public void persistProperties() throws GeneralPropertyException;
|
71 |
|
|
|
72 |
5846
|
leinfelder
|
public boolean checkAndSetProperty(HttpServletRequest request, String propertyName) throws GeneralPropertyException;
|
73 |
5033
|
daigle
|
|
74 |
|
|
public SortedProperties getMainBackupProperties() throws GeneralPropertyException;
|
75 |
|
|
|
76 |
|
|
public SortedProperties getAuthBackupProperties() throws GeneralPropertyException;
|
77 |
|
|
|
78 |
|
|
public PropertiesMetaData getMainMetaData() throws GeneralPropertyException;
|
79 |
|
|
|
80 |
|
|
public PropertiesMetaData getAuthMetaData() throws GeneralPropertyException;
|
81 |
|
|
|
82 |
|
|
public void persistMainBackupProperties() throws GeneralPropertyException;
|
83 |
|
|
|
84 |
|
|
public void persistAuthBackupProperties(ServletContext servletContext) throws GeneralPropertyException;
|
85 |
|
|
|
86 |
|
|
public boolean arePropertiesConfigured() throws GeneralPropertyException;
|
87 |
|
|
|
88 |
|
|
public boolean doBypass() throws GeneralPropertyException;
|
89 |
|
|
|
90 |
|
|
public void bypassConfiguration() throws GeneralPropertyException;
|
91 |
|
|
|
92 |
|
|
}
|