/** * Extract the set of version(s) of the given application represented as * an untagged version name * * @param untaggedName the application name as an untagged version : an * application name without version identifier * @param target the target where we want to get all the versions * @return all the version(s) of the given application */ private final List<String> getAllversions(String untaggedName, String target) { List<Application> allApplications = null; if (target != null) { allApplications = domain.getApplicationsInTarget(target); } else { allApplications = domain.getApplications().getApplications(); } return VersioningUtils.getVersions(untaggedName, allApplications); }
public static List<Application> getApplicationsInTarget(Domain me, String target) { if (target.equals("domain")) { // special target domain return me.getApplications().getApplications(); } List<Application> apps = new ArrayList<Application>(); List<ApplicationRef> applicationRefs = me.getApplicationRefsInTarget(target); for (ApplicationRef ref : applicationRefs) { Application app = me.getApplications().getApplication(ref.getRef()); if (app != null) { apps.add(app); } } return apps; }
public static List<Application> getApplicationsInTarget(Domain me, String target) { if (target.equals("domain")) { // special target domain return me.getApplications().getApplications(); } List<Application> apps = new ArrayList<Application>(); List<ApplicationRef> applicationRefs = me.getApplicationRefsInTarget(target); for (ApplicationRef ref : applicationRefs) { Application app = me.getApplications().getApplication(ref.getRef()); if (app != null) { apps.add(app); } } return apps; }
/** * Extract the set of version(s) of the given application represented as * an untagged version name * * @param untaggedName the application name as an untagged version : an * application name without version identifier * @param target the target where we want to get all the versions * @return all the version(s) of the given application */ public final List<String> getAllversions(String untaggedName, String target) { List<Application> allApplications = null; if (target != null) { allApplications = domain.getApplicationsInTarget(target); } else { allApplications = domain.getApplications().getApplications(); } return VersioningDeploymentUtil.getVersions(untaggedName, allApplications); }
public static boolean isAppEnabledInTarget( Domain me, String appName, String target) { Application application = me.getApplications().getApplication( appName); if (application != null && Boolean.valueOf(application.getEnabled())) { List<String> targets = new ArrayList<String>(); if (!target.equals("domain")) { targets.add(target); } else { targets = getAllReferencedTargetsForApplication(me, appName); } for (String tgt : targets) { if (!isAppRefEnabledInTarget(me, appName, tgt)) { return false; } } return true; } return false; }
public static boolean isAppEnabledInTarget( Domain me, String appName, String target) { Application application = me.getApplications().getApplication( appName); if (application != null && Boolean.valueOf(application.getEnabled())) { List<String> targets = new ArrayList<String>(); if (!target.equals("domain")) { targets.add(target); } else { targets = getAllReferencedTargetsForApplication(me, appName); } for (String tgt : targets) { if (!isAppRefEnabledInTarget(me, appName, tgt)) { return false; } } return true; } return false; }
/** * @param directory * @return the name of the version currently using the directory, else null * @throws VersioningDeploymentSyntaxException */ public String getVersionFromSameDir(File dir) throws VersioningDeploymentSyntaxException{ try { Iterator it = domain.getApplications().getApplications().iterator(); Application app = null; // check if directory deployment exist while ( it.hasNext() ) { app = (Application) it.next(); if (app.getLocation().equals(dir.toURI().toString())) { if(!VersioningDeploymentUtil.getUntaggedName(app.getName()).equals(app.getName())){ return app.getName(); } } } } catch (VersioningDeploymentSyntaxException ex) { // return null if an exception is thrown } return null; } }
/** * Get the version directory-deployed from the given directory * * @param directory * @return the name of the version currently using the directory, else null * @throws VersioningSyntaxException * */ public String getVersionFromSameDir(File dir) throws VersioningSyntaxException{ try { Iterator it = domain.getApplications().getApplications().iterator(); Application app = null; // check if directory deployment exist while ( it.hasNext() ) { app = (Application) it.next(); if (app.getLocation().equals(dir.toURI().toString())) { if(!VersioningUtils.getUntaggedName(app.getName()).equals(app.getName())){ return app.getName(); } } } } catch (VersioningSyntaxException ex) { // return null if an exception is thrown } return null; } }
if (domain.getApplications().getApplication(raname) != null) return;
private boolean isRarEnabled(String raName) { if(raName == null || raName.length() == 0) return false; Application application = getDomain().getApplications().getApplication(raName); if(application != null) { return isApplicationReferenceEnabled(raName); } else if(ConnectorsUtil.belongsToSystemRA(raName)) { return true; } else { return belongToEmbeddedRarAndEnabled(raName); } }
allApps.addAll(domain.getApplications().getApplications()); allApps.addAll(domain.getSystemApplications().getApplications()); for (Application app : allApps) {
allApps.addAll(domain.getApplications().getApplications()); allApps.addAll(domain.getSystemApplications().getApplications()); for (Application app : allApps) {
Applications appsBean = domain.getApplications(); WebModuleConfig wmInfo = findWebModuleInJ2eeApp(appsBean, wmID, appRegistry);
private boolean belongToEmbeddedRarAndEnabled(String resourceAdapterName) { String appName = getAppNameToken(resourceAdapterName); if(appName==null) return false; Applications apps = getDomain().getApplications(); Application app = apps.getApplication(appName); if(app == null || !ConnectorsUtil.parseBoolean(app.getEnabled())) return false; return isApplicationReferenceEnabled(appName); }
public void execute(AdminCommandContext context) { ActionReport report = context.getActionReport(); if (domain.getApplications().getApplication(appName) == null) { report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setMessage("No such application [" + appName + "] is deployed"); return; } ServiceDescription desc = orchestrator.getServiceDescription(appName, service); if (desc == null) { report.setMessage("Service by name [" + service + " ] does not exist for the given application [" + appName + " ]"); report.setActionExitCode(ActionReport.ExitCode.FAILURE); return; } Map<String, Object> descMap = getServiceDescriptionMap(desc); Properties extraProperties = new Properties(); extraProperties.put("list", descMap); report.setExtraProperties(extraProperties); report.setActionExitCode(ActionReport.ExitCode.SUCCESS); }
for (Application application : domain.getApplications().getApplications()) { if (isSameApp(appName, application.getName())) {
final com.sun.enterprise.config.serverbeans.Application appConfig = getDomain().getApplications().getApplication(appName); if ( appConfig == null )
for (Application app : domain.getApplications().getApplications()) { System.out.println("Checking app " + app.getName()); Application app_w = null;
for (Application app : domain.getApplications().getApplications()) { System.out.println("Checking app " + app.getName()); Application app_w = null;
Applications appsBean = domain.getApplications(); wmInfo = findWebModuleInJ2eeApp(appsBean, wmID, appRegistry); if (wmInfo == null) {