public void unregisterTenantWithAppInDomainXML( final String appName, final String tenantName ) throws TransactionFailure, RetryableException { final com.sun.enterprise.config.serverbeans.Application app = applications.getApplication(appName); if (app == null) { throw new IllegalArgumentException("Application " + appName + " not found"); } final AppTenants appTenants = app.getAppTenants(); final AppTenant appTenant = appTenants.getAppTenant(tenantName); if (appTenant == null) { throw new IllegalArgumentException("Tenant " + tenantName + " not provisioned for application " + appName); } Transaction t = new Transaction(); final AppTenants appTenants_w = t.enroll(appTenants); appTenants_w.getAppTenant().remove(appTenant); t.commit(); }
public void unregisterTenantWithAppInDomainXML( final String appName, final String tenantName ) throws TransactionFailure, RetryableException { final com.sun.enterprise.config.serverbeans.Application app = applications.getApplication(appName); if (app == null) { throw new IllegalArgumentException("Application " + appName + " not found"); } final AppTenants appTenants = app.getAppTenants(); final AppTenant appTenant = appTenants.getAppTenant(tenantName); if (appTenant == null) { throw new IllegalArgumentException("Tenant " + tenantName + " not provisioned for application " + appName); } Transaction t = new Transaction(); final AppTenants appTenants_w = t.enroll(appTenants); appTenants_w.getAppTenant().remove(appTenant); t.commit(); }
private AppTenant writeableTenantForApp( final String appName, final Transaction t) throws TransactionFailure, PropertyVetoException { final com.sun.enterprise.config.serverbeans.Application app = applications.getApplication(appName); if (app == null) { throw new IllegalArgumentException("Application " + appName + " not found"); } /* * The app-tenants subelement might or might not already be there. */ AppTenants appTenants = app.getAppTenants(); AppTenants appTenants_w; if (appTenants == null) { com.sun.enterprise.config.serverbeans.Application app_w = t.enroll(app); appTenants_w = app_w.createChild(AppTenants.class); app_w.setAppTenants(appTenants_w); } else { appTenants_w = t.enroll(appTenants); } final List<AppTenant> appTenantList = appTenants_w.getAppTenant(); AppTenant appTenant_w = appTenants_w.createChild(AppTenant.class); appTenantList.add(appTenant_w); return appTenant_w; }
private AppTenant writeableTenantForApp( final String appName, final Transaction t) throws TransactionFailure, PropertyVetoException { final com.sun.enterprise.config.serverbeans.Application app = applications.getApplication(appName); if (app == null) { throw new IllegalArgumentException("Application " + appName + " not found"); } /* * The app-tenants subelement might or might not already be there. */ AppTenants appTenants = app.getAppTenants(); AppTenants appTenants_w; if (appTenants == null) { com.sun.enterprise.config.serverbeans.Application app_w = t.enroll(app); appTenants_w = app_w.createChild(AppTenants.class); app_w.setAppTenants(appTenants_w); } else { appTenants_w = t.enroll(appTenants); } final List<AppTenant> appTenantList = appTenants_w.getAppTenant(); AppTenant appTenant_w = appTenants_w.createChild(AppTenant.class); appTenantList.add(appTenant_w); return appTenant_w; }
private void loadApplicationForTenants(Application app, ApplicationRef appRef, ActionReport report) { if (app.getAppTenants() == null) { return; for (AppTenant tenant : app.getAppTenants().getAppTenant()) { DeployCommandParameters commandParams = app.getDeployParameters(appRef); commandParams.contextroot = tenant.getContextRoot();
private void unloadApplicationForTenants(Application app, ActionReport report) { if (app == null || app.getAppTenants() == null) { return; for (AppTenant tenant : app.getAppTenants().getAppTenant()) { UndeployCommandParameters parameters = new UndeployCommandParameters(); parameters.name = DeploymentUtils.getInternalNameForTenant(app.getName(), tenant.getTenant());