org.apache.commons.configuration.PropertiesConfigurationLayout Java Examples

The following examples show how to use org.apache.commons.configuration.PropertiesConfigurationLayout. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UpdateCASAction.java    From oxTrust with MIT License 6 votes vote down vote up
public void enable() {
    try {
        log.info("enable() CAS call");
        // enable server-side storage in idp.properties
        String idpConfFolder = shibboleth3ConfService.getIdpConfDir();
        PropertiesConfiguration idpPropertiesConfiguration = new PropertiesConfiguration(idpConfFolder + Shibboleth3ConfService.SHIB3_IDP_PROPERTIES_FILE);
        PropertiesConfigurationLayout layoutConfiguration = new PropertiesConfigurationLayout(idpPropertiesConfiguration);
        
        // CAS require server-side storage
        layoutConfiguration.getConfiguration().setProperty(IDP_SESSION_STORAGESERVICE, configuration.getSessionStorageType());
        layoutConfiguration.getConfiguration().setProperty(IDP_CAS_STORAGESERVICE, configuration.getSessionStorageType());
        layoutConfiguration.getConfiguration().save();
        
        // enable CAS beans in relying-party.xml
        
        updateShibboleth3Configuration();
        
        log.info("enable() CAS - enabled");
    } catch (Exception e) {
        log.error("enable() CAS exception", e);
    }
}
 
Example #2
Source File: UpdateCASAction.java    From oxTrust with MIT License 6 votes vote down vote up
public void disable() {
    try {
        log.info("disable() CAS call");
        // enable server-side storage in idp.properties
        String idpConfFolder = shibboleth3ConfService.getIdpConfDir();
        PropertiesConfiguration idpPropertiesConfiguration = new PropertiesConfiguration(idpConfFolder + Shibboleth3ConfService.SHIB3_IDP_PROPERTIES_FILE);
        PropertiesConfigurationLayout layoutConfiguration = new PropertiesConfigurationLayout(idpPropertiesConfiguration);
        
        // Restore default - client session storage
        layoutConfiguration.getConfiguration().setProperty(IDP_SESSION_STORAGESERVICE, CLIENT_SESSION_STORAGESERVICE);
        layoutConfiguration.getConfiguration().setProperty(IDP_CAS_STORAGESERVICE, configuration.getSessionStorageType());
        layoutConfiguration.getConfiguration().save();
        
        // disable CAS beans in relying-party.xml
        
        updateShibboleth3Configuration();  
        
        log.info("disable() CAS - enabled");
    } catch (Exception e) {
        log.error("disable() CAS exception", e);
    }
}
 
Example #3
Source File: LoggingResource.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
private void loadConfigs() throws FileNotFoundException, ConfigurationException {

        jsonBody = new JSONObject();
        config = new PropertiesConfiguration();
        layout = new PropertiesConfigurationLayout(config);
        layout.load(new InputStreamReader(new FileInputStream(logPropFile)));
    }
 
Example #4
Source File: ShibbolethService.java    From oxTrust with MIT License 5 votes vote down vote up
private void enable(CASProtocolConfiguration casProtocolConfiguration) throws ConfigurationException {
	PropertiesConfigurationLayout layoutConfiguration = idpPropertiesLayout();

	// CAS require server-side storage
	layoutConfiguration.getConfiguration().setProperty(IDP_SESSION_STORAGESERVICE,
			casProtocolConfiguration.getConfiguration().getSessionStorageType());
	layoutConfiguration.getConfiguration().setProperty(IDP_CAS_STORAGESERVICE,
			casProtocolConfiguration.getConfiguration().getSessionStorageType());
	layoutConfiguration.getConfiguration().save();

	// enable CAS beans in relying-party.xml
	updateShibboleth3Configuration();
}
 
Example #5
Source File: ShibbolethService.java    From oxTrust with MIT License 5 votes vote down vote up
private void disable(CASProtocolConfiguration casProtocolConfiguration) throws ConfigurationException {
	PropertiesConfigurationLayout layoutConfiguration = idpPropertiesLayout();

	// Restore default - client session storage
	layoutConfiguration.getConfiguration().setProperty(IDP_SESSION_STORAGESERVICE, CLIENT_SESSION_STORAGESERVICE);
	layoutConfiguration.getConfiguration().setProperty(IDP_CAS_STORAGESERVICE,
			casProtocolConfiguration.getConfiguration().getSessionStorageType());
	layoutConfiguration.getConfiguration().save();

	// disable CAS beans in relying-party.xml
	updateShibboleth3Configuration();

}
 
Example #6
Source File: ShibbolethService.java    From oxTrust with MIT License 4 votes vote down vote up
private PropertiesConfigurationLayout idpPropertiesLayout() throws ConfigurationException {
	String idpConfFolder = shibboleth3ConfService.getIdpConfDir();
	PropertiesConfiguration idpPropertiesConfiguration = new PropertiesConfiguration(
			idpConfFolder + Shibboleth3ConfService.SHIB3_IDP_PROPERTIES_FILE);
	return new PropertiesConfigurationLayout(idpPropertiesConfiguration);
}