Skip to content

Commit

Permalink
set reverse prefix if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwechner committed May 3, 2014
1 parent 8387bdb commit b753d25
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/core/java/org/wyona/yanel/core/map/RealmManagerConfig.java
Expand Up @@ -18,7 +18,8 @@

import java.io.File;

import org.apache.log4j.Logger;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;

import org.wyona.yanel.core.ConfigurationException;

Expand All @@ -30,7 +31,7 @@
*/
public class RealmManagerConfig {

private static Logger log = Logger.getLogger(RealmManagerConfig.class);
private static Logger log = LogManager.getLogger(RealmManagerConfig.class);

private File realmsConfigFile;

Expand Down Expand Up @@ -86,12 +87,22 @@ public RealmContextConfig[] getRealmContextConfigs(File realmsConfigFile) throws
Configuration proxy = realmElements[i].getChild("reverse-proxy", false);
if (proxy != null) {
int proxyPort = new Integer(proxy.getChild("port").getValue("-1")).intValue();

int proxySSLPort = new Integer(proxy.getChild("ssl-port").getValue("-1")).intValue();

String prefixValue = proxy.getChild("prefix").getValue("");
if (prefixValue.length() == 0) prefixValue = null;
log.debug("Prefix value: " + prefixValue);

String reversePrefixValue = proxy.getChild("reverse-prefix").getValue("");
if (reversePrefixValue.length() == 0) reversePrefixValue = null;
log.debug("Reverse prefix value: " + reversePrefixValue);

String hostName = proxy.getChild("host-name").getValue();
rcc.setReverseProxyConfig(new ReverseProxyConfig(hostName, proxyPort, proxySSLPort, prefixValue));

ReverseProxyConfig rpc = new ReverseProxyConfig(hostName, proxyPort, proxySSLPort, prefixValue);
rpc.setReversePrefix(reversePrefixValue);
rcc.setReverseProxyConfig(rpc);
}

realmContextConfigsVec.add(rcc);
Expand Down

0 comments on commit b753d25

Please sign in to comment.