Package org.glassfish.api.admin.AccessRequired

Examples of org.glassfish.api.admin.AccessRequired.AccessCheck


    }

    @Override
    public Collection<? extends AccessCheck> getAccessChecks() {
        final Collection<AccessCheck> checks = new ArrayList<AccessCheck>();
        checks.add(new AccessCheck(parentBean, (Class<? extends ConfigBeanProxy>) targetType, "create"));
        return checks;
    }
View Full Code Here


    @Override
    public Collection<? extends AccessCheck> getAccessChecks() {
        final List<AccessCheck> accessChecks = new ArrayList<AccessCheck>();
        /* Read access to the collection of applications. */
        accessChecks.add(new AccessCheck(DeploymentCommandUtils.APPLICATION_RESOURCE_NAME, "read"));
       
        /*
         * Because the command displays detailed information about the matching
         * apps, require read access to each app to be displayed.
         */
        for (Application app : domain.getApplicationsInTarget(target)) {
            if (!app.isLifecycleModule()) {
                if (type == null || isApplicationOfThisType(app, type)) {
                    apps.add(app);
                    accessChecks.add(new AccessCheck(AccessRequired.Util.resourceNameFromConfigBeanProxy(app), "read"));
                }
            }
        }
        return accessChecks;
    }
View Full Code Here

                configName = cluster.getConfigRef();
            }
        }
        config = configs.getConfigByName(configName);
        if (config != null) {
            accessChecks.add(new AccessCheck(AccessRequired.Util.resourceNameFromConfigBeanProxy(config), "read"));
        }
        return accessChecks;
    }
View Full Code Here

        accessChecks = new ArrayList<AccessCheck>();
        if (!DeploymentUtils.isDomainTarget(target)) {
           
            ApplicationRef applicationRef = domain.getApplicationRefInTarget(name(), target);
            if (applicationRef != null && ! Boolean.getBoolean(applicationRef.getEnabled())) {
                accessChecks.add(new AccessCheck(applicationRef, ENABLE_ACTION, true));
            }
        } else {
            /*
             * The target is "domain" so expand that to all places where the
             * app is assigned.
             */
            for (String t : domain.getAllReferencedTargetsForApplication(target)) {
                final ApplicationRef applicationRef = domain.getApplicationRefInTarget(name(), t);
                if (applicationRef != null && ! Boolean.getBoolean(applicationRef.getEnabled())) {
                    accessChecks.add(new AccessCheck(applicationRef, ENABLE_ACTION, true));
                }
            }
        }
        /*
         * Add an access check for enabling the app itself.
         */
        final String resourceForApp = DeploymentCommandUtils.getResourceNameForExistingApp(domain, name());
        if (resourceForApp != null) {
            accessChecks.add(new AccessCheck(resourceForApp, ENABLE_ACTION));
        }
        return accessChecks;
    }
View Full Code Here

        if (env.isDas() && DeploymentUtils.isDomainTarget(target)) {
            targets = domain.getAllReferencedTargetsForApplication(name);
            for (String t : targets) {
                final String resourceName = DeploymentCommandUtils.getTargetResourceNameForExistingAppRef(domain, t, name);
                if (resourceName != null) {
                    accessChecks.add(new AccessCheck(resourceName, "delete"));
                }
            }
        } else {
            final String resourceName = DeploymentCommandUtils.getTargetResourceNameForExistingAppRef(domain, target, name);
            if (resourceName != null) {
                accessChecks.add(new AccessCheck(resourceName, "delete"));
            }
        }
        return accessChecks;
    }
View Full Code Here

    public Collection<? extends AccessCheck> getAccessChecks() {
        final List<AccessCheck> accessChecks = new ArrayList<AccessCheck>();
        /*
         * One check for the life cycle module itself.
         */
        accessChecks.add(new AccessCheck(DeploymentCommandUtils.APPLICATION_RESOURCE_NAME, "create"));
       
        /*
         * One check for the target.
         */
        accessChecks.add(new AccessCheck(
                DeploymentCommandUtils.getTargetResourceNameForNewAppRef(domain, target), "create"));
        return accessChecks;
    }
View Full Code Here

    @Override
    public Collection<? extends AccessCheck> getAccessChecks() {
        final List<AccessCheck> accessChecks = new ArrayList<AccessCheck>();
        appRefs = domain.getApplicationRefsInTarget(target);
        for (ApplicationRef appRef : appRefs) {
            accessChecks.add(new AccessCheck(AccessRequired.Util.resourceNameFromConfigBeanProxy(appRef), "read"));
        }
        return accessChecks;
    }
View Full Code Here

    @Override
    public Collection<? extends AccessCheck> getAccessChecks() {
        final List<AccessCheck> accessChecks = new ArrayList<AccessCheck>();
        app = applications.getApplication(appname);
        if (app != null) {
            accessChecks.add(new AccessCheck(AccessRequired.Util.resourceNameFromConfigBeanProxy(app), "provision"));
            appRef = domain.getApplicationRefInTarget(appname, DeploymentUtils.DAS_TARGET_NAME);
            if (appRef != null) {
                accessChecks.add(new AccessCheck(AccessRequired.Util.resourceNameFromConfigBeanProxy(appRef), "provision"));
            }
        }
        return accessChecks;
    }
View Full Code Here

    @Override
    public Collection<? extends AccessCheck> getAccessChecks() {
        final List<AccessCheck> accessChecks = new ArrayList<AccessCheck>();
        appRefs = domain.getApplicationRefsInTarget(target);
        for (ApplicationRef appRef : appRefs) {
            accessChecks.add(new AccessCheck(AccessRequired.Util.resourceNameFromConfigBeanProxy(appRef), "read"));
        }
        return accessChecks;
    }
View Full Code Here

   
    @Override
    public Collection<? extends AccessCheck> getAccessChecks() {
        final List<AccessCheck> accessChecks = new ArrayList<AccessCheck>();
        accessChecks.add(new AccessCheck(DeploymentCommandUtils.getResourceNameForApps(domain), "create"));
        accessChecks.add(new AccessCheck(DeploymentCommandUtils.getTargetResourceNameForNewAppRef(domain, target), "create"));
       
        /*
         * If this app is already deployed then this operation also represents
         * an undeployment - a delete - of that app. 
         */
        if (isredeploy) {
            final String appResource = DeploymentCommandUtils.getResourceNameForNewApp(domain, name);
            accessChecks.add(new AccessCheck(appResource, "delete"));
            final String appRefResource = DeploymentCommandUtils.getTargetResourceNameForNewAppRef(domain, target, name);
            accessChecks.add(new AccessCheck(appRefResource, "delete"));
        }
       
        return accessChecks;
    }
View Full Code Here

TOP

Related Classes of org.glassfish.api.admin.AccessRequired.AccessCheck

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.