Search in sources :

Example 1 with IdempotentUrlPatternReader

use of org.glassfish.loadbalancer.admin.cli.reader.api.IdempotentUrlPatternReader in project Payara by payara.

the class IdempotentUrlPatternVisitor method visit.

/**
 * Visit reader class
 */
@Override
public void visit(BaseReader br) throws Exception {
    // FIXME, make as assert here about no class cast exception
    if (br instanceof IdempotentUrlPatternReader) {
        IdempotentUrlPatternReader iRdr = (IdempotentUrlPatternReader) br;
        _m.addIdempotentUrlPattern(true);
        _m.setAttributeValue(WebModule.IDEMPOTENT_URL_PATTERN, _i, URL_PATTERN, iRdr.getUrlPattern());
        _m.setAttributeValue(WebModule.IDEMPOTENT_URL_PATTERN, _i, RETRIES, iRdr.getNoOfRetries());
    }
}
Also used : IdempotentUrlPatternReader(org.glassfish.loadbalancer.admin.cli.reader.api.IdempotentUrlPatternReader)

Example 2 with IdempotentUrlPatternReader

use of org.glassfish.loadbalancer.admin.cli.reader.api.IdempotentUrlPatternReader in project Payara by payara.

the class WebModuleVisitor method visit.

/**
 * Visit reader class
 */
@Override
public void visit(BaseReader br) throws Exception {
    // FIXME, make as assert here about no class cast exception
    if (br instanceof BaseReader) {
        WebModuleReader wRdr = (WebModuleReader) br;
        _w.setContextRoot(wRdr.getContextRoot());
        String url = wRdr.getErrorUrl();
        if ((url != null) && (!"".equals(url))) {
            // XXX start of bug fix for 6171814
            _c.createAttribute(Cluster.WEB_MODULE, "error-url", "ErrorUrl", AttrProp.CDATA, null, "");
            // XXX end of bug fix for 6171814
            _w.setErrorUrl(wRdr.getErrorUrl());
        }
        _w.setEnabled(Boolean.toString(wRdr.getLbEnabled()));
        _w.setDisableTimeoutInMinutes(wRdr.getDisableTimeoutInMinutes());
        IdempotentUrlPatternReader[] iRdrs = wRdr.getIdempotentUrlPattern();
        if ((iRdrs != null) && (iRdrs.length > 0)) {
            for (int i = 0; i < iRdrs.length; i++) {
                iRdrs[i].accept(new IdempotentUrlPatternVisitor(_w, i));
            }
        }
    }
}
Also used : BaseReader(org.glassfish.loadbalancer.admin.cli.reader.api.BaseReader) WebModuleReader(org.glassfish.loadbalancer.admin.cli.reader.api.WebModuleReader) IdempotentUrlPatternReader(org.glassfish.loadbalancer.admin.cli.reader.api.IdempotentUrlPatternReader)

Aggregations

IdempotentUrlPatternReader (org.glassfish.loadbalancer.admin.cli.reader.api.IdempotentUrlPatternReader)2 BaseReader (org.glassfish.loadbalancer.admin.cli.reader.api.BaseReader)1 WebModuleReader (org.glassfish.loadbalancer.admin.cli.reader.api.WebModuleReader)1