@Override public Object run(HttpService param) { final List<Property> propertyList = new ArrayList<Property>(param.getProperty()); final Iterator<Property> it = propertyList.iterator(); while (it.hasNext()) { final Property property = it.next(); if ("accessLoggingEnabled".equals(property.getName())) { param.setAccessLoggingEnabled(property.getValue()); it.remove(); } else if ("accessLogBufferSize".equals(property.getName())) { param.getAccessLog().setBufferSizeBytes(property.getValue()); it.remove(); } else if ("accessLogWriterInterval".equals(property.getName())) { param.getAccessLog().setWriteIntervalSeconds(property.getValue()); it.remove(); } else if ("sso-enabled".equals(property.getName())) { param.setSsoEnabled(property.getValue()); it.remove(); } } param.getProperty().clear(); param.getProperty().addAll(propertyList); return null; } }, service);
globalAccessLogWriteInterval = httpService.getAccessLog().getWriteIntervalSeconds(); globalAccessLogBufferSize = httpService.getAccessLog().getBufferSizeBytes(); if (httpServiceProps != null) { for (Property httpServiceProp : httpServiceProps) {
/** * Processes an update to the http-service element */ public void updateHttpService(HttpService httpService) throws LifecycleException { if (httpService == null) { return; } /* * Update each virtual server with the sso-enabled and * access logging related properties of the updated http-service */ globalSSOEnabled = ConfigBeansUtilities.toBoolean(httpService.getSsoEnabled()); globalAccessLogWriteInterval = httpService.getAccessLog().getWriteIntervalSeconds(); globalAccessLogBufferSize = httpService.getAccessLog().getBufferSizeBytes(); globalAccessLoggingEnabled = ConfigBeansUtilities.toBoolean(httpService.getAccessLoggingEnabled()); // for availability-service.web-container-availability webContainerFeatureFactory = getWebContainerFeatureFactory(); List<com.sun.enterprise.config.serverbeans.VirtualServer> virtualServers = httpService.getVirtualServer(); for (com.sun.enterprise.config.serverbeans.VirtualServer virtualServer : virtualServers) { final VirtualServer vs = (VirtualServer) getEngine().findChild(virtualServer.getId()); if (vs != null) { vs.configureSingleSignOn(globalSSOEnabled, webContainerFeatureFactory, isSsoFailoverEnabled()); vs.reconfigureAccessLog(globalAccessLogBufferSize, globalAccessLogWriteInterval, habitat, domain, globalAccessLoggingEnabled); updateHost(virtualServer); } } }
@Override public Object run(HttpService param) { final List<Property> propertyList = new ArrayList<Property>(param.getProperty()); final Iterator<Property> it = propertyList.iterator(); while (it.hasNext()) { final Property property = it.next(); if ("accessLoggingEnabled".equals(property.getName())) { param.setAccessLoggingEnabled(property.getValue()); it.remove(); } else if ("accessLogBufferSize".equals(property.getName())) { param.getAccessLog().setBufferSizeBytes(property.getValue()); it.remove(); } else if ("accessLogWriterInterval".equals(property.getName())) { param.getAccessLog().setWriteIntervalSeconds(property.getValue()); it.remove(); } else if ("sso-enabled".equals(property.getName())) { param.setSsoEnabled(property.getValue()); it.remove(); } } param.getProperty().clear(); param.getProperty().addAll(propertyList); return null; } }, service);
private void upgrade(final AdminCommandContext context, final Property property, final HttpService service) throws TransactionFailure { if ("accessLoggingEnabled".equals(property.getName())) { updatePropertyToAttribute(context, service, "accessLoggingEnabled", "accessLoggingEnabled"); } else if ("accessLogBufferSize".equals(property.getName())) { ConfigSupport.apply(new SingleConfigCode<AccessLog>() { @Override public Object run(AccessLog param) { param.setBufferSizeBytes(property.getValue()); return param; } }, service.getAccessLog()); removeProperty(service, "accessLogBufferSize"); report(context, "Moved http-service.property.accessLogBufferSize to http-service.access-log.buffer-size-bytes"); } else if ("accessLogWriteInterval".equals(property.getName())) { ConfigSupport.apply(new SingleConfigCode<AccessLog>() { @Override public Object run(AccessLog param) { param.setWriteIntervalSeconds(property.getValue()); return param; } }, service.getAccessLog()); removeProperty(service, "accessLogWriteInterval"); report(context, "Moved http-service.property.accessLogWriteInterval to http-service.access-log.write-interval-seconds"); } else if ("sso-enabled".equals(property.getName())) { updatePropertyToAttribute(context, service, "sso-enabled", "ssoEnabled"); } }
private void upgrade(final AdminCommandContext context, final Property property, final HttpService service) throws TransactionFailure { if ("accessLoggingEnabled".equals(property.getName())) { updatePropertyToAttribute(context, service, "accessLoggingEnabled", "accessLoggingEnabled"); } else if ("accessLogBufferSize".equals(property.getName())) { ConfigSupport.apply(new SingleConfigCode<AccessLog>() { @Override public Object run(AccessLog param) { param.setBufferSizeBytes(property.getValue()); return param; } }, service.getAccessLog()); removeProperty(service, "accessLogBufferSize"); report(context, "Moved http-service.property.accessLogBufferSize to http-service.access-log.buffer-size-bytes"); } else if ("accessLogWriteInterval".equals(property.getName())) { ConfigSupport.apply(new SingleConfigCode<AccessLog>() { @Override public Object run(AccessLog param) { param.setWriteIntervalSeconds(property.getValue()); return param; } }, service.getAccessLog()); removeProperty(service, "accessLogWriteInterval"); report(context, "Moved http-service.property.accessLogWriteInterval to http-service.access-log.write-interval-seconds"); } else if ("sso-enabled".equals(property.getName())) { updatePropertyToAttribute(context, service, "sso-enabled", "ssoEnabled"); } }
AccessLog accessLogConfig = httpService.getAccessLog();