private final Log log = LogFactory.getLog(this.getClass());
public void initialize(Configuration configuration) throws Exception {
SystemManagerLocal systemManager = LookupUtil.getSystemManager();
Subject overlord = LookupUtil.getSubjectManager().getOverlord();
SystemSettings settings = systemManager.getSystemSettings(overlord);
url = safeGetConfigurationProperty("url", configuration);
if (url == null) {
throw new IllegalArgumentException("url cannot be null");
}
PropertySimple activeProperty = configuration.getSimple("active");
if (activeProperty != null)
active = activeProperty.getBooleanValue();
username = safeGetConfigurationProperty("username", configuration);
password = safeGetConfigurationProperty("password", configuration);
proxyUrl = safeGetConfigurationProperty("proxyUrl", configuration);
proxyUsername = safeGetConfigurationProperty("proxyUsername", configuration);
proxyPassword = safeGetConfigurationProperty("proxyPassword", configuration);
String sProxyPort = safeGetConfigurationProperty("proxyPort", configuration);
if (sProxyPort != null) {
proxyPort = Integer.parseInt(sProxyPort);
}
// default to global HTTP Proxy settings
if (proxyUrl == null) {
proxyUrl = settings.get(SystemSetting.HTTP_PROXY_SERVER_HOST);
}
if (proxyUsername == null) {
proxyUsername = settings.get(SystemSetting.HTTP_PROXY_SERVER_USERNAME);
}
if (proxyPassword == null) {
proxyPassword = settings.get(SystemSetting.HTTP_PROXY_SERVER_PASSWORD);
}
if (sProxyPort == null) {
sProxyPort = settings.get(SystemSetting.HTTP_PROXY_SERVER_PORT);
if (sProxyPort != null) {
proxyPort = Integer.parseInt(sProxyPort);
}
}
}