Search in sources :

Example 1 with ConnectionManager

use of org.glassfish.loadbalancer.admin.cli.connection.ConnectionManager in project Payara by payara.

the class ApplyHttpLbChanges method process.

public void process() throws Exception {
    ConnectionManager _connectionManager = null;
    LoadBalancer lb = LbConfigHelper.getLoadBalancer(domain, lbName);
    String lbHost = lb.getDeviceHost();
    String lbPort = lb.getDevicePort();
    String lbProxyHost = null;
    String lbProxyPort = null;
    Property lbProxyHostProperty = lb.getProperty(SSL_PROXY_HOST_PROPERTY);
    if (lbProxyHostProperty != null) {
        lbProxyHost = lbProxyHostProperty.getValue();
        Property lbProxyPortProperty = lb.getProperty(SSL_PROXY_PORT_PROPERTY);
        if (lbProxyPortProperty != null) {
            lbProxyPort = lbProxyPortProperty.getValue();
        }
    }
    boolean isSec = true;
    Property isSecProperty = lb.getProperty(IS_SECURE_PROPERTY);
    if (isSecProperty != null) {
        isSec = Boolean.getBoolean(isSecProperty.getValue());
    }
    _connectionManager = new ConnectionManager(lbHost, lbPort, lbProxyHost, lbProxyPort, lbName, isSec);
    if (ping != null && Boolean.valueOf(ping).booleanValue()) {
        ping(_connectionManager);
    } else {
        publish(_connectionManager, domain, lb.getLbConfigName());
    }
}
Also used : ConnectionManager(org.glassfish.loadbalancer.admin.cli.connection.ConnectionManager) LoadBalancer(org.glassfish.loadbalancer.config.LoadBalancer) Property(org.jvnet.hk2.config.types.Property)

Aggregations

ConnectionManager (org.glassfish.loadbalancer.admin.cli.connection.ConnectionManager)1 LoadBalancer (org.glassfish.loadbalancer.config.LoadBalancer)1 Property (org.jvnet.hk2.config.types.Property)1